Commit 2e786a73 authored by fbarchard@google.com's avatar fbarchard@google.com

Filter Rows in C fix

BUG=none
TEST=none
Review URL: https://webrtc-codereview.appspot.com/564005

git-svn-id: http://libyuv.googlecode.com/svn/trunk@261 16f28f9a-4ce2-e073-06de-1de4eb20be90
parent 8b14c5c4
Name: libyuv
URL: http://code.google.com/p/libyuv/
Version: 260
Version: 261
License: BSD
License File: LICENSE
......
......@@ -11,7 +11,7 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_
#define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 260
#define LIBYUV_VERSION 261
#endif // INCLUDE_LIBYUV_VERSION_H_
......@@ -543,7 +543,7 @@ static void ScaleARGBFilterRows_C(uint8* dst_ptr,
int y1_fraction = source_y_fraction;
int y0_fraction = 256 - y1_fraction;
const uint8* src_ptr1 = src_ptr + src_stride;
uint8* end = dst_ptr + dst_width;
uint8* end = dst_ptr + (dst_width << 2);
do {
dst_ptr[0] = (src_ptr[0] * y0_fraction + src_ptr1[0] * y1_fraction) >> 8;
dst_ptr[1] = (src_ptr[1] * y0_fraction + src_ptr1[1] * y1_fraction) >> 8;
......@@ -557,7 +557,11 @@ static void ScaleARGBFilterRows_C(uint8* dst_ptr,
src_ptr1 += 8;
dst_ptr += 8;
} while (dst_ptr < end);
dst_ptr[0] = dst_ptr[-1];
// Duplicate the last pixel (4 bytes) for filtering.
dst_ptr[0] = dst_ptr[-4];
dst_ptr[1] = dst_ptr[-3];
dst_ptr[2] = dst_ptr[-2];
dst_ptr[3] = dst_ptr[-1];
}
/**
......
......@@ -102,7 +102,7 @@ TEST_F(libyuvTest, ARGBScaleDownBy2) {
const int dst_height = src_height / 2;
int err = 0;
for (int f = 0; f < 1; ++f) {
for (int f = 0; f < 2; ++f) {
err += ARGBTestFilter(src_width, src_height,
dst_width, dst_height,
static_cast<FilterMode>(f));
......@@ -119,7 +119,7 @@ TEST_F(libyuvTest, ARGBScaleDownBy4) {
const int dst_height = src_height / 4;
int err = 0;
for (int f = 0; f < 1; ++f) {
for (int f = 0; f < 2; ++f) {
err += ARGBTestFilter(src_width, src_height,
dst_width, dst_height,
static_cast<FilterMode>(f));
......@@ -136,7 +136,7 @@ TEST_F(libyuvTest, ARGBScaleDownBy34) {
const int dst_height = src_height * 3 / 4;
int err = 0;
for (int f = 0; f < 1; ++f) {
for (int f = 0; f < 2; ++f) {
err += ARGBTestFilter(src_width, src_height,
dst_width, dst_height,
static_cast<FilterMode>(f));
......@@ -152,7 +152,7 @@ TEST_F(libyuvTest, ARGBScaleDownBy38) {
int dst_height = src_height * 3 / 8;
int err = 0;
for (int f = 0; f < 1; ++f) {
for (int f = 0; f < 2; ++f) {
err += ARGBTestFilter(src_width, src_height,
dst_width, dst_height,
static_cast<FilterMode>(f));
......@@ -168,7 +168,7 @@ TEST_F(libyuvTest, ARGBScalePlaneBilinear) {
int dst_height = 768;
int err = 0;
for (int f = 0; f < 1; ++f) {
for (int f = 0; f < 2; ++f) {
err += ARGBTestFilter(src_width, src_height,
dst_width, dst_height,
static_cast<FilterMode>(f));
......
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