2010-05-18 17:58:33 +02:00
|
|
|
/*
|
2010-09-09 14:16:39 +02:00
|
|
|
* Copyright (c) 2010 The WebM project authors. All Rights Reserved.
|
2010-05-18 17:58:33 +02:00
|
|
|
*
|
2010-06-18 18:39:21 +02:00
|
|
|
* Use of this source code is governed by a BSD-style license
|
2010-06-04 22:19:40 +02: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 18:39:21 +02:00
|
|
|
* in the file PATENTS. All contributing project authors may
|
2010-06-04 22:19:40 +02:00
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
2010-05-18 17:58:33 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __INC_RDOPT_H
|
|
|
|
#define __INC_RDOPT_H
|
2011-04-07 22:57:25 +02:00
|
|
|
|
2012-08-02 19:07:33 +02:00
|
|
|
#define RDCOST(RM,DM,R,D) ( ((128+((int64_t)R)*(RM)) >> 8) + ((int64_t)DM)*(D) )
|
|
|
|
#define RDCOST_8x8(RM,DM,R,D) ( ((128+((int64_t)R)*(RM)) >> 8) + ((int64_t)DM)*(D) )
|
2011-04-07 22:57:25 +02:00
|
|
|
|
2011-04-08 15:21:36 +02: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 20:53:02 +01:00
|
|
|
extern void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int recon_uvoffset,
|
2012-08-02 20:01:48 +02:00
|
|
|
int *returnrate, int *returndistortion, int64_t *returnintra,
|
2012-08-02 19:07:33 +02:00
|
|
|
int64_t *best_single_rd_diff, int64_t *best_comp_rd_diff, int64_t *best_hybrid_rd_diff);
|
2012-04-07 01:38:34 +02:00
|
|
|
extern int vp8_rd_pick_intra_mode(VP8_COMP *cpi, MACROBLOCK *x);
|
2010-05-18 17:58:33 +02:00
|
|
|
|
2011-01-28 16:00:20 +01:00
|
|
|
extern void vp8_mv_pred
|
|
|
|
(
|
2012-07-14 00:21:29 +02:00
|
|
|
VP8_COMP *cpi,
|
|
|
|
MACROBLOCKD *xd,
|
|
|
|
const MODE_INFO *here,
|
|
|
|
int_mv *mvp,
|
|
|
|
int refframe,
|
|
|
|
int *ref_frame_sign_bias,
|
|
|
|
int *sr,
|
|
|
|
int near_sadidx[]
|
2011-01-28 16:00:20 +01:00
|
|
|
);
|
2011-11-21 16:45:10 +01: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-22 01:19:09 +01:00
|
|
|
extern void vp8_set_mbmode_and_mvs(MACROBLOCK *x, MB_PREDICTION_MODE mb, int_mv *mv);
|
2012-06-20 14:07:24 +02:00
|
|
|
extern void rd_update_mvcount(VP8_COMP *cpi,
|
|
|
|
MACROBLOCK *x,
|
|
|
|
int_mv *best_ref_mv,
|
|
|
|
int_mv *second_best_ref_mv);
|
2010-05-18 17:58:33 +02:00
|
|
|
|
|
|
|
#endif
|