updating libyuv to latest version (98).

This CL also includes some additional adaptations to the code due to the upgrade. 
Review URL: http://webrtc-codereview.appspot.com/306001

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1139 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
mikhal@webrtc.org
2011-12-08 22:45:53 +00:00
parent 7766e2a82d
commit ffa0a9e9c9
4 changed files with 7 additions and 24 deletions

2
DEPS
View File

@@ -84,7 +84,7 @@ deps = {
"http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp@246",
"trunk/third_party/libyuv":
(Var("googlecode_url") % "libyuv") + "/trunk@54",
(Var("googlecode_url") % "libyuv") + "/trunk@98",
}
deps_os = {

View File

@@ -225,11 +225,6 @@ int ConvertI420ToRGBAIPhone(const uint8_t* src_frame,
int width, int height,
int dst_stride);
// I420 Cut and Pad - make a center cut
int CutI420Frame(uint8_t* frame,
int src_width, int src_height,
int dst_width, int dst_height);
int I420Rotate(const uint8_t* src_frame,
uint8_t* dst_frame,
int width, int height,

View File

@@ -137,7 +137,7 @@ int ConvertI420ToRGBAMac(const uint8_t* src_frame,
uint8_t* dst_frame,
int width, int height,
int dst_stride) {
// Equivalent to Convert YV12ToRGBA.
// Equivalent to Convert YV12ToBGRA.
// YV12 same as I420 with U and V swapped.
if (dst_stride == 0 || dst_stride == width)
dst_stride = 4 * width;
@@ -145,7 +145,7 @@ int ConvertI420ToRGBAMac(const uint8_t* src_frame,
const uint8_t* uplane = src_frame + width * height;
const uint8_t* vplane = uplane + (width * height / 4);
return libyuv::I420ToARGB(yplane, width,
return libyuv::I420ToBGRA(yplane, width,
vplane, width / 2,
uplane, width / 2,
dst_frame, dst_stride,
@@ -520,16 +520,6 @@ int ConvertYUY2ToI420(int width, int height,
width, height);
}
// Make a center cut
int CutI420Frame(uint8_t* frame,
int fromWidth, int fromHeight,
int toWidth, int toHeight) {
// TODO(mikhal): Verify
return libyuv::I420Crop(frame,
fromWidth, fromHeight,
toWidth, toHeight);
}
int ConvertRGB24ToARGB(const uint8_t* src_frame, uint8_t* dst_frame,
int width, int height, int dst_stride) {
if (dst_stride == 0 || dst_stride == width)
@@ -575,15 +565,14 @@ int ConvertI420ToARGBMac(const uint8_t* src_frame, uint8_t* dst_frame,
int ConvertARGBMacToI420(int width, int height,
const uint8_t* src_frame, uint8_t* dst_frame) {
// Equivalent to YV12ToARGB.
// YV12 = YVU => use I420 and switch U and V.
// Equivalent to BGRAToI420
uint8_t* yplane = dst_frame;
uint8_t* uplane = yplane + width * height;
uint8_t* vplane = uplane + (width * height / 4);
return libyuv::ARGBToI420(src_frame, width * 4,
return libyuv::BGRAToI420(src_frame, width * 4,
yplane, width,
vplane, width / 2,
uplane, width / 2,
vplane, width / 2,
width, height);
}

View File

@@ -99,7 +99,6 @@ TEST_F(LibYuvTest, MirrorSanityTest) {
uint8_t* test_buffer1 = new uint8_t[frame_length_];
uint8_t* test_buffer2 = new uint8_t[frame_length_];
// Setting bad initial values
EXPECT_EQ(-1, MirrorI420LeftRight(test_buffer1, test_buffer2, width_, -30));
EXPECT_EQ(-1, MirrorI420LeftRight(test_buffer1, test_buffer2, -352, height_));
EXPECT_EQ(-1, MirrorI420LeftRight(NULL, test_buffer2, width_, height_));
EXPECT_EQ(-1, MirrorI420LeftRight(test_buffer1, NULL, width_, height_));
@@ -132,7 +131,7 @@ TEST_F(LibYuvTest, ConvertTest) {
fwrite(res_i420_buffer, frame_length_, 1, output_file);
ImagePSNRfromBuffer(orig_buffer, res_i420_buffer, width_, height_, &psnr);
// Optimization Speed- quality trade-off => 45 dB only.
EXPECT_EQ(45.0, ceil(psnr));
EXPECT_GT(ceil(psnr), 45);
j++;
delete [] res_rgb_buffer2;