[FFmpeg-devel] [PATCH] apng: Support inter-frame compression

2015-08-19 Thread Donny Yang
The current algorithm is just try all the combinations, and pick the best. It's not very fast either, probably due to a lot of copying, but will do for an initial implementation. Signed-off-by: Donny Yang w...@kota.moe --- libavcodec/pngenc.c | 420

[FFmpeg-devel] [PATCH] apng: Support inter-frame compression

2015-08-19 Thread Donny Yang
The current algorithm is just try all the combinations, and pick the best. It's not very fast either, probably due to a lot of copying, but will do for an initial implementation. Signed-off-by: Donny Yang w...@kota.moe --- libavcodec/pngenc.c | 420

[FFmpeg-devel] [PATCH] apng: Fix typos in decoder causing incorrect results

2015-07-19 Thread Donny Yang
Signed-off-by: Donny Yang w...@kota.moe --- libavcodec/pngdec.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index eae778b..cb1cebb 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -856,13 +856,13 @@ static

[FFmpeg-devel] [PATCH] apng: Fix typos in decoder causing incorrect results

2015-07-18 Thread Donny Yang
Signed-off-by: Donny Yang w...@kota.moe --- libavcodec/pngdec.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index eae778b..7a5c464 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -856,13 +856,13 @@ static

[FFmpeg-devel] [PATCH] apng: Support inter-frame compression

2015-07-18 Thread Donny Yang
The current algorithm is just try all the combinations, and pick the best. It's not very fast either, probably due to a lot of copying, but will do for an initial implementation. Signed-off-by: Donny Yang w...@kota.moe --- libavcodec/pngenc.c | 420

[FFmpeg-devel] [PATCH] apng: Fix decoding images with the PREVIOUS dispose op

2015-07-18 Thread Donny Yang
--- libavcodec/pngdec.c | 47 +++ 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 60c4975..eae778b 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -643,6 +643,11 @@ static int

Re: [FFmpeg-devel] Need help with threading issue (possible deadlock?)

2015-07-13 Thread Donny Yang
On 13 July 2015 at 20:50, Ronald S. Bultje rsbul...@gmail.com wrote: Hi, On Mon, Jul 13, 2015 at 4:26 AM, Donny Yang w...@kota.moe wrote: Hello I'm trying to fix ffmpeg's APNG decoding for images with the PREVIOUS dispose op while trying to keep it multithreaded, but it seems

[FFmpeg-devel] [PATCH 1/2] apng: Support inter-frame compression

2015-07-13 Thread Donny Yang
The current algorithm is just try all the combinations, and pick the best. It's not very fast either, probably due to a lot of copying, but will do for an initial implementation. --- libavcodec/pngenc.c | 423 +++- 1 file changed, 387 insertions(+),

[FFmpeg-devel] [PATCH 2/2] apng: Fix wrong default final frame delay in muxer

2015-07-13 Thread Donny Yang
--- libavformat/apngenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/apngenc.c b/libavformat/apngenc.c index dcf6b90..9b2c634 100644 --- a/libavformat/apngenc.c +++ b/libavformat/apngenc.c @@ -173,7 +173,7 @@ static void flush_packet(AVFormatContext

[FFmpeg-devel] Need help with threading issue (possible deadlock?)

2015-07-13 Thread Donny Yang
just disable threading? PS. I already asked my GSoC mentor about this and he said to disable threading, but I submitted a patch a while ago to disable threading and another dev was against that. From f801fd3934f83d0bc0edf389a50967207c6be168 Mon Sep 17 00:00:00 2001 From: Donny Yang w...@kota.moe

[FFmpeg-devel] [PATCH 3/6] avcodec/apng: Dispose previous frame properly

2015-06-07 Thread Donny Yang
should be disposed This patch fixes ffmpeg's behaviour to match those of the spec, which involved a rewrite of the blending function Signed-off-by: Donny Yang w...@kota.moe --- libavcodec/pngdec.c | 179 +++- 1 file changed, 92 insertions(+), 87

Re: [FFmpeg-devel] [PATCH 1/6] avcodec/apng: Remove threading support

2015-06-07 Thread Donny Yang
Fixed so threading isn't removed completely. Sorry this took so long. Took too long to figure out that decode_ihdr_chunk() was being called in each thread and thus overwriting the cur_w/h value set by update_thread_context(). (Remove threading support patch can be ignored now)

[FFmpeg-devel] avcodec/apng: Dispose previous frame properly

2015-06-02 Thread Donny Yang
[PATCH 1/2] avcodec/apng: Remove threading support [PATCH 2/2] avcodec/apng: Dispose previous frame properly Patches have been tested against: - https://people.mozilla.org/~dolske/apng/ - http://littlesvr.ca/apng/images/clock.png -

[FFmpeg-devel] [PATCH 1/2] avcodec/apng: Remove threading support

2015-06-02 Thread Donny Yang
Each frame depends on the previous frame any way, and it will cause bugs with frame disposal Signed-off-by: Donny Yang w...@kota.moe --- libavcodec/pngdec.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 2512799

[FFmpeg-devel] [PATCH 2/2] avcodec/apng: Dispose previous frame properly

2015-06-02 Thread Donny Yang
for blending AV_PIX_FMT_PAL8 with alpha Signed-off-by: Donny Yang w...@kota.moe --- libavcodec/pngdec.c | 203 +--- 1 file changed, 113 insertions(+), 90 deletions(-) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 2ea3e8b..4063347

[FFmpeg-devel] [PATCH 5/6] avcodec/apng: Add support for blending with GRAY8A pixel format

2015-06-02 Thread Donny Yang
Signed-off-by: Donny Yang w...@kota.moe --- libavcodec/pngdec.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 1f5c433..1667530 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -891,7 +891,8 @@ static int

[FFmpeg-devel] [PATCH 6/6] avcodec/apng: Add partial support for blending with PAL8 pixel format

2015-06-02 Thread Donny Yang
Currently restricted to blending pixels that only contain either 0 or 255 in their alpha components Signed-off-by: Donny Yang w...@kota.moe --- libavcodec/pngdec.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index

[FFmpeg-devel] [PATCH 1/6] avcodec/apng: Remove threading support

2015-06-02 Thread Donny Yang
Each frame depends on the previous frame any way, and it will cause bugs with frame disposal Signed-off-by: Donny Yang w...@kota.moe --- libavcodec/pngdec.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 2512799

[FFmpeg-devel] [PATCH 4/6] avcodec/apng: Add blending support for non-alpha pixel formats

2015-06-02 Thread Donny Yang
Signed-off-by: Donny Yang w...@kota.moe --- libavcodec/pngdec.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 90bf725..1f5c433 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -58,6 +58,7 @@ typedef struct

[FFmpeg-devel] avcodec/apng: Fix and add features to blending support

2015-06-02 Thread Donny Yang
This time with bug fixes and feature additions properly separated [PATCH 1/6] avcodec/apng: Remove threading support [PATCH 2/6] avcodec/apng: Remove blending support for AV_PIX_FMT_ARGB [PATCH 3/6] avcodec/apng: Dispose previous frame properly [PATCH 4/6] avcodec/apng: Add blending support for

[FFmpeg-devel] [PATCH 2/6] avcodec/apng: Remove blending support for AV_PIX_FMT_ARGB

2015-06-02 Thread Donny Yang
ARGB is not a supported PNG pixel format Signed-off-by: Donny Yang w...@kota.moe --- libavcodec/pngdec.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 2ea3e8b..5571d20 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec

[FFmpeg-devel] [PATCH 3/6] avcodec/apng: Dispose previous frame properly

2015-06-02 Thread Donny Yang
should be disposed This patch fixes ffmpeg's behaviour to match those of the spec, which involved a rewrite of the blending function Signed-off-by: Donny Yang w...@kota.moe --- libavcodec/pngdec.c | 166 +--- 1 file changed, 80 insertions(+), 86

Re: [FFmpeg-devel] [PATCH]Allow easy png streamcopying

2015-04-23 Thread Donny Yang
On 23 April 2015 at 23:38, Nicolas George geo...@nsup.org wrote: Le quartidi 4 floréal, an CCXXIII, Michael Niedermayer a écrit : without really thinking about it, the idea to remove the extension for apng or change it to .apng, seems like a good idea It looks like it is an officially

Re: [FFmpeg-devel] [PATCH 3/3] apng: Add a basic APNG muxer

2015-04-01 Thread Donny Yang
On 1 April 2015 at 17:03, Paul B Mahol one...@gmail.com wrote: Dana 31. 3. 2015. 22:59 osoba Donny Yang w...@kota.moe napisala je: +#include zlib.h This is missing dependency on zlib in configure. Fixed From 83de9b22f63542c5190a76dde299335297f781d4 Mon Sep 17 00:00:00 2001 From: Donny Yang

Re: [FFmpeg-devel] [PATCH 3/3] apng: Add a basic APNG muxer

2015-04-01 Thread Donny Yang
On 1 April 2015 at 22:57, Paul B Mahol one...@gmail.com wrote: On 4/1/15, Donny Yang w...@kota.moe wrote: On 1 April 2015 at 17:03, Paul B Mahol one...@gmail.com wrote: Dana 31. 3. 2015. 22:59 osoba Donny Yang w...@kota.moe napisala je: +#include zlib.h This is missing dependency

Re: [FFmpeg-devel] [PATCH 3/3] apng: Add a basic APNG muxer

2015-04-01 Thread Donny Yang
On 1 April 2015 at 23:28, Michael Niedermayer michae...@gmx.at wrote: On Wed, Apr 01, 2015 at 12:07:46PM +, Donny Yang wrote: On 1 April 2015 at 22:57, Paul B Mahol one...@gmail.com wrote: On 4/1/15, Donny Yang w...@kota.moe wrote: On 1 April 2015 at 17:03, Paul B Mahol one

Re: [FFmpeg-devel] [PATCH 3/3] apng: Add a basic APNG muxer

2015-04-01 Thread Donny Yang
On 2 April 2015 at 00:23, Michael Niedermayer michae...@gmx.at wrote: On Wed, Apr 01, 2015 at 01:17:50PM +, Donny Yang wrote: On 1 April 2015 at 23:28, Michael Niedermayer michae...@gmx.at wrote: On Wed, Apr 01, 2015 at 12:07:46PM +, Donny Yang wrote: On 1 April 2015 at 22:57

[FFmpeg-devel] [PATCH 3/4] apng: Add a basic APNG encoder

2015-03-31 Thread Donny Yang
Signed-off-by: Donny Yang w...@kota.moe --- configure | 1 + libavcodec/Makefile| 1 + libavcodec/allcodecs.c | 2 +- libavcodec/pngenc.c| 151 + 4 files changed, 144 insertions(+), 11 deletions(-) diff --git a/configure

[FFmpeg-devel] [PATCH 1/4] png: Clear up the calculation of max packet size

2015-03-31 Thread Donny Yang
Signed-off-by: Donny Yang w...@kota.moe --- libavcodec/pngenc.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c index 8fff0f3..ca0ed25 100644 --- a/libavcodec/pngenc.c +++ b/libavcodec/pngenc.c @@ -307,12 +307,16 @@ static

[FFmpeg-devel] [PATCH 2/4] png: Clearly separate encoding header and frames

2015-03-31 Thread Donny Yang
Signed-off-by: Donny Yang w...@kota.moe --- libavcodec/pngenc.c | 142 +++- 1 file changed, 84 insertions(+), 58 deletions(-) diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c index ca0ed25..e7c343b 100644 --- a/libavcodec/pngenc.c +++ b

[FFmpeg-devel] [PATCH 4/4] apng: Add a basic APNG muxer

2015-03-31 Thread Donny Yang
Additionally, update some documentation with support for APNG Signed-off-by: Donny Yang w...@kota.moe --- Changelog| 1 + doc/general.texi | 2 + libavformat/Makefile | 1 + libavformat/allformats.c | 2 +- libavformat/apngenc.c| 269

[FFmpeg-devel] [PATCH 3/3] apng: Add a basic APNG muxer

2015-03-31 Thread Donny Yang
Additionally, update some documentation with support for APNG Signed-off-by: Donny Yang w...@kota.moe --- Changelog| 1 + doc/general.texi | 2 + libavformat/Makefile | 1 + libavformat/allformats.c | 2 +- libavformat/apngenc.c| 269

[FFmpeg-devel] [PATCH 2/3] apng: Add a basic APNG encoder

2015-03-31 Thread Donny Yang
Signed-off-by: Donny Yang w...@kota.moe --- configure | 1 + libavcodec/Makefile| 1 + libavcodec/allcodecs.c | 2 +- libavcodec/pngenc.c| 149 ++--- 4 files changed, 143 insertions(+), 10 deletions(-) diff --git a/configure

[FFmpeg-devel] [PATCH 1/3] png: Clearly separate encoding header and frames

2015-03-31 Thread Donny Yang
Signed-off-by: Donny Yang w...@kota.moe --- libavcodec/pngenc.c | 142 +++- 1 file changed, 84 insertions(+), 58 deletions(-) diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c index c913cce..bf7c49e 100644 --- a/libavcodec/pngenc.c +++ b

Re: [FFmpeg-devel] [PATCH 2/8] png: Don't fail when a packet is larger than INT_MAX

2015-03-30 Thread Donny Yang
On 30 March 2015 at 02:48, Michael Niedermayer michae...@gmx.at wrote: On Sun, Mar 29, 2015 at 11:05:41AM +, Donny Yang wrote: Signed-off-by: Donny Yang w...@kota.moe --- libavcodec/pngenc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavcodec/pngenc.c b/libavcodec

Re: [FFmpeg-devel] [PATCH 5/5] apng: Add a basic APNG muxer

2015-03-29 Thread Donny Yang
On 29 March 2015 at 14:02, Carl Eugen Hoyos ceho...@ag.or.at wrote: Donny Yang work at kota.moe writes: +{ final_delay_num, Force delay numerator after the last frame, OFFSET(last_delay_num), + AV_OPT_TYPE_INT, { .i64 = 0 }, 0, USHRT_MAX, ENC }, +{ final_delay_den, Force

[FFmpeg-devel] [PATCH 5/8] png: Only init zlib once

2015-03-29 Thread Donny Yang
Signed-off-by: Donny Yang w...@kota.moe --- libavcodec/pngenc.c | 27 ++- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c index 0a215f2..410a829 100644 --- a/libavcodec/pngenc.c +++ b/libavcodec/pngenc.c @@ -299,7

[FFmpeg-devel] [PATCH 6/8] png: Clearly separate encoding header and frames

2015-03-29 Thread Donny Yang
Signed-off-by: Donny Yang w...@kota.moe --- libavcodec/pngenc.c | 146 +++- 1 file changed, 86 insertions(+), 60 deletions(-) diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c index 410a829..0264575 100644 --- a/libavcodec/pngenc.c +++ b

[FFmpeg-devel] [PATCH 2/8] png: Don't fail when a packet is larger than INT_MAX

2015-03-29 Thread Donny Yang
Signed-off-by: Donny Yang w...@kota.moe --- libavcodec/pngenc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c index 3697dbb..bd3aae5 100644 --- a/libavcodec/pngenc.c +++ b/libavcodec/pngenc.c @@ -373,8 +373,6 @@ static int encode_frame

[FFmpeg-devel] [PATCH 7/8] apng: Make PNG encoder only write headers once in APNG mode

2015-03-29 Thread Donny Yang
Signed-off-by: Donny Yang w...@kota.moe --- configure | 1 + libavcodec/Makefile| 1 + libavcodec/allcodecs.c | 2 +- libavcodec/pngenc.c| 53 ++ 4 files changed, 52 insertions(+), 5 deletions(-) diff --git a/configure b

[FFmpeg-devel] [PATCH 4/8] png: Calculate pixel format information only once

2015-03-29 Thread Donny Yang
Signed-off-by: Donny Yang w...@kota.moe --- libavcodec/pngenc.c | 124 +++- 1 file changed, 65 insertions(+), 59 deletions(-) diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c index 6c8fec2..0a215f2 100644 --- a/libavcodec/pngenc.c +++ b

[FFmpeg-devel] [PATCH 8/8] apng: Add a basic APNG muxer

2015-03-29 Thread Donny Yang
Additionally, update some documentation with support for APNG Signed-off-by: Donny Yang w...@kota.moe --- Changelog| 1 + doc/general.texi | 2 + libavformat/Makefile | 1 + libavformat/allformats.c | 2 +- libavformat/apngenc.c| 250

[FFmpeg-devel] [PATCH 3/8] png: Return slightly more meaningful error codes

2015-03-29 Thread Donny Yang
Signed-off-by: Donny Yang w...@kota.moe --- libavcodec/pngenc.c | 22 ++ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c index bd3aae5..6c8fec2 100644 --- a/libavcodec/pngenc.c +++ b/libavcodec/pngenc.c @@ -382,19

[FFmpeg-devel] [PATCH 1/8] png: Clear up the calculation of max packet size

2015-03-29 Thread Donny Yang
Signed-off-by: Donny Yang w...@kota.moe --- libavcodec/pngenc.c | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c index d6233d0..3697dbb 100644 --- a/libavcodec/pngenc.c +++ b/libavcodec/pngenc.c @@ -360,12 +360,23

Re: [FFmpeg-devel] Fwd: GSoC: APNG

2015-03-28 Thread Donny Yang
On 29 March 2015 at 03:15, Michael Niedermayer michae...@gmx.at wrote: you can try AVCodecContext-frame_number, if that doesnt work you need to keep track of if you already had received a frame I've tried both, but it turns out that AVCodecContext-frame_number seems to be thread-specific. That

[FFmpeg-devel] [PATCH 1/5] png: Use av_freep() instead of av_free()

2015-03-28 Thread Donny Yang
Signed-off-by: Donny Yang w...@kota.moe --- libavcodec/pngenc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c index 9bdefc4..0231bf7 100644 --- a/libavcodec/pngenc.c +++ b/libavcodec/pngenc.c @@ -512,9 +512,9 @@ static int

[FFmpeg-devel] [PATCH 3/5] png: Clearly separate init, encoding headers and encoding frame

2015-03-28 Thread Donny Yang
Signed-off-by: Donny Yang w...@kota.moe --- libavcodec/pngenc.c | 286 ++-- 1 file changed, 163 insertions(+), 123 deletions(-) diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c index d6233d0..0264575 100644 --- a/libavcodec/pngenc.c +++ b

[FFmpeg-devel] [PATCH 5/5] apng: Add a basic APNG muxer

2015-03-28 Thread Donny Yang
Additionally, update some documentation with support for APNG Signed-off-by: Donny Yang w...@kota.moe --- Changelog| 1 + doc/general.texi | 2 + libavformat/Makefile | 1 + libavformat/allformats.c | 2 +- libavformat/apngenc.c| 249

Re: [FFmpeg-devel] Fwd: GSoC: APNG

2015-03-28 Thread Donny Yang
where needed. On 28 March 2015 at 18:24, Paul B Mahol one...@gmail.com wrote: Dana 28. 3. 2015. 04:56 osoba Donny Yang w...@kota.moe napisala je: On 28 March 2015 at 04:36, Paul B Mahol one...@gmail.com wrote: The style of code inside patch do not match other files in codebase, look at style

Re: [FFmpeg-devel] Fwd: GSoC: APNG

2015-03-24 Thread Donny Yang
Sep 17 00:00:00 2001 From: Donny Yang w...@kota.moe Date: Tue, 24 Mar 2015 09:47:20 +1100 Subject: [PATCH 1/2] apng: Make the PNG encoder output only a stream of bytes in APNG mode This is in preparation for the APNG muxer which will take the bytes and add the headers there --- configure

Re: [FFmpeg-devel] Fwd: GSoC: APNG

2015-03-24 Thread Donny Yang
On 25 March 2015 at 04:18, Michael Niedermayer michae...@gmx.at wrote: the generated png files seem to differ ./ffmpeg -i lena.pnm ref.png -rw-r- 1 michael michael 180438 Mar 24 18:11 after-patches.png -rw-r- 1 michael michael 180987 Mar 24 18:14 before-patches.png It's because

Re: [FFmpeg-devel] Fwd: GSoC: APNG

2015-03-23 Thread Donny Yang
On 23 March 2015 at 21:50, Donny Yang w...@kota.moe wrote: Hello I was told to send my patch to ffmpeg-devel as well, so here it is. Please comment/critique on it and how I should improve the patch. Regards, Donny -- Forwarded message -- From: Donny Yang w...@kota.moe

[FFmpeg-devel] Fwd: GSoC: APNG

2015-03-23 Thread Donny Yang
Hello I was told to send my patch to ffmpeg-devel as well, so here it is. Please comment/critique on it and how I should improve the patch. Regards, Donny -- Forwarded message -- From: Donny Yang w...@kota.moe Date: 22 March 2015 at 01:10 Subject: GSoC: APNG To: one...@gmail.com

Re: [FFmpeg-devel] Fwd: GSoC: APNG

2015-03-23 Thread Donny Yang
(with `-f image2`)? From d340772705fb1bd38b57c83ec2607f553a3613e6 Mon Sep 17 00:00:00 2001 From: Donny Yang w...@kota.moe Date: Tue, 24 Mar 2015 09:47:20 +1100 Subject: [PATCH 1/2] apng: Make the PNG encoder output only a stream of bytes in APNG mode This is in preparation for the APNG muxer which