Re: [FFmpeg-devel] [PATCH v3 2/2] Newtek SpeedHQ decoder.

2017-01-09 Thread Steinar H. Gunderson
On Mon, Jan 09, 2017 at 09:44:42PM +0100, Michael Niedermayer wrote: > anything that works and is thread safe is fine with me > pick what you prefer from what people like I did the ff_thread_once() variant. v4 coming up. Fuzzing has been running for 22 hours now with no results at all (2.5B execs

Re: [FFmpeg-devel] [PATCH v3 2/2] Newtek SpeedHQ decoder.

2017-01-09 Thread Michael Niedermayer
On Mon, Jan 09, 2017 at 08:21:25PM +0100, Steinar H. Gunderson wrote: > On Mon, Jan 09, 2017 at 08:17:18PM +0100, Michael Niedermayer wrote: > >> +/* Reverse the AC VLC, because INIT_VLC_LE wants it in that > >> order. */ > >> +for (i = 0; i < FF_ARRAY_ELEMS(speedhq_vlc); ++i) { >

Re: [FFmpeg-devel] [PATCH v3 2/2] Newtek SpeedHQ decoder.

2017-01-09 Thread Kieran Kunhya
On Mon, 9 Jan 2017 at 19:21 Steinar H. Gunderson < steinar+ffm...@gunderson.no> wrote: > On Mon, Jan 09, 2017 at 08:17:18PM +0100, Michael Niedermayer wrote: > >> +/* Reverse the AC VLC, because INIT_VLC_LE wants it in that > order. */ > >> +for (i = 0; i < FF_ARRAY_ELEMS(speedhq_v

Re: [FFmpeg-devel] [PATCH v3 2/2] Newtek SpeedHQ decoder.

2017-01-09 Thread Steinar H. Gunderson
On Mon, Jan 09, 2017 at 08:17:18PM +0100, Michael Niedermayer wrote: >> +/* Reverse the AC VLC, because INIT_VLC_LE wants it in that order. >> */ >> +for (i = 0; i < FF_ARRAY_ELEMS(speedhq_vlc); ++i) { >> +speedhq_vlc[i][0] = reverse(speedhq_vlc[i][0], >> speedhq_vlc[i

Re: [FFmpeg-devel] [PATCH v3 2/2] Newtek SpeedHQ decoder.

2017-01-09 Thread Michael Niedermayer
On Sun, Jan 08, 2017 at 12:07:09PM +0100, Steinar H. Gunderson wrote: > This decoder can decode all existing SpeedHQ formats (SHQ0–5, 7, and 9), > including correct decoding of the alpha channel. > > 1080p is decoded in 142 fps on one core of my i7-4600U (2.1 GHz Haswell), > about evenly split bet

Re: [FFmpeg-devel] [PATCH v3 2/2] Newtek SpeedHQ decoder.

2017-01-09 Thread Steinar H. Gunderson
On Mon, Jan 09, 2017 at 06:47:12PM +0100, Paul B Mahol wrote: > If get_vlc2 fails, and return negative number and this does not cause crash > than patch LGTM. There's no crash no matter what decode_dc_le() returns, just a bogus DC coefficient. /* Steinar */ -- Homepage: https://www.sesse.net/ __

Re: [FFmpeg-devel] [PATCH v3 2/2] Newtek SpeedHQ decoder.

2017-01-09 Thread Paul B Mahol
On 1/9/17, Steinar H. Gunderson wrote: > On Mon, Jan 09, 2017 at 06:30:52PM +0100, Paul B Mahol wrote: >>> +/* AC codes: Very similar but not identical to MPEG-2. */ >>> +static uint16_t speedhq_vlc[123][2] = { >> Can this be uint8_t too? > > No, it goes into an RLTable, which expects an uint16_t*

Re: [FFmpeg-devel] [PATCH v3 2/2] Newtek SpeedHQ decoder.

2017-01-09 Thread Steinar H. Gunderson
On Mon, Jan 09, 2017 at 06:30:52PM +0100, Paul B Mahol wrote: >> +/* AC codes: Very similar but not identical to MPEG-2. */ >> +static uint16_t speedhq_vlc[123][2] = { > Can this be uint8_t too? No, it goes into an RLTable, which expects an uint16_t*. Besides, after bit-reversing, several elements

Re: [FFmpeg-devel] [PATCH v3 2/2] Newtek SpeedHQ decoder.

2017-01-09 Thread Paul B Mahol
On 1/8/17, Steinar H. Gunderson wrote: > + * for the longest (10-bit) codes. > + */ > +#define ALPHA_VLC_BITS 5 > + > +typedef struct SHQContext { > +AVCodecContext *avctx; > +BlockDSPContext bdsp; > +IDCTDSPContext idsp; > +ScanTable intra_scantable; > +int quant_matrix[64]; >

[FFmpeg-devel] [PATCH v3 2/2] Newtek SpeedHQ decoder.

2017-01-08 Thread Steinar H. Gunderson
This decoder can decode all existing SpeedHQ formats (SHQ0–5, 7, and 9), including correct decoding of the alpha channel. 1080p is decoded in 142 fps on one core of my i7-4600U (2.1 GHz Haswell), about evenly split between bitstream reader and IDCT. There is currently no attempt at slice or frame