Re: [libav-devel] [PATCH] Introduce a TextureDSP module

2015-06-07 Thread Vittorio Giovara
On Sat, Jun 6, 2015 at 4:27 AM, James Almer wrote: > On 02/06/15 8:09 AM, Vittorio Giovara wrote: >> +/* Alpha compression function */ >> +static void compress_alpha(uint8_t *dst, ptrdiff_t stride, const uint8_t >> *block) >> +{ >> +int i, j; >> +int dist, bias, dist4, dist2, bits, mask;

Re: [libav-devel] [PATCH] Introduce a TextureDSP module

2015-06-05 Thread James Almer
On 02/06/15 8:09 AM, Vittorio Giovara wrote: > +/* Alpha compression function */ > +static void compress_alpha(uint8_t *dst, ptrdiff_t stride, const uint8_t > *block) > +{ > +int i, j; > +int dist, bias, dist4, dist2, bits, mask; > +int mn, mx; > + > +/* Find min/max color */ > +

[libav-devel] [PATCH] Introduce a TextureDSP module

2015-06-02 Thread Vittorio Giovara
This module implements generic texture decompression from different families (DXTC, RGTC, BCn) and texture compression DXTC 1, 3, and 5. Signed-off-by: Vittorio Giovara --- Updated with Justin's and James' comments (thanks). Vittorio configure | 2 + libavcodec/Makefile

Re: [libav-devel] [PATCH] Introduce a TextureDSP module

2015-06-01 Thread James Almer
On 31/05/15 8:41 AM, Vittorio Giovara wrote: > +/* Solve */ > +max16 = av_clip((at1_r * yy - at2_r * xy) * frb + 0.5f, 0, 31) << > 11; > +max16 |= av_clip((at1_g * yy - at2_g * xy) * fg + 0.5f, 0, 63) << 5; > +max16 |= av_clip((at1_b * yy - at2_b * xy) * frb + 0.5

Re: [libav-devel] [PATCH] Introduce a TextureDSP module

2015-06-01 Thread Justin Ruggles
On 05/31/2015 07:41 AM, Vittorio Giovara wrote: +/** Convert a premultiplied alpha pixel to a straigth alpha pixel. */ +static av_always_inline void premult2straight(uint8_t *src) +{ +int r = src[0]; +int g = src[1]; +int b = src[2]; +int a = src[3]; + +src[0] = (uint8_t) r *

[libav-devel] [PATCH] Introduce a TextureDSP module

2015-05-31 Thread Vittorio Giovara
This module implements generic texture decompression from different families (DXTC, RGTC, BCn) and texture compression DXTC 1, 3, and 5. Signed-off-by: Vittorio Giovara --- configure | 2 + libavcodec/Makefile| 3 + libavcodec/texturedsp.c| 615 ++