[FFmpeg-devel] [PATCH] According to SMPTE 370M (rev.2002), page 15 : "FS: First/second field flag",

Michael Niedermayer michael at niedermayer.cc
Sat Apr 2 19:52:03 CEST 2016


On Fri, Apr 01, 2016 at 03:26:12PM +0300, Александр Слободенюк wrote:
> quoting:
>         FS indicates a field which is delivered during the field one period (see table 16)
> 
> now quoting table 16:
> 
> FF      FS       Output field
> -------------------------------
> 1       1        Field 1 and field 2 are output in this order (1,2 sequence).
> -------------------------------
> 1       0        Field 2 and field 1 are output in this order (2,1 sequence).
> -------------------------------
> 0       1        Field 1 is output twice.
> -------------------------------
> 0       0        Field 2 is output twice.
> 
> this actually means, that:
> 
> AVFrame->top_field_first = FS .
> 
> But in today's FFmpeg's dv encoding and decoding realisation it's inverted:
> 
> AVFrame->top_field_first = !FS .
> 
> I tried to ask question about it by sending an email "DV frame field order" to ffmpeg-devel at ffmpeg.org ,
> but got no answer, and actually even didn't got this email from the mailing list (no idea is it normal).
> 
> I've found this case from practice, where DVCProHD coded video (by Matrox device) with image, recorded as "top_field_first"
> got AVFrame->top_field_first == 0 (with interlaced_frame == 1 ofcource).
> 
> I'm not really sure of this commit's correctness, because DV SD stream is decoded as AVFrame->top_field_first == 0 , and people say
> this is right. Checked it with gdb while decoding http://samples.ffmpeg.org/V-codecs/DVSD/pond.dv
> ---
>  libavcodec/dvdec.c | 2 +-
>  libavcodec/dvenc.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

breaks make fate

   vsynth_lena-ffv1-v3-yuv422p10
TEST    vsynth_lena-ffv1-v3-yuv444p16
TEST    vsynth_lena-ffv1-v3-bgr0
--- ./tests/ref/vsynth/vsynth_lena-dv   2016-04-01 18:19:31.171912944 +0200
+++ tests/data/fate/vsynth_lena-dv      2016-04-02 19:46:49.637843515 +0200
@@ -1,4 +1,4 @@
-85b8d55b0b68bb3fc2e90babb580f9b7 *tests/data/fate/vsynth_lena-dv.dv
+6886848bd2288e55dc794798705e9814 *tests/data/fate/vsynth_lena-dv.dv
 7200000 tests/data/fate/vsynth_lena-dv.dv
 7dac420637360b031ccae7c5a69c5e0c *tests/data/fate/vsynth_lena-dv.out.rawvideo
 stddev:    1.70 PSNR: 43.47 MAXDIFF:   33 bytes:  7603200/  7603200
Test vsynth_lena-dv failed. Look at tests/data/fate/vsynth_lena-dv.err for details.
make: *** [fate-vsynth_lena-dv] Error 1
make: *** Waiting for unfinished jobs....
--- ./tests/ref/vsynth/vsynth_lena-dv-411       2016-04-01 18:19:31.171912944 +0200
+++ tests/data/fate/vsynth_lena-dv-411  2016-04-02 19:46:49.713843517 +0200
@@ -1,4 +1,4 @@
-e428508f400327aeb96969c08fb9e1b5 *tests/data/fate/vsynth_lena-dv-411.dv
+8b5851415758fa7acb5d72824aead056 *tests/data/fate/vsynth_lena-dv-411.dv
 7200000 tests/data/fate/vsynth_lena-dv-411.dv
 713ed907fde448c603d6e9aee5efedd1 *tests/data/fate/vsynth_lena-dv-411.out.rawvideo
 stddev:    2.89 PSNR: 38.91 MAXDIFF:   45 bytes:  7603200/  7603200
Test vsynth_lena-dv-411 failed. Look at tests/data/fate/vsynth_lena-dv-411.err for details.
make: *** [fate-vsynth_lena-dv-411] Error 1
--- ./tests/ref/vsynth/vsynth_lena-dv-50        2016-04-01 18:19:31.171912944 +0200
+++ tests/data/fate/vsynth_lena-dv-50   2016-04-02 19:46:49.957843522 +0200
@@ -1,4 +1,4 @@
-0032a07167199e6f49e07fa7ed4d5f62 *tests/data/fate/vsynth_lena-dv-50.dv
+9cd5a6623a3edadc01d99a5589e9e8e8 *tests/data/fate/vsynth_lena-dv-50.dv
 14400000 tests/data/fate/vsynth_lena-dv-50.dv
 56c77e537291536b242857d1056de30c *tests/data/fate/vsynth_lena-dv-50.out.rawvideo
 stddev:    0.82 PSNR: 49.82 MAXDIFF:   12 bytes:  7603200/  7603200
Test vsynth_lena-dv-50 failed. Look at tests/data/fate/vsynth_lena-dv-50.err for details.
make: *** [fate-vsynth_lena-dv-50] Error 1

either these where wrong before or your patch is wrong
please look at these cases and find out which of the 2 it is


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you drop bombs on a foreign country and kill a hundred thousand
innocent people, expect your government to call the consequence
"unprovoked inhuman terrorist attacks" and use it to justify dropping
more bombs and killing more people. The technology changed, the idea is old.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160402/6f8120de/attachment.sig>


More information about the ffmpeg-devel mailing list