Fix ARF construction when scaling
The ARF frame should always be the same size as the native resolution of the input frames. It will be scaled to the required resolution at encode time. Change-Id: I0afe858129aa6ef65b1648f43476331715346896
This commit is contained in:
parent
aebb361bb7
commit
1def634f1a
@ -200,8 +200,8 @@ static void temporal_filter_iterate_c(VP9_COMP *cpi,
|
||||
int frame;
|
||||
int mb_col, mb_row;
|
||||
unsigned int filter_weight;
|
||||
int mb_cols = cpi->common.mb_cols;
|
||||
int mb_rows = cpi->common.mb_rows;
|
||||
int mb_cols = (frames[alt_ref_index]->y_crop_width + 15) >> 4;
|
||||
int mb_rows = (frames[alt_ref_index]->y_crop_height + 15) >> 4;
|
||||
int mb_y_offset = 0;
|
||||
int mb_uv_offset = 0;
|
||||
DECLARE_ALIGNED_ARRAY(16, unsigned int, accumulator, 16 * 16 * 3);
|
||||
@ -233,7 +233,7 @@ static void temporal_filter_iterate_c(VP9_COMP *cpi,
|
||||
// To keep the mv in play for both Y and UV planes the max that it
|
||||
// can be on a border is therefore 16 - (2*VP9_INTERP_EXTEND+1).
|
||||
cpi->mb.mv_row_min = -((mb_row * 16) + (17 - 2 * VP9_INTERP_EXTEND));
|
||||
cpi->mb.mv_row_max = ((cpi->common.mb_rows - 1 - mb_row) * 16)
|
||||
cpi->mb.mv_row_max = ((mb_rows - 1 - mb_row) * 16)
|
||||
+ (17 - 2 * VP9_INTERP_EXTEND);
|
||||
|
||||
for (mb_col = 0; mb_col < mb_cols; mb_col++) {
|
||||
@ -244,7 +244,7 @@ static void temporal_filter_iterate_c(VP9_COMP *cpi,
|
||||
vpx_memset(count, 0, 16 * 16 * 3 * sizeof(count[0]));
|
||||
|
||||
cpi->mb.mv_col_min = -((mb_col * 16) + (17 - 2 * VP9_INTERP_EXTEND));
|
||||
cpi->mb.mv_col_max = ((cpi->common.mb_cols - 1 - mb_col) * 16)
|
||||
cpi->mb.mv_col_max = ((mb_cols - 1 - mb_col) * 16)
|
||||
+ (17 - 2 * VP9_INTERP_EXTEND);
|
||||
|
||||
for (frame = 0; frame < frame_count; frame++) {
|
||||
@ -480,10 +480,12 @@ void vp9_temporal_filter(VP9_COMP *cpi, int distance) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// ARF is produced at the native frame size and resized when coded.
|
||||
vp9_setup_scale_factors_for_frame(&sf,
|
||||
get_frame_new_buffer(cm)->y_crop_width,
|
||||
get_frame_new_buffer(cm)->y_crop_height,
|
||||
cm->width, cm->height);
|
||||
frames[0]->y_crop_width,
|
||||
frames[0]->y_crop_height,
|
||||
frames[0]->y_crop_width,
|
||||
frames[0]->y_crop_height);
|
||||
}
|
||||
|
||||
temporal_filter_iterate_c(cpi, frames, frames_to_blur,
|
||||
|
Loading…
Reference in New Issue
Block a user