Commit 7da6422d authored by Dmitry Kovalev's avatar Dmitry Kovalev Committed by Gerrit Code Review
Browse files

Merge "Adding get_vp9_ref_frame_buffer() function."

parents 518a934f 804a155d
...@@ -2193,27 +2193,33 @@ int vp9_update_reference(VP9_PTR ptr, int ref_frame_flags) { ...@@ -2193,27 +2193,33 @@ int vp9_update_reference(VP9_PTR ptr, int ref_frame_flags) {
return 0; return 0;
} }
int vp9_copy_reference_enc(VP9_PTR ptr, VP9_REFFRAME ref_frame_flag, static YV12_BUFFER_CONFIG *get_vp9_ref_frame_buffer(VP9_COMP *cpi,
YV12_BUFFER_CONFIG *sd) { VP9_REFFRAME ref_frame_flag) {
VP9_COMP *cpi = (VP9_COMP *)(ptr); MV_REFERENCE_FRAME ref_frame = NONE;
YV12_BUFFER_CONFIG *cfg;
if (ref_frame_flag == VP9_LAST_FLAG) if (ref_frame_flag == VP9_LAST_FLAG)
cfg = get_ref_frame_buffer(cpi, LAST_FRAME); ref_frame = LAST_FRAME;
else if (ref_frame_flag == VP9_GOLD_FLAG) else if (ref_frame_flag == VP9_GOLD_FLAG)
cfg = get_ref_frame_buffer(cpi, GOLDEN_FRAME); ref_frame = GOLDEN_FRAME;
else if (ref_frame_flag == VP9_ALT_FLAG) else if (ref_frame_flag == VP9_ALT_FLAG)
cfg = get_ref_frame_buffer(cpi, ALTREF_FRAME); ref_frame = ALTREF_FRAME;
else
return -1;
vp8_yv12_copy_frame(cfg, sd); return ref_frame == NONE ? NULL : get_ref_frame_buffer(cpi, ref_frame);
}
return 0; int vp9_copy_reference_enc(VP9_PTR ptr, VP9_REFFRAME ref_frame_flag,
YV12_BUFFER_CONFIG *sd) {
VP9_COMP *const cpi = (VP9_COMP *)ptr;
YV12_BUFFER_CONFIG *cfg = get_vp9_ref_frame_buffer(cpi, ref_frame_flag);
if (cfg) {
vp8_yv12_copy_frame(cfg, sd);
return 0;
} else {
return -1;
}
} }
int vp9_get_reference_enc(VP9_PTR ptr, int index, YV12_BUFFER_CONFIG **fb) { int vp9_get_reference_enc(VP9_PTR ptr, int index, YV12_BUFFER_CONFIG **fb) {
VP9_COMP *cpi = (VP9_COMP *)(ptr); VP9_COMP *cpi = (VP9_COMP *)ptr;
VP9_COMMON *cm = &cpi->common; VP9_COMMON *cm = &cpi->common;
if (index < 0 || index >= REF_FRAMES) if (index < 0 || index >= REF_FRAMES)
...@@ -2225,23 +2231,14 @@ int vp9_get_reference_enc(VP9_PTR ptr, int index, YV12_BUFFER_CONFIG **fb) { ...@@ -2225,23 +2231,14 @@ int vp9_get_reference_enc(VP9_PTR ptr, int index, YV12_BUFFER_CONFIG **fb) {
int vp9_set_reference_enc(VP9_PTR ptr, VP9_REFFRAME ref_frame_flag, int vp9_set_reference_enc(VP9_PTR ptr, VP9_REFFRAME ref_frame_flag,
YV12_BUFFER_CONFIG *sd) { YV12_BUFFER_CONFIG *sd) {
VP9_COMP *cpi = (VP9_COMP *)(ptr); VP9_COMP *cpi = (VP9_COMP *)ptr;
VP9_COMMON *cm = &cpi->common; YV12_BUFFER_CONFIG *cfg = get_vp9_ref_frame_buffer(cpi, ref_frame_flag);
if (cfg) {
int ref_fb_idx; vp8_yv12_copy_frame(sd, cfg);
return 0;
if (ref_frame_flag == VP9_LAST_FLAG) } else {
ref_fb_idx = cm->ref_frame_map[cpi->lst_fb_idx];
else if (ref_frame_flag == VP9_GOLD_FLAG)
ref_fb_idx = cm->ref_frame_map[cpi->gld_fb_idx];
else if (ref_frame_flag == VP9_ALT_FLAG)
ref_fb_idx = cm->ref_frame_map[cpi->alt_fb_idx];
else
return -1; return -1;
}
vp8_yv12_copy_frame(sd, &cm->yv12_fb[ref_fb_idx]);
return 0;
} }
int vp9_update_entropy(VP9_PTR comp, int update) { int vp9_update_entropy(VP9_PTR comp, int update) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment