Re: [libav-devel] [PATCH] Canopus HQ/HQA decoder

2015-03-30 Thread Vittorio Giovara
On Fri, Mar 27, 2015 at 9:07 PM, Diego Biurrun wrote: > On Fri, Mar 27, 2015 at 01:20:48PM +0100, Luca Barbato wrote: >> On 27/03/15 11:17, Diego Biurrun wrote: >> >> > regexp-replace is your friend. >> >> s:^\( *\)\(.,\) :\1 \2: >> >> assuming 2 digits. > > Simple regexp replacements with one's f

Re: [libav-devel] [PATCH] Canopus HQ/HQA decoder

2015-03-27 Thread Diego Biurrun
On Fri, Mar 27, 2015 at 01:20:48PM +0100, Luca Barbato wrote: > On 27/03/15 11:17, Diego Biurrun wrote: > > > regexp-replace is your friend. > > s:^\( *\)\(.,\) :\1 \2: > > assuming 2 digits. Simple regexp replacements with one's favorite editor are not common knowledge anymore? IMO simpler:

Re: [libav-devel] [PATCH] Canopus HQ/HQA decoder

2015-03-27 Thread Luca Barbato
On 27/03/15 11:17, Diego Biurrun wrote: > regexp-replace is your friend. s:^\( *\)\(.,\) :\1 \2: assuming 2 digits. ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH] Canopus HQ/HQA decoder

2015-03-27 Thread Diego Biurrun
On Thu, Mar 26, 2015 at 07:19:08PM +, Vittorio Giovara wrote: > On Thu, Mar 26, 2015 at 2:27 PM, Diego Biurrun wrote: > > On Sun, Mar 22, 2015 at 03:49:50PM +, Vittorio Giovara wrote: > >> --- /dev/null > >> +++ b/libavcodec/hqdata.c > >> @@ -0,0 +1,8374 @@ > >> +247, -247, 248, -248,

Re: [libav-devel] [PATCH] Canopus HQ/HQA decoder

2015-03-26 Thread Vittorio Giovara
On Thu, Mar 26, 2015 at 2:27 PM, Diego Biurrun wrote: > On Sun, Mar 22, 2015 at 03:49:50PM +, Vittorio Giovara wrote: >> +#include "libavutil/imgutils.h" >> +#include "libavutil/intreadwrite.h" >> + >> +#include "avcodec.h" >> +#include "internal.h" >> + >> +#include "hq_hqa.h" >> + >> +// AAN

Re: [libav-devel] [PATCH] Canopus HQ/HQA decoder

2015-03-26 Thread Vittorio Giovara
On Tue, Mar 24, 2015 at 8:08 PM, James Almer wrote: > On 22/03/15 12:49 PM, Vittorio Giovara wrote: >> +// AAN IDCT > > If this isn't already in the tree somewhere and it's generic enough that it > can be reused, > then it should be shared like faanidct and added to idctdsp. it's not, I'll add a

Re: [libav-devel] [PATCH] Canopus HQ/HQA decoder

2015-03-26 Thread Diego Biurrun
On Sun, Mar 22, 2015 at 03:49:50PM +, Vittorio Giovara wrote: > --- /dev/null > +++ b/libavcodec/hq_hqa.c > @@ -0,0 +1,454 @@ > + > +#include It seems you only need stdint.h. > +#include "libavutil/imgutils.h" > +#include "libavutil/intreadwrite.h" > + > +#include "avcodec.h" > +#include "in

Re: [libav-devel] [PATCH] Canopus HQ/HQA decoder

2015-03-24 Thread Martin Storsjö
On Tue, 24 Mar 2015, Derek Buitenhuis wrote: On 3/24/2015 6:53 PM, Luca Barbato wrote: No, it is exactly to keep the structure packed a little as I explained to Vittorio privately. So, micro-optimizations / ricing? For some cases, it does matter. I don't agree it matters in any significant

Re: [libav-devel] [PATCH] Canopus HQ/HQA decoder

2015-03-24 Thread Tristan Matthews
On Tue, Mar 24, 2015 at 4:09 PM, Tristan Matthews wrote: > On Tue, Mar 24, 2015 at 3:03 PM, Derek Buitenhuis > wrote: >> On 3/24/2015 6:53 PM, Luca Barbato wrote: >>> No, it is exactly to keep the structure packed a little as I explained >>> to Vittorio privately. >> >> So, micro-optimizations /

Re: [libav-devel] [PATCH] Canopus HQ/HQA decoder

2015-03-24 Thread Tristan Matthews
On Tue, Mar 24, 2015 at 3:03 PM, Derek Buitenhuis wrote: > On 3/24/2015 6:53 PM, Luca Barbato wrote: >> No, it is exactly to keep the structure packed a little as I explained >> to Vittorio privately. > > So, micro-optimizations / ricing? > >> Diego (Flameeyes) explained in a number of blogpost wh

Re: [libav-devel] [PATCH] Canopus HQ/HQA decoder

2015-03-24 Thread James Almer
On 22/03/15 12:49 PM, Vittorio Giovara wrote: > +// AAN IDCT If this isn't already in the tree somewhere and it's generic enough that it can be reused, then it should be shared like faanidct and added to idctdsp. And if it's HQ/HQA specific, it still could be split into a new hqdsp context for

Re: [libav-devel] [PATCH] Canopus HQ/HQA decoder

2015-03-24 Thread Derek Buitenhuis
On 3/24/2015 6:53 PM, Luca Barbato wrote: > No, it is exactly to keep the structure packed a little as I explained > to Vittorio privately. So, micro-optimizations / ricing? > Diego (Flameeyes) explained in a number of blogpost why it is useful, > sadly pahole is not available for mac. I can't m

Re: [libav-devel] [PATCH] Canopus HQ/HQA decoder

2015-03-24 Thread Luca Barbato
On 24/03/15 19:37, Derek Buitenhuis wrote: > On 3/24/2015 6:10 PM, Tristan Matthews wrote: Pointers first, int after please. >> Can you explain this in more details please? >> I think he means for packing, see: http://www.catb.org/esr/structure-packing/ > > It's actually for the

Re: [libav-devel] [PATCH] Canopus HQ/HQA decoder

2015-03-24 Thread Derek Buitenhuis
On 3/24/2015 6:10 PM, Tristan Matthews wrote: >>> Pointers first, int after please. >>> >> >> > >> > Can you explain this in more details please? > I think he means for packing, see: http://www.catb.org/esr/structure-packing/ It's actually for the far sillier reason: useless cosmetics. - Derek __

Re: [libav-devel] [PATCH] Canopus HQ/HQA decoder

2015-03-24 Thread Tristan Matthews
On Mon, Mar 23, 2015 at 8:40 AM, Vittorio Giovara wrote: > On Sun, Mar 22, 2015 at 7:36 PM, Luca Barbato wrote: >>> +typedef struct HQContext { >>> +AVCodecContext *avctx; >>> + >>> +VLC hq_ac_vlc; >>> +VLC hqa_cbp_vlc; >>> +DECLARE_ALIGNED(16, int16_t, block)[12][64]; >>> +} HQCo

Re: [libav-devel] [PATCH] Canopus HQ/HQA decoder

2015-03-23 Thread Vittorio Giovara
On Sun, Mar 22, 2015 at 7:36 PM, Luca Barbato wrote: >> +typedef struct HQContext { >> +AVCodecContext *avctx; >> + >> +VLC hq_ac_vlc; >> +VLC hqa_cbp_vlc; >> +DECLARE_ALIGNED(16, int16_t, block)[12][64]; >> +} HQContext; >> + >> +typedef struct HQProfile { >> +int width, heigh

Re: [libav-devel] [PATCH] Canopus HQ/HQA decoder

2015-03-22 Thread Luca Barbato
Some quick review. +static int hq_decode_block(HQContext *c, GetBitContext *gb, int16_t block[64], + int qsel, int is_chroma, int is_hqa) +{ +const int32_t *q; +int val, pos = 1; + +memset(block, 0, 64 * sizeof(*block)); + +if (!is_hqa) { +block