Commit b06147de authored by Yaowu Xu's avatar Yaowu Xu

Cherry pick from AOMedia

5b5fbade VP9LfSync->VP10LfSync
b752848e vp8_yv12 -> vpx_yv12
e5068cd5 VP9->VPX for reference frame flags

Change-Id: Ia36860499c81a5aca8cd6190e7370ec404c0df0f
parent 8bf837f1
...@@ -208,20 +208,20 @@ typedef enum { ...@@ -208,20 +208,20 @@ typedef enum {
#endif // CONFIG_EXT_TX #endif // CONFIG_EXT_TX
typedef enum { typedef enum {
VP9_LAST_FLAG = 1 << 0, VPX_LAST_FLAG = 1 << 0,
#if CONFIG_EXT_REFS #if CONFIG_EXT_REFS
VP9_LAST2_FLAG = 1 << 1, VPX_LAST2_FLAG = 1 << 1,
VP9_LAST3_FLAG = 1 << 2, VPX_LAST3_FLAG = 1 << 2,
VP9_GOLD_FLAG = 1 << 3, VPX_GOLD_FLAG = 1 << 3,
VP9_BWD_FLAG = 1 << 4, VPX_BWD_FLAG = 1 << 4,
VP9_ALT_FLAG = 1 << 5, VPX_ALT_FLAG = 1 << 5,
VP9_REFFRAME_ALL = (1 << 6) - 1 VPX_REFFRAME_ALL = (1 << 6) - 1
#else #else
VP9_GOLD_FLAG = 1 << 1, VPX_GOLD_FLAG = 1 << 1,
VP9_ALT_FLAG = 1 << 2, VPX_ALT_FLAG = 1 << 2,
VP9_REFFRAME_ALL = (1 << 3) - 1 VPX_REFFRAME_ALL = (1 << 3) - 1
#endif // CONFIG_EXT_REFS #endif // CONFIG_EXT_REFS
} VP9_REFFRAME; } VPX_REFFRAME;
typedef enum { typedef enum {
PLANE_TYPE_Y = 0, PLANE_TYPE_Y = 0,
......
...@@ -91,7 +91,7 @@ typedef struct { ...@@ -91,7 +91,7 @@ typedef struct {
/* assorted loopfilter functions which get used elsewhere */ /* assorted loopfilter functions which get used elsewhere */
struct VP10Common; struct VP10Common;
struct macroblockd; struct macroblockd;
struct VP9LfSyncData; struct VP10LfSyncData;
// This function sets up the bit masks for the entire 64x64 region represented // This function sets up the bit masks for the entire 64x64 region represented
// by mi_row, mi_col. // by mi_row, mi_col.
......
...@@ -34,7 +34,7 @@ static INLINE void mutex_lock(pthread_mutex_t *const mutex) { ...@@ -34,7 +34,7 @@ static INLINE void mutex_lock(pthread_mutex_t *const mutex) {
} }
#endif // CONFIG_MULTITHREAD #endif // CONFIG_MULTITHREAD
static INLINE void sync_read(VP9LfSync *const lf_sync, int r, int c) { static INLINE void sync_read(VP10LfSync *const lf_sync, int r, int c) {
#if CONFIG_MULTITHREAD #if CONFIG_MULTITHREAD
const int nsync = lf_sync->sync_range; const int nsync = lf_sync->sync_range;
...@@ -54,7 +54,7 @@ static INLINE void sync_read(VP9LfSync *const lf_sync, int r, int c) { ...@@ -54,7 +54,7 @@ static INLINE void sync_read(VP9LfSync *const lf_sync, int r, int c) {
#endif // CONFIG_MULTITHREAD #endif // CONFIG_MULTITHREAD
} }
static INLINE void sync_write(VP9LfSync *const lf_sync, int r, int c, static INLINE void sync_write(VP10LfSync *const lf_sync, int r, int c,
const int sb_cols) { const int sb_cols) {
#if CONFIG_MULTITHREAD #if CONFIG_MULTITHREAD
const int nsync = lf_sync->sync_range; const int nsync = lf_sync->sync_range;
...@@ -92,7 +92,7 @@ void thread_loop_filter_rows(const YV12_BUFFER_CONFIG *const frame_buffer, ...@@ -92,7 +92,7 @@ void thread_loop_filter_rows(const YV12_BUFFER_CONFIG *const frame_buffer,
VP10_COMMON *const cm, VP10_COMMON *const cm,
struct macroblockd_plane planes[MAX_MB_PLANE], struct macroblockd_plane planes[MAX_MB_PLANE],
int start, int stop, int y_only, int start, int stop, int y_only,
VP9LfSync *const lf_sync) { VP10LfSync *const lf_sync) {
const int num_planes = y_only ? 1 : MAX_MB_PLANE; const int num_planes = y_only ? 1 : MAX_MB_PLANE;
const int sb_cols = mi_cols_aligned_to_sb(cm) >> cm->mib_size_log2; const int sb_cols = mi_cols_aligned_to_sb(cm) >> cm->mib_size_log2;
int mi_row, mi_col; int mi_row, mi_col;
...@@ -159,7 +159,7 @@ void thread_loop_filter_rows(const YV12_BUFFER_CONFIG *const frame_buffer, ...@@ -159,7 +159,7 @@ void thread_loop_filter_rows(const YV12_BUFFER_CONFIG *const frame_buffer,
} }
// Row-based multi-threaded loopfilter hook // Row-based multi-threaded loopfilter hook
static int loop_filter_row_worker(VP9LfSync *const lf_sync, static int loop_filter_row_worker(VP10LfSync *const lf_sync,
LFWorkerData *const lf_data) { LFWorkerData *const lf_data) {
thread_loop_filter_rows(lf_data->frame_buffer, lf_data->cm, lf_data->planes, thread_loop_filter_rows(lf_data->frame_buffer, lf_data->cm, lf_data->planes,
lf_data->start, lf_data->stop, lf_data->y_only, lf_data->start, lf_data->stop, lf_data->y_only,
...@@ -172,7 +172,7 @@ static void loop_filter_rows_mt(YV12_BUFFER_CONFIG *frame, ...@@ -172,7 +172,7 @@ static void loop_filter_rows_mt(YV12_BUFFER_CONFIG *frame,
struct macroblockd_plane planes[MAX_MB_PLANE], struct macroblockd_plane planes[MAX_MB_PLANE],
int start, int stop, int y_only, int start, int stop, int y_only,
VPxWorker *workers, int nworkers, VPxWorker *workers, int nworkers,
VP9LfSync *lf_sync) { VP10LfSync *lf_sync) {
const VPxWorkerInterface *const winterface = vpx_get_worker_interface(); const VPxWorkerInterface *const winterface = vpx_get_worker_interface();
// Number of superblock rows and cols // Number of superblock rows and cols
const int sb_rows = mi_rows_aligned_to_sb(cm) >> cm->mib_size_log2; const int sb_rows = mi_rows_aligned_to_sb(cm) >> cm->mib_size_log2;
...@@ -239,7 +239,7 @@ void vp10_loop_filter_frame_mt(YV12_BUFFER_CONFIG *frame, ...@@ -239,7 +239,7 @@ void vp10_loop_filter_frame_mt(YV12_BUFFER_CONFIG *frame,
int frame_filter_level, int frame_filter_level,
int y_only, int partial_frame, int y_only, int partial_frame,
VPxWorker *workers, int num_workers, VPxWorker *workers, int num_workers,
VP9LfSync *lf_sync) { VP10LfSync *lf_sync) {
int start_mi_row, end_mi_row, mi_rows_to_filter; int start_mi_row, end_mi_row, mi_rows_to_filter;
if (!frame_filter_level) return; if (!frame_filter_level) return;
...@@ -273,7 +273,7 @@ static INLINE int get_sync_range(int width) { ...@@ -273,7 +273,7 @@ static INLINE int get_sync_range(int width) {
} }
// Allocate memory for lf row synchronization // Allocate memory for lf row synchronization
void vp10_loop_filter_alloc(VP9LfSync *lf_sync, VP10_COMMON *cm, int rows, void vp10_loop_filter_alloc(VP10LfSync *lf_sync, VP10_COMMON *cm, int rows,
int width, int num_workers) { int width, int num_workers) {
lf_sync->rows = rows; lf_sync->rows = rows;
#if CONFIG_MULTITHREAD #if CONFIG_MULTITHREAD
...@@ -310,7 +310,7 @@ void vp10_loop_filter_alloc(VP9LfSync *lf_sync, VP10_COMMON *cm, int rows, ...@@ -310,7 +310,7 @@ void vp10_loop_filter_alloc(VP9LfSync *lf_sync, VP10_COMMON *cm, int rows,
} }
// Deallocate lf synchronization related mutex and data // Deallocate lf synchronization related mutex and data
void vp10_loop_filter_dealloc(VP9LfSync *lf_sync) { void vp10_loop_filter_dealloc(VP10LfSync *lf_sync) {
if (lf_sync != NULL) { if (lf_sync != NULL) {
#if CONFIG_MULTITHREAD #if CONFIG_MULTITHREAD
int i; int i;
......
...@@ -22,7 +22,7 @@ struct VP10Common; ...@@ -22,7 +22,7 @@ struct VP10Common;
struct FRAME_COUNTS; struct FRAME_COUNTS;
// Loopfilter row synchronization // Loopfilter row synchronization
typedef struct VP9LfSyncData { typedef struct VP10LfSyncData {
#if CONFIG_MULTITHREAD #if CONFIG_MULTITHREAD
pthread_mutex_t *mutex_; pthread_mutex_t *mutex_;
pthread_cond_t *cond_; pthread_cond_t *cond_;
...@@ -37,14 +37,14 @@ typedef struct VP9LfSyncData { ...@@ -37,14 +37,14 @@ typedef struct VP9LfSyncData {
// Row-based parallel loopfilter data // Row-based parallel loopfilter data
LFWorkerData *lfdata; LFWorkerData *lfdata;
int num_workers; int num_workers;
} VP9LfSync; } VP10LfSync;
// Allocate memory for loopfilter row synchronization. // Allocate memory for loopfilter row synchronization.
void vp10_loop_filter_alloc(VP9LfSync *lf_sync, struct VP10Common *cm, int rows, void vp10_loop_filter_alloc(VP10LfSync *lf_sync, struct VP10Common *cm, int rows,
int width, int num_workers); int width, int num_workers);
// Deallocate loopfilter synchronization related mutex and data. // Deallocate loopfilter synchronization related mutex and data.
void vp10_loop_filter_dealloc(VP9LfSync *lf_sync); void vp10_loop_filter_dealloc(VP10LfSync *lf_sync);
// Multi-threaded loopfilter that uses the tile threads. // Multi-threaded loopfilter that uses the tile threads.
void vp10_loop_filter_frame_mt(YV12_BUFFER_CONFIG *frame, void vp10_loop_filter_frame_mt(YV12_BUFFER_CONFIG *frame,
...@@ -53,7 +53,7 @@ void vp10_loop_filter_frame_mt(YV12_BUFFER_CONFIG *frame, ...@@ -53,7 +53,7 @@ void vp10_loop_filter_frame_mt(YV12_BUFFER_CONFIG *frame,
int frame_filter_level, int frame_filter_level,
int y_only, int partial_frame, int y_only, int partial_frame,
VPxWorker *workers, int num_workers, VPxWorker *workers, int num_workers,
VP9LfSync *lf_sync); VP10LfSync *lf_sync);
void vp10_accumulate_frame_counts(struct VP10Common *cm, void vp10_accumulate_frame_counts(struct VP10Common *cm,
struct FRAME_COUNTS *counts); struct FRAME_COUNTS *counts);
......
...@@ -158,7 +158,7 @@ static int equal_dimensions(const YV12_BUFFER_CONFIG *a, ...@@ -158,7 +158,7 @@ static int equal_dimensions(const YV12_BUFFER_CONFIG *a,
} }
vpx_codec_err_t vp10_copy_reference_dec(VP10Decoder *pbi, vpx_codec_err_t vp10_copy_reference_dec(VP10Decoder *pbi,
VP9_REFFRAME ref_frame_flag, VPX_REFFRAME ref_frame_flag,
YV12_BUFFER_CONFIG *sd) { YV12_BUFFER_CONFIG *sd) {
VP10_COMMON *cm = &pbi->common; VP10_COMMON *cm = &pbi->common;
...@@ -167,7 +167,7 @@ vpx_codec_err_t vp10_copy_reference_dec(VP10Decoder *pbi, ...@@ -167,7 +167,7 @@ vpx_codec_err_t vp10_copy_reference_dec(VP10Decoder *pbi,
* vpxenc --test-decode functionality working, and will be replaced in a * vpxenc --test-decode functionality working, and will be replaced in a
* later commit that adds VP9-specific controls for this functionality. * later commit that adds VP9-specific controls for this functionality.
*/ */
if (ref_frame_flag == VP9_LAST_FLAG) { if (ref_frame_flag == VPX_LAST_FLAG) {
const YV12_BUFFER_CONFIG *const cfg = get_ref_frame(cm, 0); const YV12_BUFFER_CONFIG *const cfg = get_ref_frame(cm, 0);
if (cfg == NULL) { if (cfg == NULL) {
vpx_internal_error(&cm->error, VPX_CODEC_ERROR, vpx_internal_error(&cm->error, VPX_CODEC_ERROR,
...@@ -178,7 +178,7 @@ vpx_codec_err_t vp10_copy_reference_dec(VP10Decoder *pbi, ...@@ -178,7 +178,7 @@ vpx_codec_err_t vp10_copy_reference_dec(VP10Decoder *pbi,
vpx_internal_error(&cm->error, VPX_CODEC_ERROR, vpx_internal_error(&cm->error, VPX_CODEC_ERROR,
"Incorrect buffer dimensions"); "Incorrect buffer dimensions");
else else
vp8_yv12_copy_frame(cfg, sd); vpx_yv12_copy_frame(cfg, sd);
} else { } else {
vpx_internal_error(&cm->error, VPX_CODEC_ERROR, vpx_internal_error(&cm->error, VPX_CODEC_ERROR,
"Invalid reference frame"); "Invalid reference frame");
...@@ -189,7 +189,7 @@ vpx_codec_err_t vp10_copy_reference_dec(VP10Decoder *pbi, ...@@ -189,7 +189,7 @@ vpx_codec_err_t vp10_copy_reference_dec(VP10Decoder *pbi,
vpx_codec_err_t vp10_set_reference_dec(VP10_COMMON *cm, vpx_codec_err_t vp10_set_reference_dec(VP10_COMMON *cm,
VP9_REFFRAME ref_frame_flag, VPX_REFFRAME ref_frame_flag,
YV12_BUFFER_CONFIG *sd) { YV12_BUFFER_CONFIG *sd) {
int idx; int idx;
YV12_BUFFER_CONFIG *ref_buf = NULL; YV12_BUFFER_CONFIG *ref_buf = NULL;
...@@ -215,23 +215,23 @@ vpx_codec_err_t vp10_set_reference_dec(VP10_COMMON *cm, ...@@ -215,23 +215,23 @@ vpx_codec_err_t vp10_set_reference_dec(VP10_COMMON *cm,
// TODO(zoeliu): To revisit following code and reconsider what assumption we // TODO(zoeliu): To revisit following code and reconsider what assumption we
// may take on the reference frame buffer virtual indexes // may take on the reference frame buffer virtual indexes
if (ref_frame_flag == VP9_LAST_FLAG) { if (ref_frame_flag == VPX_LAST_FLAG) {
idx = cm->ref_frame_map[0]; idx = cm->ref_frame_map[0];
#if CONFIG_EXT_REFS #if CONFIG_EXT_REFS
} else if (ref_frame_flag == VP9_LAST2_FLAG) { } else if (ref_frame_flag == VPX_LAST2_FLAG) {
idx = cm->ref_frame_map[1]; idx = cm->ref_frame_map[1];
} else if (ref_frame_flag == VP9_LAST3_FLAG) { } else if (ref_frame_flag == VPX_LAST3_FLAG) {
idx = cm->ref_frame_map[2]; idx = cm->ref_frame_map[2];
} else if (ref_frame_flag == VP9_GOLD_FLAG) { } else if (ref_frame_flag == VPX_GOLD_FLAG) {
idx = cm->ref_frame_map[3]; idx = cm->ref_frame_map[3];
} else if (ref_frame_flag == VP9_BWD_FLAG) { } else if (ref_frame_flag == VPX_BWD_FLAG) {
idx = cm->ref_frame_map[4]; idx = cm->ref_frame_map[4];
} else if (ref_frame_flag == VP9_ALT_FLAG) { } else if (ref_frame_flag == VPX_ALT_FLAG) {
idx = cm->ref_frame_map[5]; idx = cm->ref_frame_map[5];
#else #else
} else if (ref_frame_flag == VP9_GOLD_FLAG) { } else if (ref_frame_flag == VPX_GOLD_FLAG) {
idx = cm->ref_frame_map[1]; idx = cm->ref_frame_map[1];
} else if (ref_frame_flag == VP9_ALT_FLAG) { } else if (ref_frame_flag == VPX_ALT_FLAG) {
idx = cm->ref_frame_map[2]; idx = cm->ref_frame_map[2];
#endif // CONFIG_EXT_REFS #endif // CONFIG_EXT_REFS
} else { } else {
...@@ -254,7 +254,7 @@ vpx_codec_err_t vp10_set_reference_dec(VP10_COMMON *cm, ...@@ -254,7 +254,7 @@ vpx_codec_err_t vp10_set_reference_dec(VP10_COMMON *cm,
"Incorrect buffer dimensions"); "Incorrect buffer dimensions");
} else { } else {
// Overwrite the reference frame buffer. // Overwrite the reference frame buffer.
vp8_yv12_copy_frame(sd, ref_buf); vpx_yv12_copy_frame(sd, ref_buf);
} }
return cm->error.error_code; return cm->error.error_code;
......
...@@ -80,7 +80,7 @@ typedef struct VP10Decoder { ...@@ -80,7 +80,7 @@ typedef struct VP10Decoder {
TileBufferDec tile_buffers[MAX_TILE_ROWS][MAX_TILE_COLS]; TileBufferDec tile_buffers[MAX_TILE_ROWS][MAX_TILE_COLS];
VP9LfSync lf_row_sync; VP10LfSync lf_row_sync;
vpx_decrypt_cb decrypt_cb; vpx_decrypt_cb decrypt_cb;
void *decrypt_state; void *decrypt_state;
...@@ -105,11 +105,11 @@ int vp10_get_raw_frame(struct VP10Decoder *pbi, YV12_BUFFER_CONFIG *sd); ...@@ -105,11 +105,11 @@ int vp10_get_raw_frame(struct VP10Decoder *pbi, YV12_BUFFER_CONFIG *sd);
int vp10_get_frame_to_show(struct VP10Decoder *pbi, YV12_BUFFER_CONFIG *frame); int vp10_get_frame_to_show(struct VP10Decoder *pbi, YV12_BUFFER_CONFIG *frame);
vpx_codec_err_t vp10_copy_reference_dec(struct VP10Decoder *pbi, vpx_codec_err_t vp10_copy_reference_dec(struct VP10Decoder *pbi,
VP9_REFFRAME ref_frame_flag, VPX_REFFRAME ref_frame_flag,
YV12_BUFFER_CONFIG *sd); YV12_BUFFER_CONFIG *sd);
vpx_codec_err_t vp10_set_reference_dec(VP10_COMMON *cm, vpx_codec_err_t vp10_set_reference_dec(VP10_COMMON *cm,
VP9_REFFRAME ref_frame_flag, VPX_REFFRAME ref_frame_flag,
YV12_BUFFER_CONFIG *sd); YV12_BUFFER_CONFIG *sd);
static INLINE uint8_t read_marker(vpx_decrypt_cb decrypt_cb, static INLINE uint8_t read_marker(vpx_decrypt_cb decrypt_cb,
......
...@@ -4392,14 +4392,14 @@ static int check_dual_ref_flags(VP10_COMP *cpi) { ...@@ -4392,14 +4392,14 @@ static int check_dual_ref_flags(VP10_COMP *cpi) {
if (segfeature_active(&cpi->common.seg, 1, SEG_LVL_REF_FRAME)) { if (segfeature_active(&cpi->common.seg, 1, SEG_LVL_REF_FRAME)) {
return 0; return 0;
} else { } else {
return (!!(ref_flags & VP9_GOLD_FLAG) + return (!!(ref_flags & VPX_GOLD_FLAG) +
!!(ref_flags & VP9_LAST_FLAG) + !!(ref_flags & VPX_LAST_FLAG) +
#if CONFIG_EXT_REFS #if CONFIG_EXT_REFS
!!(ref_flags & VP9_LAST2_FLAG) + !!(ref_flags & VPX_LAST2_FLAG) +
!!(ref_flags & VP9_LAST3_FLAG) + !!(ref_flags & VPX_LAST3_FLAG) +
!!(ref_flags & VP9_BWD_FLAG) + !!(ref_flags & VPX_BWD_FLAG) +
#endif // CONFIG_EXT_REFS #endif // CONFIG_EXT_REFS
!!(ref_flags & VP9_ALT_FLAG)) >= 2; !!(ref_flags & VPX_ALT_FLAG)) >= 2;
} }
} }
......
...@@ -2961,51 +2961,51 @@ int vp10_use_as_reference(VP10_COMP *cpi, int ref_frame_flags) { ...@@ -2961,51 +2961,51 @@ int vp10_use_as_reference(VP10_COMP *cpi, int ref_frame_flags) {
} }
void vp10_update_reference(VP10_COMP *cpi, int ref_frame_flags) { void vp10_update_reference(VP10_COMP *cpi, int ref_frame_flags) {
cpi->ext_refresh_golden_frame = (ref_frame_flags & VP9_GOLD_FLAG) != 0; cpi->ext_refresh_golden_frame = (ref_frame_flags & VPX_GOLD_FLAG) != 0;
cpi->ext_refresh_alt_ref_frame = (ref_frame_flags & VP9_ALT_FLAG) != 0; cpi->ext_refresh_alt_ref_frame = (ref_frame_flags & VPX_ALT_FLAG) != 0;
cpi->ext_refresh_last_frame = (ref_frame_flags & VP9_LAST_FLAG) != 0; cpi->ext_refresh_last_frame = (ref_frame_flags & VPX_LAST_FLAG) != 0;
cpi->ext_refresh_frame_flags_pending = 1; cpi->ext_refresh_frame_flags_pending = 1;
} }
static YV12_BUFFER_CONFIG *get_vp10_ref_frame_buffer( static YV12_BUFFER_CONFIG *get_vp10_ref_frame_buffer(
VP10_COMP *cpi, VP9_REFFRAME ref_frame_flag) { VP10_COMP *cpi, VPX_REFFRAME ref_frame_flag) {
MV_REFERENCE_FRAME ref_frame = NONE; MV_REFERENCE_FRAME ref_frame = NONE;
if (ref_frame_flag == VP9_LAST_FLAG) if (ref_frame_flag == VPX_LAST_FLAG)
ref_frame = LAST_FRAME; ref_frame = LAST_FRAME;
#if CONFIG_EXT_REFS #if CONFIG_EXT_REFS
else if (ref_frame_flag == VP9_LAST2_FLAG) else if (ref_frame_flag == VPX_LAST2_FLAG)
ref_frame = LAST2_FRAME; ref_frame = LAST2_FRAME;
else if (ref_frame_flag == VP9_LAST3_FLAG) else if (ref_frame_flag == VPX_LAST3_FLAG)
ref_frame = LAST3_FRAME; ref_frame = LAST3_FRAME;
#endif // CONFIG_EXT_REFS #endif // CONFIG_EXT_REFS
else if (ref_frame_flag == VP9_GOLD_FLAG) else if (ref_frame_flag == VPX_GOLD_FLAG)
ref_frame = GOLDEN_FRAME; ref_frame = GOLDEN_FRAME;
#if CONFIG_EXT_REFS #if CONFIG_EXT_REFS
else if (ref_frame_flag == VP9_BWD_FLAG) else if (ref_frame_flag == VPX_BWD_FLAG)
ref_frame = BWDREF_FRAME; ref_frame = BWDREF_FRAME;
#endif // CONFIG_EXT_REFS #endif // CONFIG_EXT_REFS
else if (ref_frame_flag == VP9_ALT_FLAG) else if (ref_frame_flag == VPX_ALT_FLAG)
ref_frame = ALTREF_FRAME; ref_frame = ALTREF_FRAME;
return ref_frame == NONE ? NULL : get_ref_frame_buffer(cpi, ref_frame); return ref_frame == NONE ? NULL : get_ref_frame_buffer(cpi, ref_frame);
} }
int vp10_copy_reference_enc(VP10_COMP *cpi, VP9_REFFRAME ref_frame_flag, int vp10_copy_reference_enc(VP10_COMP *cpi, VPX_REFFRAME ref_frame_flag,
YV12_BUFFER_CONFIG *sd) { YV12_BUFFER_CONFIG *sd) {
YV12_BUFFER_CONFIG *cfg = get_vp10_ref_frame_buffer(cpi, ref_frame_flag); YV12_BUFFER_CONFIG *cfg = get_vp10_ref_frame_buffer(cpi, ref_frame_flag);
if (cfg) { if (cfg) {
vp8_yv12_copy_frame(cfg, sd); vpx_yv12_copy_frame(cfg, sd);
return 0; return 0;
} else { } else {
return -1; return -1;
} }
} }
int vp10_set_reference_enc(VP10_COMP *cpi, VP9_REFFRAME ref_frame_flag, int vp10_set_reference_enc(VP10_COMP *cpi, VPX_REFFRAME ref_frame_flag,
YV12_BUFFER_CONFIG *sd) { YV12_BUFFER_CONFIG *sd) {
YV12_BUFFER_CONFIG *cfg = get_vp10_ref_frame_buffer(cpi, ref_frame_flag); YV12_BUFFER_CONFIG *cfg = get_vp10_ref_frame_buffer(cpi, ref_frame_flag);
if (cfg) { if (cfg) {
vp8_yv12_copy_frame(sd, cfg); vpx_yv12_copy_frame(sd, cfg);
return 0; return 0;
} else { } else {
return -1; return -1;
...@@ -3710,21 +3710,21 @@ static INLINE void alloc_frame_mvs(VP10_COMMON *const cm, ...@@ -3710,21 +3710,21 @@ static INLINE void alloc_frame_mvs(VP10_COMMON *const cm,
void vp10_scale_references(VP10_COMP *cpi) { void vp10_scale_references(VP10_COMP *cpi) {
VP10_COMMON *cm = &cpi->common; VP10_COMMON *cm = &cpi->common;
MV_REFERENCE_FRAME ref_frame; MV_REFERENCE_FRAME ref_frame;
const VP9_REFFRAME ref_mask[REFS_PER_FRAME] = { const VPX_REFFRAME ref_mask[REFS_PER_FRAME] = {
VP9_LAST_FLAG, VPX_LAST_FLAG,
#if CONFIG_EXT_REFS #if CONFIG_EXT_REFS
VP9_LAST2_FLAG, VPX_LAST2_FLAG,
VP9_LAST3_FLAG, VPX_LAST3_FLAG,
#endif // CONFIG_EXT_REFS #endif // CONFIG_EXT_REFS
VP9_GOLD_FLAG, VPX_GOLD_FLAG,
#if CONFIG_EXT_REFS #if CONFIG_EXT_REFS
VP9_BWD_FLAG, VPX_BWD_FLAG,
#endif // CONFIG_EXT_REFS #endif // CONFIG_EXT_REFS
VP9_ALT_FLAG VPX_ALT_FLAG
}; };
for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) { for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
// Need to convert from VP9_REFFRAME to index into ref_mask (subtract 1). // Need to convert from VPX_REFFRAME to index into ref_mask (subtract 1).
if (cpi->ref_frame_flags & ref_mask[ref_frame - 1]) { if (cpi->ref_frame_flags & ref_mask[ref_frame - 1]) {
BufferPool *const pool = cm->buffer_pool; BufferPool *const pool = cm->buffer_pool;
const YV12_BUFFER_CONFIG *const ref = get_ref_frame_buffer(cpi, const YV12_BUFFER_CONFIG *const ref = get_ref_frame_buffer(cpi,
...@@ -4565,36 +4565,36 @@ static int get_ref_frame_flags(const VP10_COMP *cpi) { ...@@ -4565,36 +4565,36 @@ static int get_ref_frame_flags(const VP10_COMP *cpi) {
const int alt_is_last = map[cpi->alt_fb_idx] == map[cpi->lst_fb_idx]; const int alt_is_last = map[cpi->alt_fb_idx] == map[cpi->lst_fb_idx];
#endif // CONFIG_EXT_REFS #endif // CONFIG_EXT_REFS
int flags = VP9_REFFRAME_ALL; int flags = VPX_REFFRAME_ALL;
#if CONFIG_EXT_REFS #if CONFIG_EXT_REFS
// Disable the use of BWDREF_FRAME for non-bipredictive frames. // Disable the use of BWDREF_FRAME for non-bipredictive frames.
if (!(cpi->rc.is_bipred_frame || cpi->rc.is_last_bipred_frame)) if (!(cpi->rc.is_bipred_frame || cpi->rc.is_last_bipred_frame))
flags &= ~VP9_BWD_FLAG; flags &= ~VPX_BWD_FLAG;
#endif // CONFIG_EXT_REFS #endif // CONFIG_EXT_REFS
if (gld_is_last || gld_is_alt) if (gld_is_last || gld_is_alt)
flags &= ~VP9_GOLD_FLAG; flags &= ~VPX_GOLD_FLAG;
if (cpi->rc.frames_till_gf_update_due == INT_MAX) if (cpi->rc.frames_till_gf_update_due == INT_MAX)
flags &= ~VP9_GOLD_FLAG; flags &= ~VPX_GOLD_FLAG;
if (alt_is_last) if (alt_is_last)
flags &= ~VP9_ALT_FLAG; flags &= ~VPX_ALT_FLAG;
#if CONFIG_EXT_REFS #if CONFIG_EXT_REFS
if (last2_is_last || last2_is_alt) if (last2_is_last || last2_is_alt)
flags &= ~VP9_LAST2_FLAG; flags &= ~VPX_LAST2_FLAG;
if (last3_is_last || last3_is_last2 || last3_is_alt) if (last3_is_last || last3_is_last2 || last3_is_alt)
flags &= ~VP9_LAST3_FLAG; flags &= ~VPX_LAST3_FLAG;
if (gld_is_last2 || gld_is_last3) if (gld_is_last2 || gld_is_last3)
flags &= ~VP9_GOLD_FLAG; flags &= ~VPX_GOLD_FLAG;
if ((bwd_is_last || bwd_is_last2 || bwd_is_last3 || if ((bwd_is_last || bwd_is_last2 || bwd_is_last3 ||
bwd_is_gld || bwd_is_alt) && (flags & VP9_BWD_FLAG)) bwd_is_gld || bwd_is_alt) && (flags & VPX_BWD_FLAG))
flags &= ~VP9_BWD_FLAG; flags &= ~VPX_BWD_FLAG;
#endif // CONFIG_EXT_REFS #endif // CONFIG_EXT_REFS
return flags; return flags;
...@@ -5777,21 +5777,21 @@ int vp10_get_quantizer(VP10_COMP *cpi) { ...@@ -5777,21 +5777,21 @@ int vp10_get_quantizer(VP10_COMP *cpi) {
void vp10_apply_encoding_flags(VP10_COMP *cpi, vpx_enc_frame_flags_t flags) { void vp10_apply_encoding_flags(VP10_COMP *cpi, vpx_enc_frame_flags_t flags) {
if (flags & (VP8_EFLAG_NO_REF_LAST | VP8_EFLAG_NO_REF_GF | if (flags & (VP8_EFLAG_NO_REF_LAST | VP8_EFLAG_NO_REF_GF |
VP8_EFLAG_NO_REF_ARF)) { VP8_EFLAG_NO_REF_ARF)) {
int ref = VP9_REFFRAME_ALL; int ref = VPX_REFFRAME_ALL;
if (flags & VP8_EFLAG_NO_REF_LAST) { if (flags & VP8_EFLAG_NO_REF_LAST) {
ref ^= VP9_LAST_FLAG; ref ^= VPX_LAST_FLAG;
#if CONFIG_EXT_REFS #if CONFIG_EXT_REFS
ref ^= VP9_LAST2_FLAG; ref ^= VPX_LAST2_FLAG;
ref ^= VP9_LAST3_FLAG; ref ^= VPX_LAST3_FLAG;
#endif // CONFIG_EXT_REFS #endif // CONFIG_EXT_REFS
} }
if (flags & VP8_EFLAG_NO_REF_GF) if (flags & VP8_EFLAG_NO_REF_GF)
ref ^= VP9_GOLD_FLAG; ref ^= VPX_GOLD_FLAG;
if (flags & VP8_EFLAG_NO_REF_ARF) if (flags & VP8_EFLAG_NO_REF_ARF)
ref ^= VP9_ALT_FLAG; ref ^= VPX_ALT_FLAG;
vp10_use_as_reference(cpi, ref); vp10_use_as_reference(cpi, ref);
} }
...@@ -5799,21 +5799,21 @@ void vp10_apply_encoding_flags(VP10_COMP *cpi, vpx_enc_frame_flags_t flags) { ...@@ -5799,21 +5799,21 @@ void vp10_apply_encoding_flags(VP10_COMP *cpi, vpx_enc_frame_flags_t flags) {
if (flags & (VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF | if (flags & (VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF |
VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_FORCE_GF | VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_FORCE_GF |
VP8_EFLAG_FORCE_ARF)) { VP8_EFLAG_FORCE_ARF)) {
int upd = VP9_REFFRAME_ALL; int upd = VPX_REFFRAME_ALL;
if (flags & VP8_EFLAG_NO_UPD_LAST) { if (flags & VP8_EFLAG_NO_UPD_LAST) {