bleo
14th June 2004, 07:32
This is a report of some of my findings on the YV12 chroma upsampling bug. There is some background information in these threads: dvd2avi/mpeg2dec3 interlaced/progressive output (http://forum.doom9.org/showthread.php?threadid=74056)
DGMPGDec 1.1.0 version definition (http://forum.doom9.org/showthread.php?threadid=76609)
Bug in dgmpegdec? (Bad Color upsample) (http://forum.doom9.org/showthread.php?threadid=76878)
The source material was Kill Bill Vol. 1, DVD PAL region 4, frames 96900 (1:04:36) - 97200 (1:04:48).
First investigation: Are the interlaced flags recorded in MPEG-2 video true?
BitRate Viewer reports VTS_01_1.VOB as
Num. of picture read: 26
Stream type: MPEG-2 MP@ML VBR
Resolution: 720*576
Aspect ratio: 16:9 Generic
Framerate: 25.00
Nom. bitrate: 9800000 Bit/Sec
VBV buffer size: 112
Constrained param. flag: No
Chroma format: 4:2:0
DCT precision: 10
Pic. structure: Frame
Field topfirst: Yes
DCT type: Field
Quantscale: Nonlinear
Scan type: Alternate
Frame type: Interlaced
Notes:
I am not completely sure, but I think it means the video is interlaced
The video was indexed using DGIndex 1.0.12. It reports the Frame Type as Interlaced
The video was frameserved with AviSynth 2.5.3 using the script:
MPEG2Source("C:\usr\KILLBILL_VOL1\KILLBILL_VOL1.d2v")
Trim(96900,97200)
When viewed in VirtualDub using the Helix YV12 codec, the chroma upsampling bug was apparent.
ConvertToYUY2(interlaced=false) was added to the avs script, and when viewed in VitrualDub (as YUY2), the chroma upsampling was correct
ConvertToYUY2(interlaced=true) was changed in the avs script, and when viewed in VirtualDub, the chroma upsampling bug was there
Finding: the interlaced flag as reported by BitRate Viewer and DGIndex is not necessarily correct
Second Investigation: Which YV12 format (progressive or interlaced) does Helix Producer assume as input?
The video was frameserved with AviSynth using the script:
MPEG2Source("C:\usr\KILLBILL_VOL1\KILLBILL_VOL1.d2v")
Trim(96900,97200)
The video was encoded using Helix Producer build 10.0.0.545 at 2.9 Mbit/s
When viewed using RealPlayer 10 the chroma upsampling was correct
Finding: although all combinations have not been tested, at this stage it is assumed that Helix Producer assumes progressive YV12 as input
Discussion:
If the interlaced flag cannot be trusted, then having DGDecode automatically upsample to YUY2 based on it will not be the 'be all end all' solution to the chroma upsampling bug.
It is also favourable to keep the video as YV12 throughout the encoding chain for speed and 'purity'. Therefore, we should investigate for each encoder whether it accepts progressive or interlaced YV12. Then we may ConvertToYUY2 if the source YV12 format and encoder are mismatched.
For example, if I determined through visual inspection that my source had interlaced YV12, regardless of what the interlaced flag was or whether it was a film or 50 field/sec video, then I should ConvertToYUY2(interlaced=true) before encoding to RealVideo 10.
DGMPGDec 1.1.0 version definition (http://forum.doom9.org/showthread.php?threadid=76609)
Bug in dgmpegdec? (Bad Color upsample) (http://forum.doom9.org/showthread.php?threadid=76878)
The source material was Kill Bill Vol. 1, DVD PAL region 4, frames 96900 (1:04:36) - 97200 (1:04:48).
First investigation: Are the interlaced flags recorded in MPEG-2 video true?
BitRate Viewer reports VTS_01_1.VOB as
Num. of picture read: 26
Stream type: MPEG-2 MP@ML VBR
Resolution: 720*576
Aspect ratio: 16:9 Generic
Framerate: 25.00
Nom. bitrate: 9800000 Bit/Sec
VBV buffer size: 112
Constrained param. flag: No
Chroma format: 4:2:0
DCT precision: 10
Pic. structure: Frame
Field topfirst: Yes
DCT type: Field
Quantscale: Nonlinear
Scan type: Alternate
Frame type: Interlaced
Notes:
I am not completely sure, but I think it means the video is interlaced
The video was indexed using DGIndex 1.0.12. It reports the Frame Type as Interlaced
The video was frameserved with AviSynth 2.5.3 using the script:
MPEG2Source("C:\usr\KILLBILL_VOL1\KILLBILL_VOL1.d2v")
Trim(96900,97200)
When viewed in VirtualDub using the Helix YV12 codec, the chroma upsampling bug was apparent.
ConvertToYUY2(interlaced=false) was added to the avs script, and when viewed in VitrualDub (as YUY2), the chroma upsampling was correct
ConvertToYUY2(interlaced=true) was changed in the avs script, and when viewed in VirtualDub, the chroma upsampling bug was there
Finding: the interlaced flag as reported by BitRate Viewer and DGIndex is not necessarily correct
Second Investigation: Which YV12 format (progressive or interlaced) does Helix Producer assume as input?
The video was frameserved with AviSynth using the script:
MPEG2Source("C:\usr\KILLBILL_VOL1\KILLBILL_VOL1.d2v")
Trim(96900,97200)
The video was encoded using Helix Producer build 10.0.0.545 at 2.9 Mbit/s
When viewed using RealPlayer 10 the chroma upsampling was correct
Finding: although all combinations have not been tested, at this stage it is assumed that Helix Producer assumes progressive YV12 as input
Discussion:
If the interlaced flag cannot be trusted, then having DGDecode automatically upsample to YUY2 based on it will not be the 'be all end all' solution to the chroma upsampling bug.
It is also favourable to keep the video as YV12 throughout the encoding chain for speed and 'purity'. Therefore, we should investigate for each encoder whether it accepts progressive or interlaced YV12. Then we may ConvertToYUY2 if the source YV12 format and encoder are mismatched.
For example, if I determined through visual inspection that my source had interlaced YV12, regardless of what the interlaced flag was or whether it was a film or 50 field/sec video, then I should ConvertToYUY2(interlaced=true) before encoding to RealVideo 10.