[FFmpeg-devel] [PATCH 06/10] avcodec/dca_parser: improve frame end search

foo86 foobaz86 at gmail.com
Sat May 21 01:28:10 CEST 2016


On Fri, May 20, 2016 at 04:46:31PM -0300, James Almer wrote:
> On 5/20/2016 2:40 PM, foo86 wrote:
> > On Fri, May 13, 2016 at 12:48:28PM +0300, foo86 wrote:
> >> Parse core frame size directly when searching for frame end instead of
> >> using value extracted from previous frame.
> >>
> >> Account for unused bits when calculating sync word distance for 14-bit
> >> streams to avoid alias sync detection.
> >>
> >> Parse EXSS frame size and skip over EXSS frame to avoid alias sync
> >> detection.
> >> ---
> >>  libavcodec/dca_parser.c | 94 +++++++++++++++++++++++++++++++++++++++++--------
> >>  1 file changed, 80 insertions(+), 14 deletions(-)
> > 
> > Fixes parser failure with the following sample: https://0x0.st/q4G.dts
> 
> Seems to happen with codec copy only, two frames were being treated as one.
> Decoding doesn't seem affected by this patch. framecrc output looks the same
> before and after.

For me it is the opposite: alias sync word in EXSS area at frame 21
results in a frame split in two without this patch (the second split
"frame" fails to decode).

This causes errors printed during decoding, and resulting framecrc
output is different (see attached files).
-------------- next part --------------
#software: Lavf57.36.100
#tb 0: 1/192000
#media_type 0: audio
#codec_id 0: pcm_s24le
#sample_rate 0: 192000
#channel_layout 0: 60f
0,          0,          0,     2048,    36864, 0x60a47074
0,       2048,       2048,     2048,    36864, 0xbd114c5c
0,       4096,       4096,     2048,    36864, 0x0b7243ce
0,       6144,       6144,     2048,    36864, 0x7f8c5b6c
0,       8192,       8192,     2048,    36864, 0x02f96b0a
0,      10240,      10240,     2048,    36864, 0xccf6f3fe
0,      12288,      12288,     2048,    36864, 0x8c06a646
0,      14336,      14336,     2048,    36864, 0x0dce889c
0,      16384,      16384,     2048,    36864, 0xa650826b
0,      18432,      18432,     2048,    36864, 0x9bb45a74
0,      20480,      20480,     2048,    36864, 0xf011921f
0,      22528,      22528,     2048,    36864, 0xb6b4db5b
0,      24576,      24576,     2048,    36864, 0x51e3283f
0,      26624,      26624,     2048,    36864, 0xe58e7024
0,      28672,      28672,     2048,    36864, 0x2088d810
0,      30720,      30720,     2048,    36864, 0xba88dd19
0,      32768,      32768,     2048,    36864, 0xe72278cb
0,      34816,      34816,     2048,    36864, 0x5096ec0e
0,      36864,      36864,     2048,    36864, 0x1faddc6f
0,      38912,      38912,     2048,    36864, 0xa7cb41d5
0,      40960,      40960,     1984,    35712, 0x7fbd6605
0,      47104,      47104,     2048,    36864, 0x18cb02c9
0,      49152,      49152,     2048,    36864, 0x8290b628
0,      51200,      51200,     2048,    36864, 0x00065519
0,      53248,      53248,     2048,    36864, 0x26302fd0
0,      55296,      55296,     2048,    36864, 0x0fc5652c
0,      57344,      57344,     2048,    36864, 0x80f992f5
0,      59392,      59392,     2048,    36864, 0x770d7bd3
0,      61440,      61440,     2048,    36864, 0xf06ff731
0,      63488,      63488,     2048,    36864, 0xf42f36a2
0,      65536,      65536,     2048,    36864, 0x40496db9
0,      67584,      67584,     2048,    36864, 0x88e3c586
0,      69632,      69632,     2048,    36864, 0x4027756f
0,      71680,      71680,     2048,    36864, 0x30e1e2af
0,      73728,      73728,     2048,    36864, 0x794f500e
0,      75776,      75776,     2048,    36864, 0x1388d154
0,      77824,      77824,     2048,    36864, 0x55fef3fa
0,      79872,      79872,     2048,    36864, 0x631de608
0,      81920,      81920,     2048,    36864, 0xa479ecfe
0,      83968,      83968,     2048,    36864, 0xe561fe79
0,      86016,      86016,     2048,    36864, 0x806ae121
0,      88064,      88064,     2048,    36864, 0xfa832f7d
0,      90112,      90112,     2048,    36864, 0x4ba72c89
0,      92160,      92160,     2048,    36864, 0xb107a5d9
0,      94208,      94208,     2048,    36864, 0x0871c610
0,      96256,      96256,     2048,    36864, 0xc74e0148
0,      98304,      98304,     2048,    36864, 0x1134ce2e
0,     100352,     100352,     2048,    36864, 0x4bf46961
0,     102400,     102400,     2048,    36864, 0xee4c58ea
0,     104448,     104448,     2048,    36864, 0x84cb078e
-------------- next part --------------
#software: Lavf57.36.100
#tb 0: 1/192000
#media_type 0: audio
#codec_id 0: pcm_s24le
#sample_rate 0: 192000
#channel_layout 0: 60f
0,          0,          0,     2048,    36864, 0x60a47074
0,       2048,       2048,     2048,    36864, 0xbd114c5c
0,       4096,       4096,     2048,    36864, 0x0b7243ce
0,       6144,       6144,     2048,    36864, 0x7f8c5b6c
0,       8192,       8192,     2048,    36864, 0x02f96b0a
0,      10240,      10240,     2048,    36864, 0xccf6f3fe
0,      12288,      12288,     2048,    36864, 0x8c06a646
0,      14336,      14336,     2048,    36864, 0x0dce889c
0,      16384,      16384,     2048,    36864, 0xa650826b
0,      18432,      18432,     2048,    36864, 0x9bb45a74
0,      20480,      20480,     2048,    36864, 0xf011921f
0,      22528,      22528,     2048,    36864, 0xb6b4db5b
0,      24576,      24576,     2048,    36864, 0x51e3283f
0,      26624,      26624,     2048,    36864, 0xe58e7024
0,      28672,      28672,     2048,    36864, 0x2088d810
0,      30720,      30720,     2048,    36864, 0xba88dd19
0,      32768,      32768,     2048,    36864, 0xe72278cb
0,      34816,      34816,     2048,    36864, 0x5096ec0e
0,      36864,      36864,     2048,    36864, 0x1faddc6f
0,      38912,      38912,     2048,    36864, 0xa7cb41d5
0,      40960,      40960,     2048,    36864, 0xf45676b9
0,      43008,      43008,     2048,    36864, 0xf26a87a7
0,      45056,      45056,     2048,    36864, 0x8290b628
0,      47104,      47104,     2048,    36864, 0x00065519
0,      49152,      49152,     2048,    36864, 0x26302fd0
0,      51200,      51200,     2048,    36864, 0x0fc5652c
0,      53248,      53248,     2048,    36864, 0x80f992f5
0,      55296,      55296,     2048,    36864, 0x770d7bd3
0,      57344,      57344,     2048,    36864, 0xf06ff731
0,      59392,      59392,     2048,    36864, 0xf42f36a2
0,      61440,      61440,     2048,    36864, 0x40496db9
0,      63488,      63488,     2048,    36864, 0x88e3c586
0,      65536,      65536,     2048,    36864, 0x4027756f
0,      67584,      67584,     2048,    36864, 0x30e1e2af
0,      69632,      69632,     2048,    36864, 0x794f500e
0,      71680,      71680,     2048,    36864, 0x1388d154
0,      73728,      73728,     2048,    36864, 0x55fef3fa
0,      75776,      75776,     2048,    36864, 0x631de608
0,      77824,      77824,     2048,    36864, 0xa479ecfe
0,      79872,      79872,     2048,    36864, 0xe561fe79
0,      81920,      81920,     2048,    36864, 0x806ae121
0,      83968,      83968,     2048,    36864, 0xfa832f7d
0,      86016,      86016,     2048,    36864, 0x4ba72c89
0,      88064,      88064,     2048,    36864, 0xb107a5d9
0,      90112,      90112,     2048,    36864, 0x0871c610
0,      92160,      92160,     2048,    36864, 0xc74e0148
0,      94208,      94208,     2048,    36864, 0x1134ce2e
0,      96256,      96256,     2048,    36864, 0x4bf46961
0,      98304,      98304,     2048,    36864, 0xee4c58ea
0,     100352,     100352,     2048,    36864, 0x84cb078e


More information about the ffmpeg-devel mailing list