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 {
#endif // CONFIG_EXT_TX
typedef enum {
VP9_LAST_FLAG = 1 << 0,
VPX_LAST_FLAG = 1 << 0,
#if CONFIG_EXT_REFS
VP9_LAST2_FLAG = 1 << 1,
VP9_LAST3_FLAG = 1 << 2,
VP9_GOLD_FLAG = 1 << 3,
VP9_BWD_FLAG = 1 << 4,
VP9_ALT_FLAG = 1 << 5,
VP9_REFFRAME_ALL = (1 << 6) - 1
VPX_LAST2_FLAG = 1 << 1,
VPX_LAST3_FLAG = 1 << 2,
VPX_GOLD_FLAG = 1 << 3,
VPX_BWD_FLAG = 1 << 4,
VPX_ALT_FLAG = 1 << 5,
VPX_REFFRAME_ALL = (1 << 6) - 1
#else
VP9_GOLD_FLAG = 1 << 1,
VP9_ALT_FLAG = 1 << 2,
VP9_REFFRAME_ALL = (1 << 3) - 1
VPX_GOLD_FLAG = 1 << 1,
VPX_ALT_FLAG = 1 << 2,
VPX_REFFRAME_ALL = (1 << 3) - 1
#endif // CONFIG_EXT_REFS
} VP9_REFFRAME;
} VPX_REFFRAME;
typedef enum {
PLANE_TYPE_Y = 0,
......
......@@ -91,7 +91,7 @@ typedef struct {
/* assorted loopfilter functions which get used elsewhere */
struct VP10Common;
struct macroblockd;
struct VP9LfSyncData;
struct VP10LfSyncData;
// This function sets up the bit masks for the entire 64x64 region represented
// by mi_row, mi_col.
......
......@@ -34,7 +34,7 @@ static INLINE void mutex_lock(pthread_mutex_t *const mutex) {
}
#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
const int nsync = lf_sync->sync_range;
......@@ -54,7 +54,7 @@ static INLINE void sync_read(VP9LfSync *const lf_sync, int r, int c) {
#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) {
#if CONFIG_MULTITHREAD
const int nsync = lf_sync->sync_range;
......@@ -92,7 +92,7 @@ void thread_loop_filter_rows(const YV12_BUFFER_CONFIG *const frame_buffer,
VP10_COMMON *const cm,
struct macroblockd_plane planes[MAX_MB_PLANE],
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 sb_cols = mi_cols_aligned_to_sb(cm) >> cm->mib_size_log2;
int mi_row, mi_col;
......@@ -159,7 +159,7 @@ void thread_loop_filter_rows(const YV12_BUFFER_CONFIG *const frame_buffer,
}
// 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) {
thread_loop_filter_rows(lf_data->frame_buffer, lf_data->cm, lf_data->planes,
lf_data->start, lf_data->stop, lf_data->y_only,
......@@ -172,7 +172,7 @@ static void loop_filter_rows_mt(YV12_BUFFER_CONFIG *frame,
struct macroblockd_plane planes[MAX_MB_PLANE],
int start, int stop, int y_only,
VPxWorker *workers, int nworkers,
VP9LfSync *lf_sync) {
VP10LfSync *lf_sync) {
const VPxWorkerInterface *const winterface = vpx_get_worker_interface();
// Number of superblock rows and cols
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,
int frame_filter_level,
int y_only, int partial_frame,
VPxWorker *workers, int num_workers,
VP9LfSync *lf_sync) {
VP10LfSync *lf_sync) {
int start_mi_row, end_mi_row, mi_rows_to_filter;
if (!frame_filter_level) return;
......@@ -273,7 +273,7 @@ static INLINE int get_sync_range(int width) {
}
// 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) {
lf_sync->rows = rows;
#if CONFIG_MULTITHREAD
......@@ -310,7 +310,7 @@ void vp10_loop_filter_alloc(VP9LfSync *lf_sync, VP10_COMMON *cm, int rows,
}
// 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 CONFIG_MULTITHREAD
int i;
......
......@@ -22,7 +22,7 @@ struct VP10Common;
struct FRAME_COUNTS;
// Loopfilter row synchronization
typedef struct VP9LfSyncData {
typedef struct VP10LfSyncData {
#if CONFIG_MULTITHREAD
pthread_mutex_t *mutex_;
pthread_cond_t *cond_;
......@@ -37,14 +37,14 @@ typedef struct VP9LfSyncData {
// Row-based parallel loopfilter data
LFWorkerData *lfdata;
int num_workers;
} VP9LfSync;
} VP10LfSync;
// 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);
// 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.
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 y_only, int partial_frame,
VPxWorker *workers, int num_workers,
VP9LfSync *lf_sync);
VP10LfSync *lf_sync);
void vp10_accumulate_frame_counts(struct VP10Common *cm,
struct FRAME_COUNTS *counts);
......
......@@ -158,7 +158,7 @@ static int equal_dimensions(const YV12_BUFFER_CONFIG *a,
}
vpx_codec_err_t vp10_copy_reference_dec(VP10Decoder *pbi,
VP9_REFFRAME ref_frame_flag,
VPX_REFFRAME ref_frame_flag,
YV12_BUFFER_CONFIG *sd) {
VP10_COMMON *cm = &pbi->common;
......@@ -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
* 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);
if (cfg == NULL) {
vpx_internal_error(&cm->error, VPX_CODEC_ERROR,
......@@ -178,7 +178,7 @@ vpx_codec_err_t vp10_copy_reference_dec(VP10Decoder *pbi,
vpx_internal_error(&cm->error, VPX_CODEC_ERROR,
"Incorrect buffer dimensions");
else
vp8_yv12_copy_frame(cfg, sd);
vpx_yv12_copy_frame(cfg, sd);
} else {
vpx_internal_error(&cm->error, VPX_CODEC_ERROR,
"Invalid reference frame");
......@@ -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,
VP9_REFFRAME ref_frame_flag,
VPX_REFFRAME ref_frame_flag,
YV12_BUFFER_CONFIG *sd) {
int idx;
YV12_BUFFER_CONFIG *ref_buf = NULL;
......@@ -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
// 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];
#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];
} else if (ref_frame_flag == VP9_LAST3_FLAG) {
} else if (ref_frame_flag == VPX_LAST3_FLAG) {
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];
} else if (ref_frame_flag == VP9_BWD_FLAG) {
} else if (ref_frame_flag == VPX_BWD_FLAG) {
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];
#else
} else if (ref_frame_flag == VP9_GOLD_FLAG) {
} else if (ref_frame_flag == VPX_GOLD_FLAG) {
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];
#endif // CONFIG_EXT_REFS
} else {
......@@ -254,7 +254,7 @@ vpx_codec_err_t vp10_set_reference_dec(VP10_COMMON *cm,
"Incorrect buffer dimensions");
} else {
// Overwrite the reference frame buffer.
vp8_yv12_copy_frame(sd, ref_buf);
vpx_yv12_copy_frame(sd, ref_buf);
}
return cm->error.error_code;
......
......@@ -80,7 +80,7 @@ typedef struct VP10Decoder {
TileBufferDec tile_buffers[MAX_TILE_ROWS][MAX_TILE_COLS];
VP9LfSync lf_row_sync;
VP10LfSync lf_row_sync;
vpx_decrypt_cb decrypt_cb;
void *decrypt_state;
......@@ -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);
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);
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);
static INLINE uint8_t read_marker(vpx_decrypt_cb decrypt_cb,
......
......@@ -4392,14 +4392,14 @@ static int check_dual_ref_flags(VP10_COMP *cpi) {
if (segfeature_active(&cpi->common.seg, 1, SEG_LVL_REF_FRAME)) {
return 0;
} else {
return (!!(ref_flags & VP9_GOLD_FLAG) +
!!(ref_flags & VP9_LAST_FLAG) +
return (!!(ref_flags & VPX_GOLD_FLAG) +
!!(ref_flags & VPX_LAST_FLAG) +
#if CONFIG_EXT_REFS
!!(ref_flags & VP9_LAST2_FLAG) +
!!(ref_flags & VP9_LAST3_FLAG) +
!!(ref_flags & VP9_BWD_FLAG) +
!!(ref_flags & VPX_LAST2_FLAG) +
!!(ref_flags & VPX_LAST3_FLAG) +
!!(ref_flags & VPX_BWD_FLAG) +
#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) {
}
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_alt_ref_frame = (ref_frame_flags & VP9_ALT_FLAG) != 0;
cpi->ext_refresh_last_frame = (ref_frame_flags & VP9_LAST_FLAG) != 0;
cpi->ext_refresh_golden_frame = (ref_frame_flags & VPX_GOLD_FLAG) != 0;
cpi->ext_refresh_alt_ref_frame = (ref_frame_flags & VPX_ALT_FLAG) != 0;
cpi->ext_refresh_last_frame = (ref_frame_flags & VPX_LAST_FLAG) != 0;
cpi->ext_refresh_frame_flags_pending = 1;
}
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;
if (ref_frame_flag == VP9_LAST_FLAG)
if (ref_frame_flag == VPX_LAST_FLAG)
ref_frame = LAST_FRAME;
#if CONFIG_EXT_REFS
else if (ref_frame_flag == VP9_LAST2_FLAG)
else if (ref_frame_flag == VPX_LAST2_FLAG)
ref_frame = LAST2_FRAME;
else if (ref_frame_flag == VP9_LAST3_FLAG)
else if (ref_frame_flag == VPX_LAST3_FLAG)
ref_frame = LAST3_FRAME;
#endif // CONFIG_EXT_REFS
else if (ref_frame_flag == VP9_GOLD_FLAG)
else if (ref_frame_flag == VPX_GOLD_FLAG)
ref_frame = GOLDEN_FRAME;
#if CONFIG_EXT_REFS
else if (ref_frame_flag == VP9_BWD_FLAG)
else if (ref_frame_flag == VPX_BWD_FLAG)
ref_frame = BWDREF_FRAME;
#endif // CONFIG_EXT_REFS
else if (ref_frame_flag == VP9_ALT_FLAG)
else if (ref_frame_flag == VPX_ALT_FLAG)
ref_frame = ALTREF_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 *cfg = get_vp10_ref_frame_buffer(cpi, ref_frame_flag);
if (cfg) {
vp8_yv12_copy_frame(cfg, sd);
vpx_yv12_copy_frame(cfg, sd);
return 0;
} else {
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 *cfg = get_vp10_ref_frame_buffer(cpi, ref_frame_flag);
if (cfg) {
vp8_yv12_copy_frame(sd, cfg);
vpx_yv12_copy_frame(sd, cfg);
return 0;
} else {
return -1;
......@@ -3710,21 +3710,21 @@ static INLINE void alloc_frame_mvs(VP10_COMMON *const cm,
void vp10_scale_references(VP10_COMP *cpi) {
VP10_COMMON *cm = &cpi->common;
MV_REFERENCE_FRAME ref_frame;
const VP9_REFFRAME ref_mask[REFS_PER_FRAME] = {
VP9_LAST_FLAG,
const VPX_REFFRAME ref_mask[REFS_PER_FRAME] = {
VPX_LAST_FLAG,
#if CONFIG_EXT_REFS
VP9_LAST2_FLAG,
VP9_LAST3_FLAG,
VPX_LAST2_FLAG,
VPX_LAST3_FLAG,
#endif // CONFIG_EXT_REFS
VP9_GOLD_FLAG,
VPX_GOLD_FLAG,
#if CONFIG_EXT_REFS
VP9_BWD_FLAG,
VPX_BWD_FLAG,
#endif // CONFIG_EXT_REFS
VP9_ALT_FLAG
VPX_ALT_FLAG
};
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]) {
BufferPool *const pool = cm->buffer_pool;
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) {
const int alt_is_last = map[cpi->alt_fb_idx] == map[cpi->lst_fb_idx];
#endif // CONFIG_EXT_REFS
int flags = VP9_REFFRAME_ALL;
int flags = VPX_REFFRAME_ALL;
#if CONFIG_EXT_REFS
// Disable the use of BWDREF_FRAME for non-bipredictive frames.
if (!(cpi->rc.is_bipred_frame || cpi->rc.is_last_bipred_frame))
flags &= ~VP9_BWD_FLAG;
flags &= ~VPX_BWD_FLAG;
#endif // CONFIG_EXT_REFS
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)
flags &= ~VP9_GOLD_FLAG;
flags &= ~VPX_GOLD_FLAG;
if (alt_is_last)
flags &= ~VP9_ALT_FLAG;
flags &= ~VPX_ALT_FLAG;
#if CONFIG_EXT_REFS
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)
flags &= ~VP9_LAST3_FLAG;
flags &= ~VPX_LAST3_FLAG;
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 ||
bwd_is_gld || bwd_is_alt) && (flags & VP9_BWD_FLAG))
flags &= ~VP9_BWD_FLAG;
bwd_is_gld || bwd_is_alt) && (flags & VPX_BWD_FLAG))
flags &= ~VPX_BWD_FLAG;
#endif // CONFIG_EXT_REFS
return flags;
......@@ -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) {
if (flags & (VP8_EFLAG_NO_REF_LAST | VP8_EFLAG_NO_REF_GF |
VP8_EFLAG_NO_REF_ARF)) {
int ref = VP9_REFFRAME_ALL;
int ref = VPX_REFFRAME_ALL;
if (flags & VP8_EFLAG_NO_REF_LAST) {
ref ^= VP9_LAST_FLAG;
ref ^= VPX_LAST_FLAG;
#if CONFIG_EXT_REFS
ref ^= VP9_LAST2_FLAG;
ref ^= VP9_LAST3_FLAG;
ref ^= VPX_LAST2_FLAG;
ref ^= VPX_LAST3_FLAG;
#endif // CONFIG_EXT_REFS
}
if (flags & VP8_EFLAG_NO_REF_GF)
ref ^= VP9_GOLD_FLAG;
ref ^= VPX_GOLD_FLAG;
if (flags & VP8_EFLAG_NO_REF_ARF)
ref ^= VP9_ALT_FLAG;
ref ^= VPX_ALT_FLAG;
vp10_use_as_reference(cpi, ref);
}
......@@ -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 |
VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_FORCE_GF |
VP8_EFLAG_FORCE_ARF)) {
int upd = VP9_REFFRAME_ALL;
int upd = VPX_REFFRAME_ALL;
if (flags & VP8_EFLAG_NO_UPD_LAST) {
upd ^= VP9_LAST_FLAG;
upd ^= VPX_LAST_FLAG;
#if CONFIG_EXT_REFS
upd ^= VP9_LAST2_FLAG;
upd ^= VP9_LAST3_FLAG;
upd ^= VPX_LAST2_FLAG;
upd ^= VPX_LAST3_FLAG;
#endif // CONFIG_EXT_REFS
}
if (flags & VP8_EFLAG_NO_UPD_GF)
upd ^= VP9_GOLD_FLAG;
upd ^= VPX_GOLD_FLAG;
if (flags & VP8_EFLAG_NO_UPD_ARF)
upd ^= VP9_ALT_FLAG;
upd ^= VPX_ALT_FLAG;
vp10_update_reference(cpi, upd);
}
......
......@@ -606,7 +606,7 @@ typedef struct VP10_COMP {
int num_workers;
VPxWorker *workers;
struct EncWorkerData *tile_thr_data;
VP9LfSync lf_row_sync;
VP10LfSync lf_row_sync;
#if CONFIG_ENTROPY
SUBFRAME_STATS subframe_stats;
// TODO(yaowu): minimize the size of count buffers
......@@ -652,10 +652,10 @@ int vp10_use_as_reference(VP10_COMP *cpi, int ref_frame_flags);
void vp10_update_reference(VP10_COMP *cpi, int ref_frame_flags);
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);
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);
int vp10_update_entropy(VP10_COMP *cpi, int update);
......
......@@ -8572,16 +8572,16 @@ void vp10_rd_pick_inter_mode_sb(VP10_COMP *cpi,
int single_skippable[MB_MODE_COUNT][MAX_REF_FRAMES];
static const int flag_list[REFS_PER_FRAME + 1] = {
0,
VP9_LAST_FLAG,
VPX_LAST_FLAG,
#if CONFIG_EXT_REFS
VP9_LAST2_FLAG,
VP9_LAST3_FLAG,
VPX_LAST2_FLAG,
VPX_LAST3_FLAG,
#endif // CONFIG_EXT_REFS
VP9_GOLD_FLAG,
VPX_GOLD_FLAG,
#if CONFIG_EXT_REFS
VP9_BWD_FLAG,
VPX_BWD_FLAG,
#endif // CONFIG_EXT_REFS
VP9_ALT_FLAG
VPX_ALT_FLAG
};
int64_t best_rd = best_rd_so_far;
int best_rate_y = INT_MAX, best_rate_uv = INT_MAX;
......@@ -10307,16 +10307,16 @@ void vp10_rd_pick_inter_mode_sub8x8(struct VP10_COMP *cpi,
struct buf_2d yv12_mb[MAX_REF_FRAMES][MAX_MB_PLANE];
static const int flag_list[REFS_PER_FRAME + 1] = {
0,
VP9_LAST_FLAG,
VPX_LAST_FLAG,
#if CONFIG_EXT_REFS
VP9_LAST2_FLAG,
VP9_LAST3_FLAG,
VPX_LAST2_FLAG,
VPX_LAST3_FLAG,
#endif // CONFIG_EXT_REFS
VP9_GOLD_FLAG,
VPX_GOLD_FLAG,
#if CONFIG_EXT_REFS
VP9_BWD_FLAG,
VPX_BWD_FLAG,
#endif // CONFIG_EXT_REFS
VP9_ALT_FLAG
VPX_ALT_FLAG
};
int64_t best_rd = best_rd_so_far;
int64_t best_yrd = best_rd_so_far; // FIXME(rbultje) more precise
......
......@@ -874,7 +874,7 @@ static vpx_codec_err_t ctrl_copy_reference(vpx_codec_alg_priv_t *ctx,
FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1;
image2yuvconfig(&frame->img, &sd);
return vp10_copy_reference_dec(frame_worker_data->pbi,
(VP9_REFFRAME)frame->frame_type, &sd);
(VPX_REFFRAME)frame->frame_type, &sd);
} else {
return VPX_CODEC_INVALID_PARAM;
}
......
......@@ -133,16 +133,16 @@ static vpx_codec_err_t image2yuvconfig(const vpx_image_t *img,
return VPX_CODEC_OK;
}
static VP9_REFFRAME ref_frame_to_vp10_reframe(vpx_ref_frame_type_t frame) {
static VPX_REFFRAME ref_frame_to_vp10_reframe(vpx_ref_frame_type_t frame) {
switch (frame) {
case VP8_LAST_FRAME:
return VP9_LAST_FLAG;
return VPX_LAST_FLAG;
case VP8_GOLD_FRAME:
return VP9_GOLD_FLAG;
return VPX_GOLD_FLAG;
case VP8_ALTR_FRAME:
return VP9_ALT_FLAG;
return VPX_ALT_FLAG;
}
assert(0 && "Invalid Reference Frame");
return VP9_LAST_FLAG;
return VPX_LAST_FLAG;
}
#endif // VP10_VP10_IFACE_COMMON_H_
......@@ -25,7 +25,7 @@
(void*)(((size_t)(addr) + ((align) - 1)) & (size_t)-(align))
int
vp8_yv12_de_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf) {
vpx_yv12_de_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf) {
if (ybf) {
// If libvpx is using frame buffer callbacks then buffer_alloc_sz must
// not be set.
......@@ -44,7 +44,7 @@ vp8_yv12_de_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf) {
return 0;
}
int vp8_yv12_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf,
int vpx_yv12_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf,
int width, int height, int border) {
if (ybf) {
int aligned_width = (width + 15) & ~15;
......@@ -105,11 +105,11 @@ int vp8_yv12_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf,
return -2;
}
int vp8_yv12_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf,
int vpx_yv12_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf,
int width, int height, int border) {
if (ybf) {
vp8_yv12_de_alloc_frame_buffer(ybf);
return vp8_yv12_realloc_frame_buffer(ybf, width, height, border);
vpx_yv12_de_alloc_frame_buffer(ybf);
return vpx_yv12_realloc_frame_buffer(ybf, width, height, border);
}
return -2;
}
......
......@@ -101,7 +101,7 @@ static void extend_plane_high(uint8_t *const src8, int src_stride,
}
#endif
void vp8_yv12_extend_frame_borders_c(YV12_BUFFER_CONFIG *ybf) {
void vpx_yv12_extend_frame_borders_c(YV12_BUFFER_CONFIG *ybf) {
const int uv_border = ybf->border / 2;
assert(ybf->border % 2 == 0);
......@@ -243,7 +243,7 @@ static void memcpy_short_addr(uint8_t *dst8, const uint8_t *src8, int num) {
// Copies the source image into the destination image and updates the
// destination's UMV borders.
// Note: The frames are assumed to be identical in size.
void vp8_yv12_copy_frame_c(const YV12_BUFFER_CONFIG *src_ybc,
void vpx_yv12_copy_frame_c(const YV12_BUFFER_CONFIG *src_ybc,
YV12_BUFFER_CONFIG *dst_ybc) {
int row;
const uint8_t *src = src_ybc->y_buffer;
......@@ -284,7 +284,7 @@ void vp8_yv12_copy_frame_c(const YV12_BUFFER_CONFIG *src_ybc,
dst += dst_ybc->uv_stride;
}
vp8_yv12_extend_frame_borders_c(dst_ybc);
vpx_yv12_extend_frame_borders_c(dst_ybc);
return;
} else {
assert(!(dst_ybc->flags & YV12_FLAG_HIGHBITDEPTH));
......@@ -315,7 +315,7 @@ void vp8_yv12_copy_frame_c(const YV12_BUFFER_CONFIG *src_ybc,
dst += dst_ybc->uv_stride;
}
vp8_yv12_extend_frame_borders_c(dst_ybc);
vpx_yv12_extend_frame_borders_c(dst_ybc);
}
void vpx_yv12_copy_y_c(const YV12_BUFFER_CONFIG *src_ybc,
......
......@@ -16,9 +16,9 @@ if (vpx_config("CONFIG_SPATIAL_RESAMPLING") eq "yes") {
add_proto qw/void vp8_vertical_band_2_1_scale_i/, "unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width";
}
add_proto qw/void vp8_yv12_extend_frame_borders/, "struct yv12_buffer_config *ybf";
add_proto qw/void vpx_yv12_extend_frame_borders/, "struct yv12_buffer_config *ybf";