sathishkumars3 / libyuv

Automatically exported from code.google.com/p/libyuv
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Failure on large images: jpeg kMaxStride #296

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Jpeg has a size limitation of kMaxStride (default of 1920 pixels). Switched the 
code to use malloc and it works OK.  Example of the changes:

    //SIMD_ALIGNED(uint16 row[kMaxStride]);  // original code
#define ROUND_UP(x,y) ((x + y - 1) / y * y)
  void *buffer = malloc(kMaxStride * sizeof(uint16) + 16); // allocate from heap and add extra 16 bytes to allow for alignment
  uint16 *row = (uint16*)ROUND_UP((uint)buffer, 16 );  // align buffer to 16 byte address
   .....
  free(buffer);

Original issue reported on code.google.com by fbarch...@google.com on 23 Dec 2013 at 6:58

GoogleCodeExporter commented 9 years ago
Likely related, so will fix as part of this bug

set LIBYUV_WIDTH=30000
[ RUN      ] libyuvTest.ARGBScaleDownBy4_Box
crashes

and Bayer to I420, which returns with failure code, passes the test even with 
failure.  Should make unittest fail.

Original comment by fbarch...@google.com on 26 Dec 2013 at 10:00

GoogleCodeExporter commented 9 years ago
r922 fixes format_conversion (bayer) and rotate.
Current list
d:\src\libyuv\trunk\source>findstr kMaxStride *
convert.cc:      width * 4 > kMaxStride) {
convert.cc:  SIMD_ALIGNED(uint8 row[kMaxStride * 2]);
convert.cc:    RGB24ToARGBRow(src_rgb24 + src_stride_rgb24, row + kMaxStride, 
width);
convert.cc:    ARGBToUVRow(row, kMaxStride, dst_u, dst_v, width);
convert.cc:    ARGBToYRow(row + kMaxStride, dst_y + dst_stride_y, width);
convert.cc:      width * 4 > kMaxStride) {
convert.cc:  SIMD_ALIGNED(uint8 row[kMaxStride * 2]);
convert.cc:    RAWToARGBRow(src_raw + src_stride_raw, row + kMaxStride, width);
convert.cc:    ARGBToUVRow(row, kMaxStride, dst_u, dst_v, width);
convert.cc:    ARGBToYRow(row + kMaxStride, dst_y + dst_stride_y, width);
convert.cc:      width * 4 > kMaxStride) {
convert.cc:  SIMD_ALIGNED(uint8 row[kMaxStride * 2]);
convert.cc:    RGB565ToARGBRow(src_rgb565 + src_stride_rgb565, row + 
kMaxStride, width);
convert.cc:    ARGBToUVRow(row, kMaxStride, dst_u, dst_v, width);
convert.cc:    ARGBToYRow(row + kMaxStride, dst_y + dst_stride_y, width);
convert.cc:      width * 4 > kMaxStride) {
convert.cc:  SIMD_ALIGNED(uint8 row[kMaxStride * 2]);
convert.cc:    ARGB1555ToARGBRow(src_argb1555 + src_stride_argb1555, row + 
kMaxStride,
convert.cc:    ARGBToUVRow(row, kMaxStride, dst_u, dst_v, width);
convert.cc:    ARGBToYRow(row + kMaxStride, dst_y + dst_stride_y, width);
convert.cc:      width * 4 > kMaxStride) {
convert.cc:  SIMD_ALIGNED(uint8 row[kMaxStride * 2]);
convert.cc:    ARGB4444ToARGBRow(src_argb4444 + src_stride_argb4444, row + 
kMaxStride,
convert.cc:    ARGBToUVRow(row, kMaxStride, dst_u, dst_v, width);
convert.cc:    ARGBToYRow(row + kMaxStride, dst_y + dst_stride_y, width);
convert_argb.cc:  if (width * height <= kMaxStride &&
convert_argb.cc:  if (TestCpuFlag(kCpuHasSSSE3) && width >= 16 && width <= 
kMaxStride) {
convert_argb.cc:  if (width * height <= kMaxStride &&
convert_argb.cc:  if (TestCpuFlag(kCpuHasSSSE3) && width >= 16 && width <= 
kMaxStride) {
convert_from.cc:  if (TestCpuFlag(kCpuHasSSSE3) && width >= 8 && width * 4 <= 
kMaxStride) {
convert_from.cc:  if (TestCpuFlag(kCpuHasSSSE3) && width >= 8 && width * 4 <= 
kMaxStride) {
convert_from.cc:      && width * 4 <= kMaxStride
convert_from_argb.cc:      width > kMaxStride) {
convert_from_argb.cc:  SIMD_ALIGNED(uint8 row_u[kMaxStride / 2]);
convert_from_argb.cc:  SIMD_ALIGNED(uint8 row_v[kMaxStride / 2]);
convert_from_argb.cc:      width > kMaxStride) {
convert_from_argb.cc:  SIMD_ALIGNED(uint8 row_u[kMaxStride / 2]);
convert_from_argb.cc:  SIMD_ALIGNED(uint8 row_v[kMaxStride / 2]);
convert_from_argb.cc:      width > kMaxStride) {
convert_from_argb.cc:  if (width * height <= kMaxStride &&
convert_from_argb.cc:  SIMD_ALIGNED(uint8 row_y[kMaxStride]);
convert_from_argb.cc:  SIMD_ALIGNED(uint8 row_u[kMaxStride / 2]);
convert_from_argb.cc:  SIMD_ALIGNED(uint8 row_v[kMaxStride / 2]);
convert_from_argb.cc:      width > kMaxStride) {
convert_from_argb.cc:  if (width * height <= kMaxStride &&
convert_from_argb.cc:  SIMD_ALIGNED(uint8 row_y[kMaxStride]);
convert_from_argb.cc:  SIMD_ALIGNED(uint8 row_u[kMaxStride / 2]);
convert_from_argb.cc:  SIMD_ALIGNED(uint8 row_v[kMaxStride / 2]);
planar_functions.cc:  if (TestCpuFlag(kCpuHasSSSE3) && width >= 8 && width * 4 
<= kMaxStride) {
planar_functions.cc:  if (TestCpuFlag(kCpuHasSSSE3) && width >= 8 && width * 4 
<= kMaxStride) {
planar_functions.cc:  const int kMaxRow = kMaxStride / 4;
row_common.cc:// TODO(fbarchard): Handle width > kMaxStride here instead of 
calling code.
row_common.cc:  SIMD_ALIGNED(uint8 row[kMaxStride]);
row_common.cc:  SIMD_ALIGNED(uint8 row[kMaxStride]);
row_common.cc:  SIMD_ALIGNED(uint8 row[kMaxStride]);
row_common.cc:  SIMD_ALIGNED(uint8 row[kMaxStride]);
row_common.cc:  SIMD_ALIGNED(uint8 row[kMaxStride]);
row_common.cc:  SIMD_ALIGNED(uint8 row_y[kMaxStride]);
row_common.cc:  SIMD_ALIGNED(uint8 row_u[kMaxStride / 2]);
row_common.cc:  SIMD_ALIGNED(uint8 row_v[kMaxStride / 2]);
row_common.cc:  SIMD_ALIGNED(uint8 row_y[kMaxStride]);
row_common.cc:  SIMD_ALIGNED(uint8 row_u[kMaxStride / 2]);
row_common.cc:  SIMD_ALIGNED(uint8 row_v[kMaxStride / 2]);
row_common.cc:  SIMD_ALIGNED(uint8 row_y[kMaxStride]);
row_common.cc:  SIMD_ALIGNED(uint8 row_u[kMaxStride / 2]);
row_common.cc:  SIMD_ALIGNED(uint8 row_v[kMaxStride / 2]);
row_common.cc:  SIMD_ALIGNED(uint8 row_y[kMaxStride]);
row_common.cc:  SIMD_ALIGNED(uint8 row_u[kMaxStride / 2]);
row_common.cc:  SIMD_ALIGNED(uint8 row_v[kMaxStride / 2]);
scale.cc:  if (!IS_ALIGNED(src_width, 16) || (src_width > kMaxStride) ||
scale.cc:  // TODO(fbarchard): Remove kMaxStride limitation.
scale.cc:  SIMD_ALIGNED(uint16 row[kMaxStride]);
scale.cc:  assert(Abs(src_width) <= kMaxStride);
scale.cc:  SIMD_ALIGNED(uint8 row[kMaxStride + 16]);
scale.cc:  assert(Abs(dst_width) <= kMaxStride);
scale.cc:  SIMD_ALIGNED(uint8 row[2 * kMaxStride]);
scale.cc:  int rowstride = kMaxStride;
scale.cc:  if (filtering == kFilterBox && src_width <= kMaxStride &&
scale.cc:  if (filtering && dst_height > src_height && dst_width <= kMaxStride) 
{
scale.cc:  if (filtering && src_width <= kMaxStride) {
scale_argb.cc:  assert(dst_width * 2 <= kMaxStride);
scale_argb.cc:  SIMD_ALIGNED(uint8 row[kMaxStride * 2 + 16]);
scale_argb.cc:                      row + kMaxStride, dst_width * 2);
scale_argb.cc:    ScaleARGBRowDown2(row, kMaxStride, dst_argb, dst_width);
scale_argb.cc:  assert(clip_src_width <= kMaxStride);
scale_argb.cc:  SIMD_ALIGNED(uint8 row[kMaxStride + 16]);
scale_argb.cc:  assert(dst_width * 4 <= kMaxStride);
scale_argb.cc:  SIMD_ALIGNED(uint8 row[2 * kMaxStride]);
scale_argb.cc:  int rowstride = kMaxStride;
scale_argb.cc:  assert(dst_width * 4 <= kMaxStride);
scale_argb.cc:  SIMD_ALIGNED(uint8 row[2 * kMaxStride]);
scale_argb.cc:  SIMD_ALIGNED(uint8 argb_row[kMaxStride * 4]);
scale_argb.cc:  int rowstride = kMaxStride;
scale_argb.cc:  if (filtering && dy < 65536 && dst_width * 4 <= kMaxStride) {
scale_argb.cc:  if (filtering && src_width * 4 < kMaxStride) {

Original comment by fbarch...@google.com on 26 Dec 2013 at 11:32

GoogleCodeExporter commented 9 years ago
Fixed in r929

Original comment by fbarch...@chromium.org on 27 Dec 2013 at 2:19