2010-05-18 11:58:33 -04:00
|
|
|
/*
|
2010-09-09 08:16:39 -04:00
|
|
|
* Copyright (c) 2010 The WebM project authors. All Rights Reserved.
|
2010-05-18 11:58:33 -04:00
|
|
|
*
|
2010-06-18 12:39:21 -04:00
|
|
|
* Use of this source code is governed by a BSD-style license
|
2010-06-04 16:19:40 -04:00
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
2010-06-18 12:39:21 -04:00
|
|
|
* in the file PATENTS. All contributing project authors may
|
2010-06-04 16:19:40 -04:00
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
2010-05-18 11:58:33 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __INC_RDOPT_H
|
|
|
|
#define __INC_RDOPT_H
|
2011-04-07 16:57:25 -04:00
|
|
|
|
|
|
|
#define RDCOST(RM,DM,R,D) ( ((128+(R)*(RM)) >> 8) + (DM)*(D) )
|
2011-02-14 14:18:18 -08:00
|
|
|
#define RDCOST_8x8(RM,DM,R,D) ( ((128+(R)*(RM)) >> 8) + (DM)*(D) )
|
2011-04-07 16:57:25 -04:00
|
|
|
|
2011-04-08 14:21:36 +01:00
|
|
|
extern void vp8_initialize_rd_consts(VP8_COMP *cpi, int Qvalue);
|
Dual 16x16 inter prediction.
This patch introduces the concept of dual inter16x16 prediction. A
16x16 inter-predicted macroblock can use 2 references instead of 1,
where both references use the same mvmode (new, near/est, zero). In the
case of newmv, this means that two MVs are coded instead of one. The
frame can be encoded in 3 ways: all MBs single-prediction, all MBs dual
prediction, or per-MB single/dual prediction selection ("hybrid"), in
which case a single bit is coded per-MB to indicate whether the MB uses
single or dual inter prediction.
In the future, we can (maybe?) get further gains by mixing this with
Adrian's 32x32 work, per-segment dual prediction settings, or adding
support for dual splitmv/8x8mv inter prediction.
Gain (on derf-set, CQ mode) is ~2.8% (SSIM) or ~3.6% (glb PSNR). Most
gain is at medium/high bitrates, but there's minor gains at low bitrates
also. Output was confirmed to match between encoder and decoder.
Note for optimization people: this patch introduces a 2nd version of
16x16/8x8 sixtap/bilin functions, which does an avg instead of a
store. They may want to look and make sure this is implemented to
their satisfaction so we can optimize it best in the future.
Change-ID: I59dc84b07cbb3ccf073ac0f756d03d294cb19281
2011-12-06 11:53:02 -08:00
|
|
|
extern void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int recon_uvoffset,
|
|
|
|
int *returnrate, int *returndistortion, int *returnintra,
|
2012-02-28 17:25:45 -08:00
|
|
|
int *best_single_rd_diff, int *best_comp_rd_diff, int *best_hybrid_rd_diff);
|
2011-06-08 12:05:05 -04:00
|
|
|
extern void vp8_rd_pick_intra_mode(VP8_COMP *cpi, MACROBLOCK *x, int *rate);
|
2010-05-18 11:58:33 -04:00
|
|
|
|
2011-01-28 10:00:20 -05:00
|
|
|
extern void vp8_mv_pred
|
|
|
|
(
|
|
|
|
VP8_COMP *cpi,
|
|
|
|
MACROBLOCKD *xd,
|
|
|
|
const MODE_INFO *here,
|
2011-05-12 10:50:16 -04:00
|
|
|
int_mv *mvp,
|
2011-01-28 10:00:20 -05:00
|
|
|
int refframe,
|
|
|
|
int *ref_frame_sign_bias,
|
|
|
|
int *sr,
|
|
|
|
int near_sadidx[]
|
|
|
|
);
|
2011-11-21 15:45:10 +00:00
|
|
|
extern void vp8_cal_sad(VP8_COMP *cpi, MACROBLOCKD *xd, MACROBLOCK *x, int recon_yoffset, int near_sadidx[]);
|
|
|
|
extern void vp8_init_me_luts();
|
2011-12-21 16:19:09 -08:00
|
|
|
extern void vp8_set_mbmode_and_mvs(MACROBLOCK *x, MB_PREDICTION_MODE mb, int_mv *mv);
|
2010-05-18 11:58:33 -04:00
|
|
|
|
|
|
|
#endif
|