Commit aa8fe0d2 authored by Adrian Grange's avatar Adrian Grange

Fixed buffer selection for UV in AltRef filtering

Corrected setting of "which_buffer" for U & V cases to match that
used for Y, i.e. to refer to the temporally most recent frame of
those to be filtered.

Change-Id: Idf94b287ef47a05f060da3e61134a0b616adcb6b
parent f1a3b1e0
...@@ -3231,7 +3231,7 @@ static void vp8cx_temp_blur1_c ...@@ -3231,7 +3231,7 @@ static void vp8cx_temp_blur1_c
unsigned char block_size unsigned char block_size
) )
{ {
int byte = 0; // Buffer offset for the current pixel value being filtered int byte = 0; // Buffer offset for current pixel being filtered
int frame = 0; int frame = 0;
int modifier = 0; int modifier = 0;
int i, j, k; int i, j, k;
...@@ -3264,9 +3264,9 @@ static void vp8cx_temp_blur1_c ...@@ -3264,9 +3264,9 @@ static void vp8cx_temp_blur1_c
for (frame = 0; frame < frame_count; frame++) for (frame = 0; frame < frame_count; frame++)
{ {
// get current frame pixel value // get current frame pixel value
int pixel_value = frames[frame][byte]; // int pixel_value = *frameptr; int pixel_value = frames[frame][byte];
modifier = src_byte; // modifier = s[byte]; modifier = src_byte;
modifier -= pixel_value; modifier -= pixel_value;
modifier *= modifier; modifier *= modifier;
modifier >>= strength; modifier >>= strength;
...@@ -3283,10 +3283,10 @@ static void vp8cx_temp_blur1_c ...@@ -3283,10 +3283,10 @@ static void vp8cx_temp_blur1_c
} }
accumulator += (count >> 1); accumulator += (count >> 1);
accumulator *= fixed_divide[count]; // accumulator *= ppi->fixed_divide[count]; accumulator *= fixed_divide[count];
accumulator >>= 16; accumulator >>= 16;
dst[byte] = accumulator; // d[byte] = accumulator; dst[byte] = accumulator;
// move to next pixel // move to next pixel
byte++; byte++;
...@@ -3392,7 +3392,8 @@ static void vp8cx_temp_filter_c ...@@ -3392,7 +3392,8 @@ static void vp8cx_temp_filter_c
{ {
if ((frames_to_blur_backward + frames_to_blur_forward) >= max_frames) if ((frames_to_blur_backward + frames_to_blur_forward) >= max_frames)
{ {
frames_to_blur_backward = max_frames - frames_to_blur_forward - 1; frames_to_blur_backward
= max_frames - frames_to_blur_forward - 1;
} }
} }
else else
...@@ -3449,7 +3450,7 @@ static void vp8cx_temp_filter_c ...@@ -3449,7 +3450,7 @@ static void vp8cx_temp_filter_c
for (frame = 0; frame < frames_to_blur; frame++) for (frame = 0; frame < frames_to_blur; frame++)
{ {
int which_buffer = cpi->last_alt_ref_sei - frame; int which_buffer = start_frame - frame;
if (which_buffer < 0) if (which_buffer < 0)
which_buffer += cpi->oxcf.lag_in_frames; which_buffer += cpi->oxcf.lag_in_frames;
...@@ -3473,7 +3474,7 @@ static void vp8cx_temp_filter_c ...@@ -3473,7 +3474,7 @@ static void vp8cx_temp_filter_c
for (frame = 0; frame < frames_to_blur; frame++) for (frame = 0; frame < frames_to_blur; frame++)
{ {
int which_buffer = cpi->last_alt_ref_sei - frame; int which_buffer = start_frame - frame;
if (which_buffer < 0) if (which_buffer < 0)
which_buffer += cpi->oxcf.lag_in_frames; which_buffer += cpi->oxcf.lag_in_frames;
......
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