Bug 488951 - Fix YUV conversion of odd height videos. Add a reftest for offset and odd sized videos. rs=roc

--HG--
extra : rebase_source : f011d4841fa506bcdd19a0adb81b63bbdf0aa643
This commit is contained in:
Matthew Gregan 2009-05-20 17:20:56 +12:00
parent cb30f65532
commit 4b25722e83
8 changed files with 48 additions and 2 deletions

Binary file not shown.

View File

@ -0,0 +1,6 @@
<!DOCTYPE HTML>
<html>
<body style="background:white;">
<div style="width:29px; height:29px; background:black;"></div>
</body>
</html>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
version="1.1">
<!-- use an empty g to force filters.svg to load before onload -->
<use xlink:href="../filters.svg#empty" />
<foreignObject filter="url(../filters.svg#ThresholdRGB)" x="0" y="0" height="100%" width="100%">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<body style="background:white;">
<video src="black29x19offset.ogv"></video>
</body>
</html>
</foreignObject>
</svg>

After

Width:  |  Height:  |  Size: 537 B

View File

@ -11,6 +11,7 @@ HTTP(..) == canvas-1b.xhtml basic-1-ref.html
== empty-1b.html empty-1-ref.html
HTTP(..) == object-aspect-ratio-1a.xhtml aspect-ratio-1-ref.html
HTTP(..) == object-aspect-ratio-1b.xhtml aspect-ratio-1-ref.html
HTTP(..) == offset-1.xhtml offset-1-ref.html
skip-if(MOZ_WIDGET_TOOLKIT=="gtk2") HTTP(..) == object-aspect-ratio-2a.xhtml aspect-ratio-2-ref.html
skip-if(MOZ_WIDGET_TOOLKIT=="gtk2") HTTP(..) == object-aspect-ratio-2b.xhtml aspect-ratio-2-ref.html
skip-if(MOZ_WIDGET_TOOLKIT=="gtk2") HTTP(..) == zoomed-1.xhtml zoomed-1-ref.html

View File

@ -31,3 +31,6 @@ bug488951: Fix for YUV conversion for odd sized frames. Cherrypicked from
bug488951_fix_yuv: Additional fixes to YUV conversion that have not been
upstreamed yet.
bug488951_fix_yuv_2: Additional fix to YUV conversion for odd height videos
that has not been upstreamed yet.

View File

@ -0,0 +1,22 @@
diff --git a/media/liboggplay/src/liboggplay/oggplay_yuv2rgb_template.h b/media/liboggplay/src/liboggplay/oggplay_yuv2rgb_template.h
--- a/media/liboggplay/src/liboggplay/oggplay_yuv2rgb_template.h
+++ b/media/liboggplay/src/liboggplay/oggplay_yuv2rgb_template.h
@@ -85,17 +85,17 @@ static void
pu += 1; pv += 1; \
} \
} \
} \
\
ptro += rgb->rgb_width * 4; \
ptry += yuv->y_width; \
\
- if (i & 0x1) \
+ if (i & 0x1 && !(i+1==h-1 && h&1)) \
{ \
ptru += yuv->uv_width; \
ptrv += yuv->uv_width; \
} \
} \
CLEANUP \
}

View File

@ -90,7 +90,7 @@ static void \
ptro += rgb->rgb_width * 4; \
ptry += yuv->y_width; \
\
if (i & 0x1) \
if (i & 0x1 && !(i+1==h-1 && h&1)) \
{ \
ptru += yuv->uv_width; \
ptrv += yuv->uv_width; \

View File

@ -53,6 +53,6 @@ patch -p3 < aspect_ratio.patch
patch -p3 < bug493678.patch
patch -p1 < bug493224.patch
patch -p3 < seek_to_key_frame.patch
patch -p3 < bug488951.patch
patch -p3 < bug488951_yuv_fix.patch
patch -p3 < bug488951_yuv_fix_2.patch