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

James Almer jamrial at gmail.com
Sat May 21 01:51:53 CEST 2016


On 5/20/2016 8:28 PM, foo86 wrote:
> 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).

"ffmpeg -i q4G.dts -c:a copy -f framecrc -" gave me the following
before the patch

#software: Lavf57.36.100
#tb 0: 1/90000
#media_type 0: audio
#codec_id 0: dts
#sample_rate 0: 192000
#channel_layout 0: 60f
0,          0,          0,      960,    15520, 0x4e922c28
0,        960,        960,      960,    15620, 0x0aa208ee
0,       1920,       1920,      960,    15604, 0x5ff63a0b
0,       2880,       2880,      960,    15516, 0xeeabf0c9
0,       3840,       3840,      960,    15476, 0x53f46290
0,       4800,       4800,      960,    15348, 0x477e8987
0,       5760,       5760,      960,    15252, 0x2b20725b
0,       6720,       6720,      960,    15304, 0x9d60b356
0,       7680,       7680,      960,    15172, 0x19e359e4
0,       8640,       8640,      960,    15092, 0x1dc6f776
0,       9600,       9600,      960,    15064, 0xc2385e65
0,      10560,      10560,      960,    15048, 0x50d75a33
0,      11520,      11520,      960,    15132, 0x3eb47e67
0,      12480,      12480,      960,    15188, 0x6f16aad6
0,      13440,      13440,      960,    15360, 0xc481d7c6
0,      14400,      14400,      960,    15508, 0x2da8a9f4
0,      15360,      15360,      960,    15380, 0x036fe8c8
0,      16320,      16320,      960,    15372, 0xa815aa65
0,      17280,      17280,      960,    15352, 0xc9f7b3db
0,      18240,      18240,      960,    15288, 0x62a15e11
0,      19200,      19200,      960,    12746, 0x44ee1fa5
0,      20160,      20160,     1920,     2530, 0xf4a2af4c
0,      22080,      22080,      960,    15244, 0xa8948fa5
0,      23040,      23040,      960,    15264, 0x47539652
0,      24000,      24000,      960,    15300, 0x10adf509
0,      24960,      24960,      960,    15356, 0x3403a586
0,      25920,      25920,      960,    15436, 0xcbea18b7
0,      26880,      26880,      960,    15424, 0x2ce91378
0,      27840,      27840,      960,    15524, 0xf3ba523c
0,      28800,      28800,      960,    15544, 0xa1504354
0,      29760,      29760,      960,    15528, 0x6bc826fd
0,      30720,      30720,      960,    15492, 0x4f89f07a
0,      31680,      31680,      960,    15456, 0x002c4ac0
0,      32640,      32640,      960,    15388, 0x78c854be
0,      33600,      33600,      960,    15372, 0xce9954e5
0,      34560,      34560,      960,    15268, 0x1c5bceda
0,      35520,      35520,      960,    15288, 0x60acfb3d
0,      36480,      36480,      960,    15240, 0xb42d7f7b
0,      37440,      37440,      960,    15316, 0xd6080d5a
0,      38400,      38400,      960,    15368, 0xc2b65528
0,      39360,      39360,      960,    15476, 0xa01f2806
0,      40320,      40320,      960,    15448, 0x2e0121ef
0,      41280,      41280,      960,    15384, 0x891dd887
0,      42240,      42240,      960,    15384, 0x31cea7b0
0,      43200,      43200,      960,    15316, 0xaa040ae8
0,      44160,      44160,      960,    15356, 0xa13cfd43
0,      45120,      45120,      960,    15388, 0xf6a81182
0,      46080,      46080,      960,    15324, 0x72e4de3f
0,      47040,      47040,      960,    15252, 0x5d84b107
0,      48000,      48000,      960,    15216, 0xe9656c9b
0,      48960,      48960,      960,    15232, 0x6930b4a3

But you're right that it was also failing during decoding. Not sure how
i missed or why i thought the framecrc output was the same. So nevermind
my previous comment.



More information about the ffmpeg-devel mailing list