Re: [FFmpeg-devel] avcodec/hapqa_extract_bsf : add bsf filter for haqqa (to hapq or hapalpha only) conversion

2018-02-19 Thread Tom Butterworth
Hi Martin From 0002-avcodec-hapqa_extract_bsf-add-new-bsf-filter: > if (ctx->texture == 1) { > ... The ordering of sections in a Hap frame is not specified, so you can’t assume the first is the colour and the second alpha - you will have to query the section types for both sections and choose

Re: [FFmpeg-devel] libavcodec/hap : add HapAlphaOnly decoding/encoding

2017-10-16 Thread Tom Butterworth
>> Patches 0001, 0002, 0006 and 0007 LGTM and are uncontentious. As they are >> required for Hap Q Alpha support I will commit these shortly, assuming >> nobody objects. >> >> > Ok for that, so we can discuss in parallel about HAPQAlpha support (with > RGBA pix_fmt output this time ! :-) > I’v

Re: [FFmpeg-devel] libavcodec/hap : add HapAlphaOnly decoding/encoding

2017-10-10 Thread Tom Butterworth
> On 9 Oct 2017, at 22:36, Carl Eugen Hoyos wrote: > > 2017-10-09 21:34 GMT+02:00 Martin Vignali : > IMHO, from a compositing point of view, alpha only and gray is the same thing. It's common (in cgi compositing for example), to use alpha (or matte) as separate gray only fi

Re: [FFmpeg-devel] libavcodec/hapdec : add support for HapAphaOnly decoding

2017-09-28 Thread Tom Butterworth
On Wed, 27 Sep 2017 at 16:52 Carl Eugen Hoyos wrote: > 2017-09-27 15:20 GMT+02:00 Martin Vignali : > > 2017-09-27 13:25 GMT+02:00 Tom Butterworth : > > > >> > >> > >> > On 27 Sep 2017, at 11:59, Martin Vignali > >> wrote: > >> &g

Re: [FFmpeg-devel] libavcodec/hapdec : add support for HapAphaOnly decoding

2017-09-27 Thread Tom Butterworth
> On 27 Sep 2017, at 14:20, Martin Vignali wrote: > > 2017-09-27 13:25 GMT+02:00 Tom Butterworth <mailto:bangno...@gmail.com>>: > >> >> >>> On 27 Sep 2017, at 11:59, Martin Vignali >> wrote: >>> >>>> >>>&g

Re: [FFmpeg-devel] libavcodec/hapdec : add support for HapAphaOnly decoding

2017-09-27 Thread Tom Butterworth
> On 27 Sep 2017, at 11:59, Martin Vignali wrote: > >> >>> +ctx->tex_fun = ctx->dxtc.rgtc1u_block; >>> +avctx->pix_fmt = AV_PIX_FMT_RGB0; >> >> The rgtc1u_block function places the single channel value in every channel >> except the alpha channel >> The pixel format you have c

Re: [FFmpeg-devel] libavcodec/hapenc : add support for hap alpha only encoding

2017-09-27 Thread Tom Butterworth
Yo > Patch 1 : 0004-libavcodec-texturedspenc-add-rgtc1u-encoding > +/** > + * Compress one block of RGBA pixels in a RGTC1U texture and store the > + * resulting bytes in 'dst'. Alpha is preserved. > + * > + * @param dstoutput buffer. > + * @param stride scanline in bytes. > + * @param block

Re: [FFmpeg-devel] libavcodec/hapdec : add support for HapAphaOnly decoding

2017-09-27 Thread Tom Butterworth
Hey Martin > +ctx->tex_fun = ctx->dxtc.rgtc1u_block; > +avctx->pix_fmt = AV_PIX_FMT_RGB0; The rgtc1u_block function places the single channel value in every channel except the alpha channel The pixel format you have chosen is one which disregards the alpha channel The output of

[FFmpeg-devel] [PATCH] doc/encoders: add documentation for the Hap encoder

2016-11-10 Thread Tom Butterworth
Documents options and behaviour, noting when 'chunks' option will not be honoured. Signed-off-by: Tom Butterworth --- doc/encoders.texi | 39 +++ 1 file changed, 39 insertions(+) diff --git a/doc/encoders.texi b/doc/encoders.texi index ba60e0

Re: [FFmpeg-devel] [PATCH 2/2] avcodec/hap: add "compressor" option to Hap encoder to disable secondary compression

2016-11-09 Thread Tom Butterworth
Thanks Michael and Martin I'll push this and offer a new patch with documentation for the Hap encoder in doc/encoders.texi. On Wed, 9 Nov 2016 at 07:37 Martin Vignali wrote: > > > > > > Maybe can be useful, to have a log, > > > if chunk_count != 1 and compression is none, to show to the user, t

Re: [FFmpeg-devel] [PATCH 2/2] avcodec/hap: add "compressor" option to Hap encoder to disable secondary compression

2016-11-08 Thread Tom Butterworth
Thanks for your comments Martin - > > Adds "none" or "snappy" as options for "compressor". Selecting "none" > > disregards > > > "chunks" option: chunking is only of benefit decompressing Snappy. > > > --- > > > Maybe can be useful, to have a log, > if chunk_count != 1 and compression is none, to

Re: [FFmpeg-devel] [PATCH 1/2] avcodec/hap: pass texture-compression destination as argument, not in context

2016-11-08 Thread Tom Butterworth
thanks, pushed On Tue, 8 Nov 2016 at 14:14 Michael Niedermayer wrote: > On Tue, Nov 08, 2016 at 01:30:53PM +0000, Tom Butterworth wrote: > > This allows a subsequent change to compress directly into the output > packet when possible. > > --- > > libavcodec/hapenc.c

Re: [FFmpeg-devel] [PATCH 1/2] avcodec/hap: pass texture-compression destination as argument, not in context

2016-11-08 Thread Tom Butterworth
On Tue, 8 Nov 2016 at 12:44 Michael Niedermayer wrote: ... > > -static void compress_texture(AVCodecContext *avctx, const AVFrame *f) > > +static void compress_texture(AVCodecContext *avctx, uint8_t *out, const > AVFrame *f) > > passing an output array without array size into a function raises a

[FFmpeg-devel] [PATCH 2/2] avcodec/hap: add "compressor" option to Hap encoder to disable secondary compression

2016-11-08 Thread Tom Butterworth
The secondary compression in Hap is optional, this change exposes that option to the user as some use-cases favour higher bitrate files to reduce workload decoding. Adds "none" or "snappy" as options for "compressor". Selecting "none" disregards "chunks" option: chunking is only of benefit decompre

[FFmpeg-devel] [PATCH 1/2] avcodec/hap: pass texture-compression destination as argument, not in context

2016-11-08 Thread Tom Butterworth
This allows a subsequent change to compress directly into the output packet when possible. --- libavcodec/hapenc.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/libavcodec/hapenc.c b/libavcodec/hapenc.c index 076923b..79b6074 100644 --- a/libavcodec/hapenc.c +++

[FFmpeg-devel] [PATCH 2/2] avcodec/hap: add "compressor" option to Hap encoder to disable secondary compression

2016-11-07 Thread Tom Butterworth
The secondary compression in Hap is optional, this change exposes that option to the user as some use-cases favour higher bitrate files to reduce workload decoding. Adds "none" or "snappy" as options for "compressor". Selecting "none" disregards "chunks" option: chunking is only of benefit decompre

[FFmpeg-devel] [PATCH 1/2] avcodec/hap: pass texture-compression destination as argument, not in context

2016-11-07 Thread Tom Butterworth
This allows a subsequent change to compress directly into the output packet when possible. --- libavcodec/hapenc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libavcodec/hapenc.c b/libavcodec/hapenc.c index 076923b..7056b62 100644 --- a/libavcodec/hapenc.c +++ b/libav

[FFmpeg-devel] [PATCH] avcodec/hap: consistent name for codec

2016-11-04 Thread Tom Butterworth
"Vidvox Hap", not "Vidvox Hap encoder" or "Vidvox Hap decoder". Fixes bad name in fmmpeg -codecs, matches other codec naming. --- libavcodec/codec_desc.c | 2 +- libavcodec/hapdec.c | 2 +- libavcodec/hapenc.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcod

[FFmpeg-devel] [PATCH] Add myself as maintainer for Hap

2015-10-23 Thread Tom Butterworth
Niedermayer h264* Loren Merritt, Michael Niedermayer + hap* Tom Butterworth huffyuv* Michael Niedermayer, Christophe Gisquet idcinvideo.c Mike Melanson imc

Re: [FFmpeg-devel] [PATCH]lavc/hapdec: Correct colour spaces

2015-10-23 Thread Tom Butterworth
LGTM, thanks On 23 October 2015 at 08:30, Carl Eugen Hoyos wrote: > Hi! > > Attached patch fixes hap colour spaces as reminded by Tom Butterworth. > > Please comment, Carl Eugen > > ___ > ffmpeg-devel mailing list > ffm

Re: [FFmpeg-devel] [PATCH] avcodec/hap: set bits_per_coded_sample

2015-10-23 Thread Tom Butterworth
On 23 October 2015 at 08:32, Carl Eugen Hoyos wrote: > Tom Butterworth gmail.com> writes: > > > fixes issue where alpha is ignored in some players > > Your patch looks ok to me, RGB0 should be added as an > input colour space but this can be an independent patch. > &g

[FFmpeg-devel] [PATCH] avcodec/hap: set bits_per_coded_sample

2015-10-22 Thread Tom Butterworth
fixes issue where alpha is ignored in some players --- libavcodec/hapenc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/hapenc.c b/libavcodec/hapenc.c index 7daadce..cb5dcfa 100644 --- a/libavcodec/hapenc.c +++ b/libavcodec/hapenc.c @@ -242,16 +242,19 @@ static av_cold int hap

[FFmpeg-devel] [PATCH 2/2] avcodec/hap: (trivial) rename enum values and document their meaning

2015-07-23 Thread Tom Butterworth
--- libavcodec/hapenc.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/libavcodec/hapenc.c b/libavcodec/hapenc.c index 8261fe9..39c1c5a 100644 --- a/libavcodec/hapenc.c +++ b/libavcodec/hapenc.c @@ -46,8 +46,10 @@ #define HAP_MAX_CHUNKS 64 enum H

[FFmpeg-devel] [PATCH 1/2] avcodec/hap: (trivial) clarify comment

2015-07-23 Thread Tom Butterworth
--- libavcodec/hapenc.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavcodec/hapenc.c b/libavcodec/hapenc.c index 174fba1..8261fe9 100644 --- a/libavcodec/hapenc.c +++ b/libavcodec/hapenc.c @@ -133,8 +133,10 @@ static int hap_compress_frame(AVCodecContext *avctx, u

Re: [FFmpeg-devel] [PATCH 2/2] avcodec/dds: fix for missing pixels at the bottom of frames

2015-07-22 Thread Tom Butterworth
This is broken for some numbers of threads, sorry - I'll follow up with a revision > as with the hap patch, doesnt this result in possibly significantly > larger last slice (which could cause the thread executing that to > take much longer then the other threads thus slowing things down > compared

Re: [FFmpeg-devel] [PATCH 1/2] avcodec/hap: fix for missing pixels at the bottom of frames

2015-07-22 Thread Tom Butterworth
This is broken for some numbers of threads, sorry - I'll follow up with a revision ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

[FFmpeg-devel] [PATCH 2/2] avcodec/dds: fix for missing pixels at the bottom of frames

2015-07-22 Thread Tom Butterworth
A bug was introduced in 6b2b26e7af3ede0abfb46eb5725c26d1083f50bc whereby when frame height wasn't divisible by the number of threads, pixels would be omitted from the bottom rows during decode. --- libavcodec/dds.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git

[FFmpeg-devel] [PATCH 1/2] avcodec/hap: fix for missing pixels at the bottom of frames

2015-07-22 Thread Tom Butterworth
A bug was introduced in 977105407cae55876041dddbf4ce0934cdd4cd6c whereby when frame height wasn't divisible by the number of threads, pixels would be omitted from the bottom rows during decode. --- libavcodec/hap.h| 1 + libavcodec/hapdec.c | 17 +++-- 2 files changed, 12 insertio

[FFmpeg-devel] [PATCH 2/4] avcodec/hapdec: don't log texture format every frame, do it once per decode session

2015-07-20 Thread Tom Butterworth
--- libavcodec/hapdec.c | 27 --- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/libavcodec/hapdec.c b/libavcodec/hapdec.c index 7eff9e0..f55d4b7 100644 --- a/libavcodec/hapdec.c +++ b/libavcodec/hapdec.c @@ -74,7 +74,6 @@ static int setup_texture(AVCodecCon

[FFmpeg-devel] [PATCH 1/4] libavcodec/hap: Name enums, remove unused struct member

2015-07-20 Thread Tom Butterworth
--- libavcodec/hap.h | 25 - 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/libavcodec/hap.h b/libavcodec/hap.h index bd0fd37..f36d09a 100644 --- a/libavcodec/hap.h +++ b/libavcodec/hap.h @@ -29,12 +29,23 @@ #include "bytestream.h" #include "texturedsp.h"

[FFmpeg-devel] [PATCH 4/4] Support the Hap chunked frame format

2015-07-20 Thread Tom Butterworth
Hap utility functions + * Copyright (C) 2015 Tom Butterworth + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either

[FFmpeg-devel] [PATCH 3/4] avcodec/hapdec: log reason for failure when texture type doesn't match stream

2015-07-20 Thread Tom Butterworth
--- libavcodec/hapdec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/hapdec.c b/libavcodec/hapdec.c index f55d4b7..8e90904 100644 --- a/libavcodec/hapdec.c +++ b/libavcodec/hapdec.c @@ -79,8 +79,10 @@ static int setup_texture(AVCodecContext *avctx, size_t leng

Re: [FFmpeg-devel] [PATCH 3/3] avcodec/hap: Support chunked Hap frames

2015-07-20 Thread Tom Butterworth
Thanks Michael, new patch set to replace this patch incoming. On 17 July 2015 at 20:13, Michael Niedermayer wrote: > On Thu, Jul 16, 2015 at 01:23:23PM +0100, Tom Butterworth wrote: >> --- >> libavcodec/Makefile | 4 +- >> libavcodec/hap.c | 51 +

Re: [FFmpeg-devel] [PATCH 3/3] avcodec/hap: Support chunked Hap frames

2015-07-16 Thread Tom Butterworth
The sample for fate test added in this commit is at http://files.kriss.cx/hapy-12-chunks.mov On 16 July 2015 at 13:23, Tom Butterworth wrote: > --- > libavcodec/Makefile | 4 +- > libavcodec/hap.c | 51 + > libavcodec/hap.h | 68 &

[FFmpeg-devel] [PATCH 3/3] avcodec/hap: Support chunked Hap frames

2015-07-16 Thread Tom Butterworth
@@ +/* + * Vidvox Hap utility functions + * Copyright (C) 2015 Tom Butterworth + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either

[FFmpeg-devel] [PATCH 2/3] avcodec/snappy: refactor so ff_snappy_uncompress uses an existing buffer

2015-07-16 Thread Tom Butterworth
Some uses of Snappy require uncompressing to positions within an existing buffer. Also adds a function to get the uncompressed length of Snappy data. --- libavcodec/hapdec.c | 7 ++- libavcodec/snappy.c | 24 +--- libavcodec/snappy.h | 19 ++- 3 files chan

[FFmpeg-devel] [PATCH 1/3] avcodec/hap: move some per-stream setup into decoder init rather than per-frame

2015-07-16 Thread Tom Butterworth
This change will reject frames with a texture type which doesn't match the stream description. --- libavcodec/hapdec.c | 27 +-- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/libavcodec/hapdec.c b/libavcodec/hapdec.c index e6b7d61..5986a3f 100644 --- a/lib

[FFmpeg-devel] [PATCH] libavcodec/pthread_slice: for large job counts, avoid lock/unlock between jobs on the same thread

2015-07-13 Thread Tom Butterworth
Currently for large job counts, pthread_slice.c acquires and releases a lock between each job. Acquiring the locks can take more time than the job itself. The DDS and Hap decoders naively create a job per 4x4 pixel block. For a 4Kx2K frame: decode before patch: 1562ms decode after patch:

Re: [FFmpeg-devel] [libav-devel] shared api for exposing a texture

2015-05-18 Thread Tom Butterworth
Hi all I have coincidentally been working on Hap support for libavcodec as well. There are a couple of formats that are based on texture compression, > usually called DXTn or BCn, and described here: > http://en.wikipedia.org/wiki/S3_Texture_Compression. Currently in > libavcodec only txd uses th

[FFmpeg-devel] [PATCH] avcodec/s3tc: fix alpha decoding when dimensions are not a multiple of 4

2015-05-07 Thread Tom Butterworth
Fix alpha position error for edge blocks of odd-dimensioned frames --- libavcodec/s3tc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/s3tc.c b/libavcodec/s3tc.c index 9886b1d..a422874 100644 --- a/libavcodec/s3tc.c +++ b/libavcodec/s3tc.c @@ -71,8 +71,10 @@ sta

Re: [FFmpeg-devel] [PATCH] avcodec/s3tc: fix decoding when dimensions are not a multiple of 4

2015-05-07 Thread Tom Butterworth
:09, Michael Niedermayer wrote: > > On Thu, May 07, 2015 at 03:37:46PM +0000, Tom Butterworth wrote: > > I took variables bx and by to be shorthand for block x and block y, so I > > renamed them because they now refer to pixel and not block positions - > > would you rather they rema

Re: [FFmpeg-devel] [PATCH] avcodec/s3tc: fix decoding when dimensions are not a multiple of 4

2015-05-07 Thread Tom Butterworth
:30 PM Michael Niedermayer wrote: > On Thu, May 07, 2015 at 04:17:10PM +0100, Tom Butterworth wrote: > > Image dimensions were rounded down causing rows to wrap early if > dimensions were not a multiple of 4. > > --- > > libavcodec/s3tc.c | 23 +--

[FFmpeg-devel] [PATCH] avcodec/s3tc: fix decoding when dimensions are not a multiple of 4

2015-05-07 Thread Tom Butterworth
Image dimensions were rounded down causing rows to wrap early if dimensions were not a multiple of 4. --- libavcodec/s3tc.c | 23 +-- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/libavcodec/s3tc.c b/libavcodec/s3tc.c index 4743d78..9886b1d 100644 --- a/libav