dinhminhquoi / webm

Automatically exported from code.google.com/p/webm
0 stars 0 forks source link

libyuv does not use box filter as intended #786

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Code snippet from third_party/libyuv/source/scale.c

static void ScalePlaneDown(int src_width, int src_height,
                           int dst_width, int dst_height,
                           int src_stride, int dst_stride,
                           const uint8* src_ptr, uint8* dst_ptr,
                           FilterModeEnum filtering) {
  if (!filtering) {
    ScalePlaneSimple(src_width, src_height, dst_width, dst_height,
                     src_stride, dst_stride, src_ptr, dst_ptr);
  } else if (filtering == kFilterBilinear || src_height * 2 > dst_height) {
    // between 1/2x and 1x use bilinear
    ScalePlaneBilinear(src_width, src_height, dst_width, dst_height,
                       src_stride, dst_stride, src_ptr, dst_ptr);
  } else {
    ScalePlaneBox(src_width, src_height, dst_width, dst_height,
                  src_stride, dst_stride, src_ptr, dst_ptr);
  }
}

The condition src_height * 2 > dst_height is always true as this function is 
only called when src_height > dst_height.

I think the intended condition is src_height > dst_height * 2

Original issue reported on code.google.com by james.hu...@argondesign.com on 14 May 2014 at 3:38

GoogleCodeExporter commented 8 years ago

Original comment by renganat...@google.com on 15 May 2014 at 10:18

GoogleCodeExporter commented 8 years ago
This can be closed since libyuv has been updated

http://git.chromium.org/gitweb/?p=webm/libvpx.git;a=commit;h=47031c0a54b2054c980
66919dbd1e71c60b3c4f4

Original comment by james.hu...@argondesign.com on 21 May 2014 at 6:30