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 jamr...@gmail.com 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,

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 */ +mn = mx

[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 vittorio.giov...@gmail.com --- Updated with Justin's and James' comments (thanks). Vittorio configure | 2 +

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 vittorio.giov...@gmail.com --- configure | 2 + libavcodec/Makefile| 3 + libavcodec/texturedsp.c