Re: [FFmpeg-devel] APNG encoder can work incorrectly
I create a special video. You can download it using the link https://drive.google.com/file/d/0B8rMLdq9Vq55QmwwcVJDVkZoM1E/view?usp=sharing Convert it to .apng format with ffmpeg -i apng_test.avi apng_test.apng The result file will be empty. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v2 6/9] swscale/arm/yuv2rgb: macro-ify
On 28/03/2016 21:19, Matthieu Bouron wrote: --- libswscale/arm/yuv2rgb_neon.S | 137 ++ 1 file changed, 60 insertions(+), 77 deletions(-) diff --git a/libswscale/arm/yuv2rgb_neon.S b/libswscale/arm/yuv2rgb_neon.S index ef7b0a6..e1b68c1 100644 --- a/libswscale/arm/yuv2rgb_neon.S +++ b/libswscale/arm/yuv2rgb_neon.S @@ -64,7 +64,7 @@ vmov.u8 \a2, #255 .endm -.macro compute_16px dst y0 y1 ofmt +.macro compute dst y0 y1 ofmt vmovl.u8q14, \y0 @ 8px of y vmovl.u8q15, \y1 @ 8px of y @@ -99,23 +99,23 @@ .endm -.macro process_1l_16px ofmt +.macro process_1l ofmt compute_premult d28, d29, d30, d31 vld1.8 {q7}, [r4]! -compute_16pxr2, d14, d15, \ofmt +compute r2, d14, d15, \ofmt .endm -.macro process_2l_16px ofmt +.macro process_2l ofmt compute_premult d28, d29, d30, d31 vld1.8 {q7}, [r4]!@ first line of luma -compute_16pxr2, d14, d15, \ofmt +compute r2, d14, d15, \ofmt vld1.8 {q7}, [r12]! @ second line of luma -compute_16pxr11, d14, d15, \ofmt +compute r11, d14, d15, \ofmt .endm -.macro load_args_nvx +.macro load_args_nv12 push{r4-r12, lr} vpush {q4-q7} ldr r4, [sp, #104] @ r4 = srcY @@ -136,6 +136,10 @@ sub r7, r7, r0 @ r7 = linesizeC - width (paddingC) .endm +.macro load_args_nv21 +load_args_nv12 +.endm + .macro load_args_yuv420p push{r4-r12, lr} vpush {q4-q7} @@ -176,55 +180,23 @@ ldr r10,[sp, #120] @ r10 = srcV .endm -.macro declare_func ifmt ofmt -function ff_\ifmt\()_to_\ofmt\()_neon, export=1 - -.ifc \ifmt,nv12 -load_args_nvx -.endif - -.ifc \ifmt,nv21 -load_args_nvx -.endif - -.ifc \ifmt,yuv420p -load_args_yuv420p -.endif - - -.ifc \ifmt,yuv422p -load_args_yuv422p -.endif - -1: -mov r8, r0 @ r8 = width -2: -pld [r6, #64*3] -pld [r4, #64*3] - -vmov.i8 d10, #128 - -.ifc \ifmt,nv12 +.macro load_chroma_nv12 pld [r12, #64*3] vld2.8 {d2, d3}, [r6]!@ q1: interleaved chroma line vsubl.u8q14, d2, d10 @ q14 = U - 128 vsubl.u8q15, d3, d10 @ q15 = V - 128 +.endm -process_2l_16px \ofmt -.endif - -.ifc \ifmt,nv21 +.macro load_chroma_nv21 pld [r12, #64*3] vld2.8 {d2, d3}, [r6]!@ q1: interleaved chroma line vsubl.u8q14, d3, d10 @ q14 = U - 128 vsubl.u8q15, d2, d10 @ q15 = V - 128 +.endm -process_2l_16px \ofmt -.endif - -.ifc \ifmt,yuv420p +.macro load_chroma_yuv420p pld [r10, #64*3] pld [r12, #64*3] @@ -232,68 +204,79 @@ function ff_\ifmt\()_to_\ofmt\()_neon, export=1 vld1.8 d3, [r10]! @ d3: chroma blue line vsubl.u8q14, d2, d10 @ q14 = U - 128 vsubl.u8q15, d3, d10 @ q15 = V - 128 +.endm -process_2l_16px \ofmt -.endif - -.ifc \ifmt,yuv422p +.macro load_chroma_yuv422p pld [r10, #64*3] vld1.8 d2, [r6]! @ d2: chroma red line vld1.8 d3, [r10]! @ d3: chroma blue line vsubl.u8q14, d2, d10 @ q14 = U - 128 vsubl.u8q15, d3, d10 @ q15 = V - 128 +.endm -process_1l_16px \ofmt -.endif - -subsr8, r8, #16@ width -= 16 -bgt 2b - -add r2, r2, r3 @ dst += padding -add r4, r4, r5 @ srcY += paddingY - -.ifc \ifmt,nv12 +.macro increment_nv12 add r11, r11, r3 @ dst2 += padding add r12, r12, r5 @ srcY2 += paddingY - add r6, r6, r7 @ srcC += paddingC - subsr1, r1, #2
Re: [FFmpeg-devel] [PATCH] sws/aarch64: add ff_hscale_8_to_15_neon
On Thu, Mar 24, 2016 at 01:28:37PM +0100, Clément Bœsch wrote: > From: Clément Bœsch > > ./ffmpeg -nostats -f lavfi -i testsrc2=4k:d=2 -vf > bench=start,scale=1024x1024,bench=stop -f null - > > before: t:0.489726 avg:0.489883 max:0.491852 min:0.489482 > after: t:0.256515 avg:0.256458 max:0.256999 min:0.253755 > --- > Changes: > - FIX: not using the v8-v15 registers > - writing directly from the SIMD register (thx Martin) > - misc reordering > > I'm looking at the vscale part now. > --- > libswscale/aarch64/Makefile | 6 +++-- > libswscale/aarch64/hscale.S | 59 > +++ > libswscale/aarch64/swscale.c | 37 +++ > libswscale/swscale.c | 2 ++ > libswscale/swscale_internal.h | 1 + > libswscale/utils.c| 4 ++- > 6 files changed, 106 insertions(+), 3 deletions(-) > create mode 100644 libswscale/aarch64/hscale.S > create mode 100644 libswscale/aarch64/swscale.c > Applied. -- Clément B. signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v2 6/9] swscale/arm/yuv2rgb: macro-ify
Hi, (sorry for the first mail, fuzzy fingers...) On 28/03/2016 21:19, Matthieu Bouron wrote: --- libswscale/arm/yuv2rgb_neon.S | 137 ++ 1 file changed, 60 insertions(+), 77 deletions(-) diff --git a/libswscale/arm/yuv2rgb_neon.S b/libswscale/arm/yuv2rgb_neon.S index ef7b0a6..e1b68c1 100644 --- a/libswscale/arm/yuv2rgb_neon.S +++ b/libswscale/arm/yuv2rgb_neon.S @@ -64,7 +64,7 @@ vmov.u8 \a2, #255 .endm -.macro compute_16px dst y0 y1 ofmt +.macro compute dst y0 y1 ofmt vmovl.u8q14, \y0 @ 8px of y vmovl.u8q15, \y1 @ 8px of y @@ -99,23 +99,23 @@ .endm -.macro process_1l_16px ofmt +.macro process_1l ofmt compute_premult d28, d29, d30, d31 vld1.8 {q7}, [r4]! -compute_16pxr2, d14, d15, \ofmt +compute r2, d14, d15, \ofmt .endm -.macro process_2l_16px ofmt +.macro process_2l ofmt compute_premult d28, d29, d30, d31 vld1.8 {q7}, [r4]!@ first line of luma -compute_16pxr2, d14, d15, \ofmt +compute r2, d14, d15, \ofmt vld1.8 {q7}, [r12]! @ second line of luma -compute_16pxr11, d14, d15, \ofmt +compute r11, d14, d15, \ofmt .endm This renaming could be split [...] @@ -232,68 +204,79 @@ function ff_\ifmt\()_to_\ofmt\()_neon, export=1 vld1.8 d3, [r10]! @ d3: chroma blue line vsubl.u8q14, d2, d10 @ q14 = U - 128 vsubl.u8q15, d3, d10 @ q15 = V - 128 +.endm -process_2l_16px \ofmt -.endif - -.ifc \ifmt,yuv422p +.macro load_chroma_yuv422p pld [r10, #64*3] vld1.8 d2, [r6]! @ d2: chroma red line vld1.8 d3, [r10]! @ d3: chroma blue line vsubl.u8q14, d2, d10 @ q14 = U - 128 vsubl.u8q15, d3, d10 @ q15 = V - 128 +.endm -process_1l_16px \ofmt -.endif - -subsr8, r8, #16@ width -= 16 -bgt 2b - -add r2, r2, r3 @ dst += padding -add r4, r4, r5 @ srcY += paddingY - -.ifc \ifmt,nv12 +.macro increment_nv12 How about increment_and test_nv12? Same for the other ones. (I'm not happy with the name I found, but am trying to come up with a solution to have a more explicit naming) -- Ben ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v2 8/9] swscale/arm/yuv2rgb: save a few instructions by processing the luma line interleaved
Hi, On 28/03/2016 21:19, Matthieu Bouron wrote: --- libswscale/arm/yuv2rgb_neon.S | 88 +-- 1 file changed, 34 insertions(+), 54 deletions(-) diff --git a/libswscale/arm/yuv2rgb_neon.S b/libswscale/arm/yuv2rgb_neon.S index 124d7d3..6b911c8 100644 --- a/libswscale/arm/yuv2rgb_neon.S +++ b/libswscale/arm/yuv2rgb_neon.S [...] @@ -94,25 +67,29 @@ .ifc \ofmt,bgra compute_rgbad8, d7, d6, d9, d12, d11, d10, d13 .endif + +vzip.8 d6, d10 +vzip.8 d7, d11 +vzip.8 d8, d12 +vzip.8 d9, d13 Adding a comment to explain the resulting interleaving would be nice vst4.8 {q3, q4}, [\dst,:128]! vst4.8 {q5, q6}, [\dst,:128]! - .endm .macro process_1l ofmt -compute_premult d28, d29, d30, d31 -vld1.8 {q7}, [r4]! -compute r2, d14, d15, \ofmt +compute_premult +vld2.8 {d14, d15}, [r4]! +compute r2, \ofmt .endm .macro process_2l ofmt -compute_premult d28, d29, d30, d31 +compute_premult -vld1.8 {q7}, [r4]!@ first line of luma -compute r2, d14, d15, \ofmt +vld2.8 {d14, d15}, [r4]! @ q7 = Y (interleaved) +compute r2, \ofmt -vld1.8 {q7}, [r12]! @ second line of luma -compute r11, d14, d15, \ofmt +vld2.8 {d14, d15}, [r12]! @ q7 = Y (interleaved) +compute r11, \ofmt .endm What about adding a level of macro here? Something like: .macro process_1l_internal ofmt src_addr res compute_premult vld2.8{d14, d15}, [\src_addr]! compute\res, \ofmt .endm (again, the naming could be changed, according to your own taste :-) ) This way, we would get: .macro process_1l ofmt process_1l_internal \ofmt, r4, r2 .endm .macro process_2l ofmt process_1l_internal \ofmt, r4, r2 process_1l_internal \ofmt, r12, r11 .endm -- Ben ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] Need help with transcoding example
Hello I've altered doc/examples/transcoding.c to encode using aac codec: --- a/doc/examples/transcoding.c +++ b/doc/examples/transcoding.c @@ -114,7 +114,12 @@ if (dec_ctx->codec_type == AVMEDIA_TYPE_VIDEO || dec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) { /* in this example, we choose transcoding to same codec */ + if (dec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) { + encoder = avcodec_find_encoder_by_name("aac"); + avcodec_get_context_defaults3(enc_ctx, encoder); + } else { encoder = avcodec_find_encoder(dec_ctx->codec_id); + } if (!encoder) { av_log(NULL, AV_LOG_FATAL, "Necessary encoder not found\n"); return AVERROR_INVALIDDATA; And then transcoding fails as with: [aac @ 0x28d5780] more samples than frame size (avcodec_encode_audio2) Do I have to add some more filters to filter chain or use libswrresample as in example transcode_aac.c? Full output with DEBUG logging: $ ./doc/examples/transcoding input.avi /tmp/tmp.avi [file @ 0x27d2740] Setting default whitelist 'file' [avi @ 0x27d2040] Format avi probed with size=2048 and score=100 [avi @ 0x27d28a0] use odml:1 [avi @ 0x27d2040] overriding sample_size [avi @ 0x27d2040] Before avformat_find_stream_info() pos: 10030 bytes read:118568 seeks:4 [avi @ 0x27d2040] All info found [avi @ 0x27d2040] After avformat_find_stream_info() pos: 58896 bytes read:151336 seeks:4 frames:2 detected 2 logical cores Input #0, avi, from 'input.avi': Metadata: encoder : Lavf52.64.2 Duration: 00:00:10.00, start: 0.00, bitrate: 2704 kb/s Stream #0:0, 1, 1/25: Video: mpeg4 (Simple Profile), 1 reference frame (xvid / 0x64697678), yuv420p(left), 1024x576 [SAR 1:1 DAR 16:9], 1/25, 2372 kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc Stream #0:1, 1, 32/1225: Audio: mp3 (U[0][0][0] / 0x0055), 44100 Hz, stereo, s16p, 320 kb/s [mpeg4 @ 0x27f74a0] intra_quant_bias = 0 inter_quant_bias = -64 Output #0, avi, to '/tmp/tmp.avi': Stream #0:0, 0, 0/0: Video: mpeg4, 1 reference frame, yuv420p, 1024x576 [SAR 1:1 DAR 16:9], 1/25, q=2-31, 128 kb/s, 25 tbc Stream #0:1, 0, 0/0: Audio: aac (LC), 44100 Hz, stereo, fltp, 128 kb/s [file @ 0x29fad80] Setting default whitelist 'file' [avi @ 0x27f6aa0] Using AVStream.codec.time_base as a timebase hint to the muxer is deprecated. Set AVStream.time_base instead. [avi @ 0x27f6aa0] Using AVStream.codec.time_base as a timebase hint to the muxer is deprecated. Set AVStream.time_base instead. [in @ 0x2a03e40] Setting 'video_size' to value '1024x576' [in @ 0x2a03e40] Setting 'pix_fmt' to value '0' [in @ 0x2a03e40] Setting 'time_base' to value '1/25' [in @ 0x2a03e40] Setting 'pixel_aspect' to value '1/1' [in @ 0x2a03e40] w:1024 h:576 pixfmt:yuv420p tb:1/25 fr:0/1 sar:1/1 sws_param: [AVFilterGraph @ 0x2a03480] query_formats: 3 queried, 2 merged, 0 already done, 0 delayed [in @ 0x2a06880] Setting 'time_base' to value '1/44100' [in @ 0x2a06880] Setting 'sample_rate' to value '44100' [in @ 0x2a06880] Setting 'sample_fmt' to value 's16p' [in @ 0x2a06880] Setting 'channel_layout' to value '0x3' [in @ 0x2a06880] tb:1/44100 samplefmt:s16p samplerate:44100 chlayout:0x3 [Parsed_anull_0 @ 0x2a079a0] auto-inserting filter 'auto-inserted resampler 0' between the filter 'in' and the filter 'Parsed_anull_0' [AVFilterGraph @ 0x2a05f00] query_formats: 3 queried, 3 merged, 3 already done, 0 delayed [auto-inserted resampler 0 @ 0x2a094e0] [SWR @ 0x2a098c0] Using s16p internally between filters [auto-inserted resampler 0 @ 0x2a094e0] ch:2 chl:stereo fmt:s16p r:44100Hz -> ch:2 chl:stereo fmt:fltp r:44100Hz Demuxer gave frame of stream_index 1 Going to reencode&filter the frame Pushing decoded frame to filters Pulling filtered frame from filters Encoding frame [aac @ 0x28d5780] more samples than frame size (avcodec_encode_audio2) [aac @ 0x28d5780] Qavg: -nan [AVIOContext @ 0x27da900] Statistics: 151336 bytes read, 4 seeks [AVIOContext @ 0x2a02f20] Statistics: 0 seeks, 1 writeouts -- Regards Przemysław Sobala Spółki Grupy Wirtualna Polska: Wirtualna Polska Holding Spółka Akcyjna z siedzibą w Warszawie, ul. Jutrzenki 137A, 02-231 Warszawa, wpisana do Krajowego Rejestru Sądowego - Rejestru Przedsiębiorców prowadzonego przez Sąd Rejonowy dla m.st. Warszawy w Warszawie pod nr KRS: 407130, kapitał zakładowy: 1 245 651,90 zł (w całości wpłacony), Numer Identyfikacji Podatkowej (NIP): 521-31-11-513 Grupa Wirtualna Polska Spółka Akcyjna z siedzibą w Warszawie, ul. Jutrzenki 137A, 02-231 Warszawa, wpisana do Krajowego Rejestru Sądowego - Rejestru Przedsiębiorców prowadzonego przez Sąd Rejonowy dla m.st. Warszawy w Warszawie pod nr KRS: 580004, kapitał zakładowy: 317 957 850,00 zł (w całości wpłacony), Numer Identyfikacji Podatkowej (NIP): 527-26-45-593 WP Shopping Spółka z ograniczoną odpowiedzialnością z siedzibą w Warszawie, ul.
Re: [FFmpeg-devel] [PATCH v2 8/9] swscale/arm/yuv2rgb: save a few instructions by processing the luma line interleaved
On Thu, Mar 31, 2016 at 11:17:43AM +0200, Benoit Fouet wrote: [...] > What about adding a level of macro here? Something like: > .macro process_1l_internal ofmt src_addr res > compute_premult > vld2.8{d14, d15}, [\src_addr]! > compute\res, \ofmt > .endm > > (again, the naming could be changed, according to your own taste :-) ) > > This way, we would get: > .macro process_1l ofmt > process_1l_internal \ofmt, r4, r2 > .endm > > .macro process_2l ofmt > process_1l_internal \ofmt, r4, r2 > process_1l_internal \ofmt, r12, r11 > .endm > You loose the possibility of doing pairing if you do that -- Clément B. signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v2 6/9] swscale/arm/yuv2rgb: macro-ify
On 28/03/2016 21:19, Matthieu Bouron wrote: --- libswscale/arm/yuv2rgb_neon.S | 137 ++ 1 file changed, 60 insertions(+), 77 deletions(-) diff --git a/libswscale/arm/yuv2rgb_neon.S b/libswscale/arm/yuv2rgb_neon.S index ef7b0a6..e1b68c1 100644 --- a/libswscale/arm/yuv2rgb_neon.S +++ b/libswscale/arm/yuv2rgb_neon.S @@ -64,7 +64,7 @@ vmov.u8 \a2, #255 .endm -.macro compute_16px dst y0 y1 ofmt +.macro compute dst y0 y1 ofmt vmovl.u8q14, \y0 @ 8px of y vmovl.u8q15, \y1 @ 8px of y @@ -99,23 +99,23 @@ .endm -.macro process_1l_16px ofmt +.macro process_1l ofmt compute_premult d28, d29, d30, d31 vld1.8 {q7}, [r4]! -compute_16pxr2, d14, d15, \ofmt +compute r2, d14, d15, \ofmt .endm -.macro process_2l_16px ofmt +.macro process_2l ofmt compute_premult d28, d29, d30, d31 vld1.8 {q7}, [r4]!@ first line of luma -compute_16pxr2, d14, d15, \ofmt +compute r2, d14, d15, \ofmt vld1.8 {q7}, [r12]! @ second line of luma -compute_16pxr11, d14, d15, \ofmt +compute r11, d14, d15, \ofmt .endm -.macro load_args_nvx +.macro load_args_nv12 push{r4-r12, lr} vpush {q4-q7} ldr r4, [sp, #104] @ r4 = srcY @@ -136,6 +136,10 @@ sub r7, r7, r0 @ r7 = linesizeC - width (paddingC) .endm +.macro load_args_nv21 +load_args_nv12 +.endm + .macro load_args_yuv420p push{r4-r12, lr} vpush {q4-q7} @@ -176,55 +180,23 @@ ldr r10,[sp, #120] @ r10 = srcV .endm -.macro declare_func ifmt ofmt -function ff_\ifmt\()_to_\ofmt\()_neon, export=1 - -.ifc \ifmt,nv12 -load_args_nvx -.endif - -.ifc \ifmt,nv21 -load_args_nvx -.endif - -.ifc \ifmt,yuv420p -load_args_yuv420p -.endif - - -.ifc \ifmt,yuv422p -load_args_yuv422p -.endif - -1: -mov r8, r0 @ r8 = width -2: -pld [r6, #64*3] -pld [r4, #64*3] - -vmov.i8 d10, #128 - -.ifc \ifmt,nv12 +.macro load_chroma_nv12 pld [r12, #64*3] vld2.8 {d2, d3}, [r6]!@ q1: interleaved chroma line vsubl.u8q14, d2, d10 @ q14 = U - 128 vsubl.u8q15, d3, d10 @ q15 = V - 128 +.endm -process_2l_16px \ofmt -.endif - -.ifc \ifmt,nv21 +.macro load_chroma_nv21 pld [r12, #64*3] vld2.8 {d2, d3}, [r6]!@ q1: interleaved chroma line vsubl.u8q14, d3, d10 @ q14 = U - 128 vsubl.u8q15, d2, d10 @ q15 = V - 128 +.endm -process_2l_16px \ofmt -.endif - -.ifc \ifmt,yuv420p +.macro load_chroma_yuv420p pld [r10, #64*3] pld [r12, #64*3] @@ -232,68 +204,79 @@ function ff_\ifmt\()_to_\ofmt\()_neon, export=1 vld1.8 d3, [r10]! @ d3: chroma blue line vsubl.u8q14, d2, d10 @ q14 = U - 128 vsubl.u8q15, d3, d10 @ q15 = V - 128 +.endm -process_2l_16px \ofmt -.endif - -.ifc \ifmt,yuv422p +.macro load_chroma_yuv422p pld [r10, #64*3] vld1.8 d2, [r6]! @ d2: chroma red line vld1.8 d3, [r10]! @ d3: chroma blue line vsubl.u8q14, d2, d10 @ q14 = U - 128 vsubl.u8q15, d3, d10 @ q15 = V - 128 +.endm -process_1l_16px \ofmt -.endif - -subsr8, r8, #16@ width -= 16 -bgt 2b - -add r2, r2, r3 @ dst += padding -add r4, r4, r5 @ srcY += paddingY - -.ifc \ifmt,nv12 +.macro increment_nv12 add r11, r11, r3 @ dst2 += padding add r12, r12, r5 @ srcY2 += paddingY - add r6, r6, r7 @ srcC += paddingC - subsr1, r1, #2
Re: [FFmpeg-devel] Need help with transcoding example
Hello Przemysław, On Thu, Mar 31, 2016 at 11:17:17 +0200, Przemysław Sobala wrote: > Hello > I've altered doc/examples/transcoding.c to encode using aac codec: Please use the libav-user list for questions regarding the usage of ffmpeg's libraries and the programming with ffmpeg. https://ffmpeg.org/mailman/listinfo/libav-user This list is for the discussion of the development *of* ffmpeg, not *with*. Thanks, Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] configure: Fix debugging on mingw-w64 with gdb
On Tue, Mar 29, 2016 at 01:30:50AM -0400, Alex Smith wrote: > The relocation hack broke debugging on mingw-w64 when using gdb. This > makes the reloc hack dependent on --disable-debug so it's still enabled > for release builds. > > This is simply an immediate fix for the issue of broken debugging, we > should probably still look at the possibility of reverting it outright > if it proves to be more trouble than it's worth. For now keeping it > enabled for release builds is a reasonable trade off. > > Signed-off-by: Alex Smith > --- > configure | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Those who are too smart to engage in politics are punished by being governed by those who are dumber. -- Plato signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v2 6/9] swscale/arm/yuv2rgb: macro-ify
On Thu, Mar 31, 2016 at 10:48 AM, Benoit Fouet wrote: > Hi, > > (sorry for the first mail, fuzzy fingers...) > > On 28/03/2016 21:19, Matthieu Bouron wrote: > >> --- >> libswscale/arm/yuv2rgb_neon.S | 137 >> ++ >> 1 file changed, 60 insertions(+), 77 deletions(-) >> >> diff --git a/libswscale/arm/yuv2rgb_neon.S b/libswscale/arm/yuv2rgb_neon.S >> index ef7b0a6..e1b68c1 100644 >> --- a/libswscale/arm/yuv2rgb_neon.S >> +++ b/libswscale/arm/yuv2rgb_neon.S >> @@ -64,7 +64,7 @@ >> vmov.u8 \a2, #255 >> .endm >> -.macro compute_16px dst y0 y1 ofmt >> +.macro compute dst y0 y1 ofmt >> vmovl.u8q14, \y0 >> @ 8px of y >> vmovl.u8q15, \y1 >> @ 8px of y >> @@ -99,23 +99,23 @@ >> .endm >> -.macro process_1l_16px ofmt >> +.macro process_1l ofmt >> compute_premult d28, d29, d30, d31 >> vld1.8 {q7}, [r4]! >> -compute_16pxr2, d14, d15, \ofmt >> +compute r2, d14, d15, \ofmt >> .endm >> -.macro process_2l_16px ofmt >> +.macro process_2l ofmt >> compute_premult d28, d29, d30, d31 >> vld1.8 {q7}, [r4]! >> @ first line of luma >> -compute_16pxr2, d14, d15, \ofmt >> +compute r2, d14, d15, \ofmt >> vld1.8 {q7}, [r12]! >> @ second line of luma >> -compute_16pxr11, d14, d15, \ofmt >> +compute r11, d14, d15, \ofmt >> .endm >> >> > > This renaming could be split > Splitted locally. > > [...] > > > @@ -232,68 +204,79 @@ function ff_\ifmt\()_to_\ofmt\()_neon, export=1 >> vld1.8 d3, [r10]! >> @ d3: chroma blue line >> vsubl.u8q14, d2, d10 >> @ q14 = U - 128 >> vsubl.u8q15, d3, d10 >> @ q15 = V - 128 >> +.endm >> -process_2l_16px \ofmt >> -.endif >> - >> -.ifc \ifmt,yuv422p >> +.macro load_chroma_yuv422p >> pld [r10, #64*3] >> vld1.8 d2, [r6]! >> @ d2: chroma red line >> vld1.8 d3, [r10]! >> @ d3: chroma blue line >> vsubl.u8q14, d2, d10 >> @ q14 = U - 128 >> vsubl.u8q15, d3, d10 >> @ q15 = V - 128 >> +.endm >> -process_1l_16px \ofmt >> -.endif >> - >> -subsr8, r8, #16@ >> width -= 16 >> -bgt 2b >> - >> -add r2, r2, r3 @ >> dst += padding >> -add r4, r4, r5 @ >> srcY += paddingY >> - >> -.ifc \ifmt,nv12 >> +.macro increment_nv12 >> > > How about increment_and test_nv12? Same for the other ones. > (I'm not happy with the name I found, but am trying to come up with a > solution to have a more explicit naming) Renamed to increment_and_test_* locally. Thanks, Matthieu [...] ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v2 8/9] swscale/arm/yuv2rgb: save a few instructions by processing the luma line interleaved
On Thu, Mar 31, 2016 at 11:17 AM, Benoit Fouet wrote: > Hi, > > On 28/03/2016 21:19, Matthieu Bouron wrote: > >> --- >> libswscale/arm/yuv2rgb_neon.S | 88 >> +-- >> 1 file changed, 34 insertions(+), 54 deletions(-) >> >> diff --git a/libswscale/arm/yuv2rgb_neon.S b/libswscale/arm/yuv2rgb_neon.S >> index 124d7d3..6b911c8 100644 >> --- a/libswscale/arm/yuv2rgb_neon.S >> +++ b/libswscale/arm/yuv2rgb_neon.S >> >> [...] >> >> @@ -94,25 +67,29 @@ >> .ifc \ofmt,bgra >> compute_rgbad8, d7, d6, d9, d12, d11, d10, d13 >> .endif >> + >> +vzip.8 d6, d10 >> +vzip.8 d7, d11 >> +vzip.8 d8, d12 >> +vzip.8 d9, d13 >> > > Adding a comment to explain the resulting interleaving would be nice Added locally: +vzip.8 d6, d10@ d6 = R1R2R3R4R5R6R7R8 d10 = R9R10R11R12R13R14R15R16 +vzip.8 d7, d11@ d7 = G1G2G3G4G5G6G7G8 d11 = G9G10G11G12G13G14G15G16 +vzip.8 d8, d12@ d8 = B1B2B3B4B5B6B7B8 d12 = B9B10B11B12B13B14B15B16 +vzip.8 d9, d13@ d9 = A1A2A3A4A5A6A7A8 d13 = A9A10A11A12A13A14A15A16 > > > vst4.8 {q3, q4}, [\dst,:128]! >> vst4.8 {q5, q6}, [\dst,:128]! >> - >> .endm >> .macro process_1l ofmt >> -compute_premult d28, d29, d30, d31 >> -vld1.8 {q7}, [r4]! >> -compute r2, d14, d15, \ofmt >> +compute_premult >> +vld2.8 {d14, d15}, [r4]! >> +compute r2, \ofmt >> .endm >> .macro process_2l ofmt >> -compute_premult d28, d29, d30, d31 >> +compute_premult >> -vld1.8 {q7}, [r4]! >> @ first line of luma >> -compute r2, d14, d15, \ofmt >> +vld2.8 {d14, d15}, [r4]! @ >> q7 = Y (interleaved) >> +compute r2, \ofmt >> -vld1.8 {q7}, [r12]! >> @ second line of luma >> -compute r11, d14, d15, \ofmt >> +vld2.8 {d14, d15}, [r12]! @ >> q7 = Y (interleaved) >> +compute r11, \ofmt >> .endm >> >> > > What about adding a level of macro here? Something like: > .macro process_1l_internal ofmt src_addr res > compute_premult > vld2.8{d14, d15}, [\src_addr]! > compute\res, \ofmt > .endm > > (again, the naming could be changed, according to your own taste :-) ) > > This way, we would get: > .macro process_1l ofmt > process_1l_internal \ofmt, r4, r2 > .endm > > .macro process_2l ofmt > process_1l_internal \ofmt, r4, r2 > process_1l_internal \ofmt, r12, r11 > .endm Added locally: process_1l_16px_internal added to the macro-ify patch and then renamed to process_1l_internal in a later patch. Thanks, Matthieu ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] swscale: Deprecate vector functions which are unused outside swscale
There are no known users of these functions within debian It should be thus possible to remove these functions without recommandition of a replacement Signed-off-by: Michael Niedermayer --- libswscale/swscale.h | 16 libswscale/utils.c |6 ++ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/libswscale/swscale.h b/libswscale/swscale.h index da9dd2e..703108d 100644 --- a/libswscale/swscale.h +++ b/libswscale/swscale.h @@ -251,13 +251,13 @@ SwsVector *sws_getGaussianVec(double variance, double quality); * Allocate and return a vector with length coefficients, all * with the same value c. */ -SwsVector *sws_getConstVec(double c, int length); +attribute_deprecated SwsVector *sws_getConstVec(double c, int length); /** * Allocate and return a vector with just one coefficient, with * value 1.0. */ -SwsVector *sws_getIdentityVec(void); +attribute_deprecated SwsVector *sws_getIdentityVec(void); /** * Scale all the coefficients of a by the scalar value. @@ -268,22 +268,22 @@ void sws_scaleVec(SwsVector *a, double scalar); * Scale all the coefficients of a so that their sum equals height. */ void sws_normalizeVec(SwsVector *a, double height); -void sws_convVec(SwsVector *a, SwsVector *b); -void sws_addVec(SwsVector *a, SwsVector *b); -void sws_subVec(SwsVector *a, SwsVector *b); -void sws_shiftVec(SwsVector *a, int shift); +attribute_deprecated void sws_convVec(SwsVector *a, SwsVector *b); +attribute_deprecated void sws_addVec(SwsVector *a, SwsVector *b); +attribute_deprecated void sws_subVec(SwsVector *a, SwsVector *b); +attribute_deprecated void sws_shiftVec(SwsVector *a, int shift); /** * Allocate and return a clone of the vector a, that is a vector * with the same coefficients as a. */ -SwsVector *sws_cloneVec(SwsVector *a); +attribute_deprecated SwsVector *sws_cloneVec(SwsVector *a); /** * Print with av_log() a textual representation of the vector a * if log_level <= av_log_level. */ -void sws_printVec2(SwsVector *a, AVClass *log_ctx, int log_level); +attribute_deprecated void sws_printVec2(SwsVector *a, AVClass *log_ctx, int log_level); void sws_freeVec(SwsVector *a); diff --git a/libswscale/utils.c b/libswscale/utils.c index 24ddd13..8a13124 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -53,6 +53,12 @@ #include "libavutil/ppc/cpu.h" #include "libavutil/x86/asm.h" #include "libavutil/x86/cpu.h" + +// We have to implement deprecated functions until they are removed, this is the +// simplest way to prevent warnings +#undef attribute_deprecated +#define attribute_deprecated + #include "rgb2rgb.h" #include "swscale.h" #include "swscale_internal.h" -- 1.7.9.5 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] swscale: Deprecate vector functions which are unused outside swscale
There are no known users of these functions within debian It should be thus possible to remove these functions without recommandition of a replacement Signed-off-by: Michael Niedermayer --- libswscale/swscale.h | 37 ++--- libswscale/utils.c | 46 ++ libswscale/version.h |4 3 files changed, 60 insertions(+), 27 deletions(-) diff --git a/libswscale/swscale.h b/libswscale/swscale.h index da9dd2e..8449948 100644 --- a/libswscale/swscale.h +++ b/libswscale/swscale.h @@ -248,18 +248,6 @@ SwsVector *sws_allocVec(int length); SwsVector *sws_getGaussianVec(double variance, double quality); /** - * Allocate and return a vector with length coefficients, all - * with the same value c. - */ -SwsVector *sws_getConstVec(double c, int length); - -/** - * Allocate and return a vector with just one coefficient, with - * value 1.0. - */ -SwsVector *sws_getIdentityVec(void); - -/** * Scale all the coefficients of a by the scalar value. */ void sws_scaleVec(SwsVector *a, double scalar); @@ -268,22 +256,17 @@ void sws_scaleVec(SwsVector *a, double scalar); * Scale all the coefficients of a so that their sum equals height. */ void sws_normalizeVec(SwsVector *a, double height); -void sws_convVec(SwsVector *a, SwsVector *b); -void sws_addVec(SwsVector *a, SwsVector *b); -void sws_subVec(SwsVector *a, SwsVector *b); -void sws_shiftVec(SwsVector *a, int shift); -/** - * Allocate and return a clone of the vector a, that is a vector - * with the same coefficients as a. - */ -SwsVector *sws_cloneVec(SwsVector *a); - -/** - * Print with av_log() a textual representation of the vector a - * if log_level <= av_log_level. - */ -void sws_printVec2(SwsVector *a, AVClass *log_ctx, int log_level); +#if FF_API_SWS_VECTOR +attribute_deprecated SwsVector *sws_getConstVec(double c, int length); +attribute_deprecated SwsVector *sws_getIdentityVec(void); +attribute_deprecated void sws_convVec(SwsVector *a, SwsVector *b); +attribute_deprecated void sws_addVec(SwsVector *a, SwsVector *b); +attribute_deprecated void sws_subVec(SwsVector *a, SwsVector *b); +attribute_deprecated void sws_shiftVec(SwsVector *a, int shift); +attribute_deprecated SwsVector *sws_cloneVec(SwsVector *a); +attribute_deprecated void sws_printVec2(SwsVector *a, AVClass *log_ctx, int log_level); +#endif void sws_freeVec(SwsVector *a); diff --git a/libswscale/utils.c b/libswscale/utils.c index 24ddd13..1891c22 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -53,10 +53,23 @@ #include "libavutil/ppc/cpu.h" #include "libavutil/x86/asm.h" #include "libavutil/x86/cpu.h" + +// We have to implement deprecated functions until they are removed, this is the +// simplest way to prevent warnings +#undef attribute_deprecated +#define attribute_deprecated + #include "rgb2rgb.h" #include "swscale.h" #include "swscale_internal.h" +#if !FF_API_SWS_VECTOR +static SwsVector *sws_getIdentityVec(void); +static void sws_addVec(SwsVector *a, SwsVector *b); +static void sws_shiftVec(SwsVector *a, int shift); +static void sws_printVec2(SwsVector *a, AVClass *log_ctx, int log_level); +#endif + static void handle_formats(SwsContext *c); unsigned swscale_version(void) @@ -2049,6 +2062,13 @@ SwsVector *sws_getGaussianVec(double variance, double quality) return vec; } +/** + * Allocate and return a vector with length coefficients, all + * with the same value c. + */ +#if !FF_API_SWS_VECTOR +static +#endif SwsVector *sws_getConstVec(double c, int length) { int i; @@ -2063,6 +2083,13 @@ SwsVector *sws_getConstVec(double c, int length) return vec; } +/** + * Allocate and return a vector with just one coefficient, with + * value 1.0. + */ +#if !FF_API_SWS_VECTOR +static +#endif SwsVector *sws_getIdentityVec(void) { return sws_getConstVec(1.0, 1); @@ -2092,6 +2119,7 @@ void sws_normalizeVec(SwsVector *a, double height) sws_scaleVec(a, height / sws_dcVec(a)); } +#if FF_API_SWS_VECTOR static SwsVector *sws_getConvVec(SwsVector *a, SwsVector *b) { int length = a->length + b->length - 1; @@ -2109,6 +2137,7 @@ static SwsVector *sws_getConvVec(SwsVector *a, SwsVector *b) return vec; } +#endif static SwsVector *sws_sumVec(SwsVector *a, SwsVector *b) { @@ -2127,6 +2156,7 @@ static SwsVector *sws_sumVec(SwsVector *a, SwsVector *b) return vec; } +#if FF_API_SWS_VECTOR static SwsVector *sws_diffVec(SwsVector *a, SwsVector *b) { int length = FFMAX(a->length, b->length); @@ -2143,6 +2173,7 @@ static SwsVector *sws_diffVec(SwsVector *a, SwsVector *b) return vec; } +#endif /* shift left / or right if "shift" is negative */ static SwsVector *sws_getShiftedVec(SwsVector *a, int shift) @@ -2162,6 +2193,9 @@ static SwsVector *sws_getShiftedVec(SwsVector *a, int shift) return vec; } +#if !FF_API_SWS_VECTOR +static +#endif void sws_shiftVec(SwsVector *a, int shift) { SwsVector *shifted = sws_get
Re: [FFmpeg-devel] [PATCH] swscale: Deprecate vector functions which are unused outside swscale
On Thu, Mar 31, 2016 at 06:52:27PM +0200, Michael Niedermayer wrote: > There are no known users of these functions within debian > It should be thus possible to remove these functions without recommandition > of a > replacement > > Signed-off-by: Michael Niedermayer > --- > libswscale/swscale.h | 37 ++--- > libswscale/utils.c | 46 ++ > libswscale/version.h |4 > 3 files changed, 60 insertions(+), 27 deletions(-) approved by BBB on IRC [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If a bugfix only changes things apparently unrelated to the bug with no further explanation, that is a good sign that the bugfix is wrong. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] swscale: add bt2020 yuv2rgb coefficients.
Also fix the bt709 ones. They seem derived from incorrect values cr=0.2125 (should be cr=0.2126) and cb=0.0721 (should be cb=0.0722). --- libswscale/swscale.h | 1 + libswscale/yuv2rgb.c | 13 - 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/libswscale/swscale.h b/libswscale/swscale.h index da9dd2e..6b8b926 100644 --- a/libswscale/swscale.h +++ b/libswscale/swscale.h @@ -91,6 +91,7 @@ const char *swscale_license(void); #define SWS_CS_SMPTE170M 5 #define SWS_CS_SMPTE240M 7 #define SWS_CS_DEFAULT5 +#define SWS_CS_BT2020 9 /** * Return a pointer to yuv<->rgb coefficients for the given colorspace diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c index 62abb7d..1fe5abe 100644 --- a/libswscale/yuv2rgb.c +++ b/libswscale/yuv2rgb.c @@ -46,20 +46,23 @@ * * where Y = cr * R + cg * G + cb * B and cr + cg + cb = 1. */ -const int32_t ff_yuv2rgb_coeffs[8][4] = { -{ 117504, 138453, 13954, 34903 }, /* no sequence_display_extension */ -{ 117504, 138453, 13954, 34903 }, /* ITU-R Rec. 709 (1990) */ +const int32_t ff_yuv2rgb_coeffs[11][4] = { +{ 117489, 138438, 13975, 34925 }, /* no sequence_display_extension */ +{ 117489, 138438, 13975, 34925 }, /* ITU-R Rec. 709 (1990) */ { 104597, 132201, 25675, 53279 }, /* unspecified */ { 104597, 132201, 25675, 53279 }, /* reserved */ { 104448, 132798, 24759, 53109 }, /* FCC */ { 104597, 132201, 25675, 53279 }, /* ITU-R Rec. 624-4 System B, G */ { 104597, 132201, 25675, 53279 }, /* SMPTE 170M */ -{ 117579, 136230, 16907, 35559 } /* SMPTE 240M (1987) */ +{ 117579, 136230, 16907, 35559 }, /* SMPTE 240M (1987) */ +{ 0 }, /* YCgCo */ +{ 110013, 140363, 12277, 42626 }, /* Bt-2020-NCL */ +{ 110013, 140363, 12277, 42626 }, /* Bt-2020-CL */ }; const int *sws_getCoefficients(int colorspace) { -if (colorspace > 7 || colorspace < 0) +if (colorspace > 10 || colorspace < 0 || colorspace == 8) colorspace = SWS_CS_DEFAULT; return ff_yuv2rgb_coeffs[colorspace]; } -- 2.1.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] swscale: add bt2020 yuv2rgb coefficients.
On Thu, Mar 31, 2016 at 02:29:12PM -0400, Ronald S. Bultje wrote: > Also fix the bt709 ones. They seem derived from incorrect values > cr=0.2125 (should be cr=0.2126) and cb=0.0721 (should be cb=0.0722). > --- > libswscale/swscale.h | 1 + > libswscale/yuv2rgb.c | 13 - > 2 files changed, 9 insertions(+), 5 deletions(-) > > diff --git a/libswscale/swscale.h b/libswscale/swscale.h > index da9dd2e..6b8b926 100644 > --- a/libswscale/swscale.h > +++ b/libswscale/swscale.h > @@ -91,6 +91,7 @@ const char *swscale_license(void); > #define SWS_CS_SMPTE170M 5 > #define SWS_CS_SMPTE240M 7 > #define SWS_CS_DEFAULT5 > +#define SWS_CS_BT2020 9 > > /** > * Return a pointer to yuv<->rgb coefficients for the given colorspace > diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c > index 62abb7d..1fe5abe 100644 > --- a/libswscale/yuv2rgb.c > +++ b/libswscale/yuv2rgb.c > @@ -46,20 +46,23 @@ > * > * where Y = cr * R + cg * G + cb * B and cr + cg + cb = 1. > */ > -const int32_t ff_yuv2rgb_coeffs[8][4] = { > -{ 117504, 138453, 13954, 34903 }, /* no sequence_display_extension */ > -{ 117504, 138453, 13954, 34903 }, /* ITU-R Rec. 709 (1990) */ > +const int32_t ff_yuv2rgb_coeffs[11][4] = { missing update to libswscale/swscale_internal.h libswscale/yuv2rgb.c:49:15: error: conflicting types for ‘ff_yuv2rgb_coeffs’ libswscale/swscale_internal.h:869:22: note: previous declaration of ‘ff_yuv2rgb_coeffs’ was here [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB While the State exists there can be no freedom; when there is freedom there will be no State. -- Vladimir Lenin signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] swscale: add bt2020 yuv2rgb coefficients.
On Thu, Mar 31, 2016 at 02:29:12PM -0400, Ronald S. Bultje wrote: > Also fix the bt709 ones. They seem derived from incorrect values > cr=0.2125 (should be cr=0.2126) and cb=0.0721 (should be cb=0.0722). Can you split? > --- > libswscale/swscale.h | 1 + > libswscale/yuv2rgb.c | 13 - > 2 files changed, 9 insertions(+), 5 deletions(-) > > diff --git a/libswscale/swscale.h b/libswscale/swscale.h > index da9dd2e..6b8b926 100644 > --- a/libswscale/swscale.h > +++ b/libswscale/swscale.h > @@ -91,6 +91,7 @@ const char *swscale_license(void); > #define SWS_CS_SMPTE170M 5 > #define SWS_CS_SMPTE240M 7 > #define SWS_CS_DEFAULT5 > +#define SWS_CS_BT2020 9 > probably requires micro or minor bump in version.h > /** > * Return a pointer to yuv<->rgb coefficients for the given colorspace > diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c > index 62abb7d..1fe5abe 100644 > --- a/libswscale/yuv2rgb.c > +++ b/libswscale/yuv2rgb.c > @@ -46,20 +46,23 @@ > * > * where Y = cr * R + cg * G + cb * B and cr + cg + cb = 1. > */ > -const int32_t ff_yuv2rgb_coeffs[8][4] = { > -{ 117504, 138453, 13954, 34903 }, /* no sequence_display_extension */ > -{ 117504, 138453, 13954, 34903 }, /* ITU-R Rec. 709 (1990) */ > +const int32_t ff_yuv2rgb_coeffs[11][4] = { > +{ 117489, 138438, 13975, 34925 }, /* no sequence_display_extension */ > +{ 117489, 138438, 13975, 34925 }, /* ITU-R Rec. 709 (1990) */ no FATE change? oO > { 104597, 132201, 25675, 53279 }, /* unspecified */ > { 104597, 132201, 25675, 53279 }, /* reserved */ > { 104448, 132798, 24759, 53109 }, /* FCC */ > { 104597, 132201, 25675, 53279 }, /* ITU-R Rec. 624-4 System B, G */ > { 104597, 132201, 25675, 53279 }, /* SMPTE 170M */ > -{ 117579, 136230, 16907, 35559 } /* SMPTE 240M (1987) */ > +{ 117579, 136230, 16907, 35559 }, /* SMPTE 240M (1987) */ > +{ 0 }, /* YCgCo */ why the empty entry? > +{ 110013, 140363, 12277, 42626 }, /* Bt-2020-NCL */ > +{ 110013, 140363, 12277, 42626 }, /* Bt-2020-CL */ > }; > > const int *sws_getCoefficients(int colorspace) > { > -if (colorspace > 7 || colorspace < 0) > +if (colorspace > 10 || colorspace < 0 || colorspace == 8) > colorspace = SWS_CS_DEFAULT; > return ff_yuv2rgb_coeffs[colorspace]; > } -- Clément B. signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] swscale cleanup
May I push the patch? 2016-03-28 16:21 GMT-03:00 Pedro Arthur : > It was a little typo, attached patch fixed. > > 2016-03-28 16:09 GMT-03:00 Michael Niedermayer : > >> On Mon, Mar 28, 2016 at 01:56:08PM -0300, Pedro Arthur wrote: >> > Hi, >> > >> > This patch removes the previous swscale code which where under the >> '#ifndef >> > NEW_FILTER'. >> > It also remove a few unused fields of SwsContext. >> > Seems it doesn't introduce any regression (passes all FATE tests) but it >> > would be better if someone could test it more. >> >> > input.c|2 >> > output.c | 40 ++--- >> > ppc/swscale_altivec.c |4 >> > slice.c|4 >> > swscale.c | 336 >> +++-- >> > swscale_internal.h | 10 - >> > utils.c| 78 --- >> > vscale.c |4 >> > x86/swscale.c | 38 + >> > x86/swscale_template.c | 12 - >> > 10 files changed, 65 insertions(+), 463 deletions(-) >> > fbdf78f3edb890f485d5bcfc2b3edf55465db1f5 sws_cleanup.patch >> > From d52cb0e25332a0327acdac89256beac4701f675a Mon Sep 17 00:00:00 2001 >> > From: Pedro Arthur >> > Date: Mon, 28 Mar 2016 13:25:18 -0300 >> > Subject: [PATCH] swscale: cleanup unused code >> > >> > Removed previous swscale code under '#ifndef NEW_FILTER' >> > and removed unused fields of SwsContext >> >> fails to build on x86-32 here >> >> libswscale/x86/swscale.c: In function ‘ff_sws_init_swscale_x86’: >> libswscale/x86/swscale.c:460:18: error: ‘SwsContext’ has no member named >> ‘needApha’ >> >> [...] >> >> -- >> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB >> >> The worst form of inequality is to try to make unequal things equal. >> -- Aristotle >> >> ___ >> ffmpeg-devel mailing list >> ffmpeg-devel@ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel >> >> > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] swscale cleanup
On Thu, Mar 31, 2016 at 04:00:22PM -0300, Pedro Arthur wrote: > May I push the patch? give me a moment, ill check if it builds on all archs i can easily test [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I have never wished to cater to the crowd; for what I know they do not approve, and what they approve I do not know. -- Epicurus signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] swscale: add bt2020 yuv2rgb coefficients.
Hi, On Thu, Mar 31, 2016 at 2:46 PM, Michael Niedermayer wrote: > On Thu, Mar 31, 2016 at 02:29:12PM -0400, Ronald S. Bultje wrote: > > Also fix the bt709 ones. They seem derived from incorrect values > > cr=0.2125 (should be cr=0.2126) and cb=0.0721 (should be cb=0.0722). > > --- > > libswscale/swscale.h | 1 + > > libswscale/yuv2rgb.c | 13 - > > 2 files changed, 9 insertions(+), 5 deletions(-) > > > > diff --git a/libswscale/swscale.h b/libswscale/swscale.h > > index da9dd2e..6b8b926 100644 > > --- a/libswscale/swscale.h > > +++ b/libswscale/swscale.h > > @@ -91,6 +91,7 @@ const char *swscale_license(void); > > #define SWS_CS_SMPTE170M 5 > > #define SWS_CS_SMPTE240M 7 > > #define SWS_CS_DEFAULT5 > > +#define SWS_CS_BT2020 9 > > > > /** > > * Return a pointer to yuv<->rgb coefficients for the given colorspace > > diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c > > index 62abb7d..1fe5abe 100644 > > --- a/libswscale/yuv2rgb.c > > +++ b/libswscale/yuv2rgb.c > > @@ -46,20 +46,23 @@ > > * > > * where Y = cr * R + cg * G + cb * B and cr + cg + cb = 1. > > */ > > -const int32_t ff_yuv2rgb_coeffs[8][4] = { > > -{ 117504, 138453, 13954, 34903 }, /* no sequence_display_extension > */ > > -{ 117504, 138453, 13954, 34903 }, /* ITU-R Rec. 709 (1990) */ > > +const int32_t ff_yuv2rgb_coeffs[11][4] = { > > missing update to libswscale/swscale_internal.h > > libswscale/yuv2rgb.c:49:15: error: conflicting types for > ‘ff_yuv2rgb_coeffs’ > libswscale/swscale_internal.h:869:22: note: previous declaration of > ‘ff_yuv2rgb_coeffs’ was here Sorry, will fix in next iteration. Ronald ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] swscale: add bt2020 yuv2rgb coefficients.
Hi, On Thu, Mar 31, 2016 at 2:51 PM, Clément Bœsch wrote: > On Thu, Mar 31, 2016 at 02:29:12PM -0400, Ronald S. Bultje wrote: > > Also fix the bt709 ones. They seem derived from incorrect values > > cr=0.2125 (should be cr=0.2126) and cb=0.0721 (should be cb=0.0722). > > Can you split? Sure > --- > > libswscale/swscale.h | 1 + > > libswscale/yuv2rgb.c | 13 - > > 2 files changed, 9 insertions(+), 5 deletions(-) > > > > diff --git a/libswscale/swscale.h b/libswscale/swscale.h > > index da9dd2e..6b8b926 100644 > > --- a/libswscale/swscale.h > > +++ b/libswscale/swscale.h > > @@ -91,6 +91,7 @@ const char *swscale_license(void); > > #define SWS_CS_SMPTE170M 5 > > #define SWS_CS_SMPTE240M 7 > > #define SWS_CS_DEFAULT5 > > +#define SWS_CS_BT2020 9 > > > > probably requires micro or minor bump in version.h Will do minor. > /** > > * Return a pointer to yuv<->rgb coefficients for the given colorspace > > diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c > > index 62abb7d..1fe5abe 100644 > > --- a/libswscale/yuv2rgb.c > > +++ b/libswscale/yuv2rgb.c > > @@ -46,20 +46,23 @@ > > * > > * where Y = cr * R + cg * G + cb * B and cr + cg + cb = 1. > > */ > > -const int32_t ff_yuv2rgb_coeffs[8][4] = { > > -{ 117504, 138453, 13954, 34903 }, /* no sequence_display_extension > */ > > -{ 117504, 138453, 13954, 34903 }, /* ITU-R Rec. 709 (1990) */ > > +const int32_t ff_yuv2rgb_coeffs[11][4] = { > > +{ 117489, 138438, 13975, 34925 }, /* no sequence_display_extension > */ > > +{ 117489, 138438, 13975, 34925 }, /* ITU-R Rec. 709 (1990) */ > > no FATE change? oO Didn't test :-D. I don't think this (colorspaces) is covered, but I'll run make fate to be sure. > { 104597, 132201, 25675, 53279 }, /* unspecified */ > > { 104597, 132201, 25675, 53279 }, /* reserved */ > > { 104448, 132798, 24759, 53109 }, /* FCC */ > > { 104597, 132201, 25675, 53279 }, /* ITU-R Rec. 624-4 System B, G */ > > { 104597, 132201, 25675, 53279 }, /* SMPTE 170M */ > > -{ 117579, 136230, 16907, 35559 } /* SMPTE 240M (1987) */ > > +{ 117579, 136230, 16907, 35559 }, /* SMPTE 240M (1987) */ > > > +{ 0 }, /* YCgCo */ > > why the empty entry? So the colorspaces indices (SWS_CS_*) match the respective entries in enum AVColorSpace (lavu/pixfmt.h). Ronald ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] swscale cleanup
On Thu, Mar 31, 2016 at 09:18:37PM +0200, Michael Niedermayer wrote: > On Thu, Mar 31, 2016 at 04:00:22PM -0300, Pedro Arthur wrote: > > May I push the patch? > > give me a moment, ill check if it builds on all archs i can easily test seems working fine no objections from me thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB You can kill me, but you cannot change the truth. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] swscale cleanup
patch pushed, thank you for testing. 2016-03-31 16:41 GMT-03:00 Michael Niedermayer : > On Thu, Mar 31, 2016 at 09:18:37PM +0200, Michael Niedermayer wrote: > > On Thu, Mar 31, 2016 at 04:00:22PM -0300, Pedro Arthur wrote: > > > May I push the patch? > > > > give me a moment, ill check if it builds on all archs i can easily test > > seems working fine > no objections from me > > thanks > > [...] > > -- > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB > > You can kill me, but you cannot change the truth. > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 1/2] swscale: fix bt709 yuv2rgb coefficients.
They were derived from incorrect values cr=0.2125 (should be cr=0.2126) and cb=0.0721 (should be cb=0.0722). --- libswscale/yuv2rgb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c index 62abb7d..a0242bf 100644 --- a/libswscale/yuv2rgb.c +++ b/libswscale/yuv2rgb.c @@ -47,8 +47,8 @@ * where Y = cr * R + cg * G + cb * B and cr + cg + cb = 1. */ const int32_t ff_yuv2rgb_coeffs[8][4] = { -{ 117504, 138453, 13954, 34903 }, /* no sequence_display_extension */ -{ 117504, 138453, 13954, 34903 }, /* ITU-R Rec. 709 (1990) */ +{ 117489, 138438, 13975, 34925 }, /* no sequence_display_extension */ +{ 117489, 138438, 13975, 34925 }, /* ITU-R Rec. 709 (1990) */ { 104597, 132201, 25675, 53279 }, /* unspecified */ { 104597, 132201, 25675, 53279 }, /* reserved */ { 104448, 132798, 24759, 53109 }, /* FCC */ -- 2.1.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 2/2] swscale: add bt2020 yuv2rgb coefficients.
--- libswscale/swscale.h | 1 + libswscale/swscale_internal.h | 2 +- libswscale/version.h | 2 +- libswscale/yuv2rgb.c | 9 ++--- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/libswscale/swscale.h b/libswscale/swscale.h index da9dd2e..6b8b926 100644 --- a/libswscale/swscale.h +++ b/libswscale/swscale.h @@ -91,6 +91,7 @@ const char *swscale_license(void); #define SWS_CS_SMPTE170M 5 #define SWS_CS_SMPTE240M 7 #define SWS_CS_DEFAULT5 +#define SWS_CS_BT2020 9 /** * Return a pointer to yuv<->rgb coefficients for the given colorspace diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index f0bab78..c5485c3 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -866,7 +866,7 @@ extern const uint8_t ff_dither_8x8_73[9][8]; extern const uint8_t ff_dither_8x8_128[9][8]; extern const uint8_t ff_dither_8x8_220[9][8]; -extern const int32_t ff_yuv2rgb_coeffs[8][4]; +extern const int32_t ff_yuv2rgb_coeffs[11][4]; extern const AVClass ff_sws_context_class; diff --git a/libswscale/version.h b/libswscale/version.h index 24908b8..ac6b4c8 100644 --- a/libswscale/version.h +++ b/libswscale/version.h @@ -27,7 +27,7 @@ #include "libavutil/version.h" #define LIBSWSCALE_VERSION_MAJOR 4 -#define LIBSWSCALE_VERSION_MINOR 0 +#define LIBSWSCALE_VERSION_MINOR 1 #define LIBSWSCALE_VERSION_MICRO 100 #define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \ diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c index a0242bf..1fe5abe 100644 --- a/libswscale/yuv2rgb.c +++ b/libswscale/yuv2rgb.c @@ -46,7 +46,7 @@ * * where Y = cr * R + cg * G + cb * B and cr + cg + cb = 1. */ -const int32_t ff_yuv2rgb_coeffs[8][4] = { +const int32_t ff_yuv2rgb_coeffs[11][4] = { { 117489, 138438, 13975, 34925 }, /* no sequence_display_extension */ { 117489, 138438, 13975, 34925 }, /* ITU-R Rec. 709 (1990) */ { 104597, 132201, 25675, 53279 }, /* unspecified */ @@ -54,12 +54,15 @@ const int32_t ff_yuv2rgb_coeffs[8][4] = { { 104448, 132798, 24759, 53109 }, /* FCC */ { 104597, 132201, 25675, 53279 }, /* ITU-R Rec. 624-4 System B, G */ { 104597, 132201, 25675, 53279 }, /* SMPTE 170M */ -{ 117579, 136230, 16907, 35559 } /* SMPTE 240M (1987) */ +{ 117579, 136230, 16907, 35559 }, /* SMPTE 240M (1987) */ +{ 0 }, /* YCgCo */ +{ 110013, 140363, 12277, 42626 }, /* Bt-2020-NCL */ +{ 110013, 140363, 12277, 42626 }, /* Bt-2020-CL */ }; const int *sws_getCoefficients(int colorspace) { -if (colorspace > 7 || colorspace < 0) +if (colorspace > 10 || colorspace < 0 || colorspace == 8) colorspace = SWS_CS_DEFAULT; return ff_yuv2rgb_coeffs[colorspace]; } -- 2.1.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] add attribution to OpenJPEG code in FFmpeg encoder j2kenc.c file
Hi Folks, Here is a patch to reference the OpenJPEG license from j2kenc.c, as per earlier discussion. Cheers, Aaron 0001-Add-attribution-to-OpenJPEG-project.patch Description: Binary data ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] Refund request for FFmpeg at CLT 2016
On 21.03.2016 21:49, Thilo Borgmann wrote: Am 21.03.16 um 20:42 schrieb Michael Niedermayer: On Mon, Mar 21, 2016 at 12:14:40PM +0100, Thilo Borgmann wrote: Hi, last weekend, the Chemnitzer Linux Tage in Germany took place and we had quite a good experience and contacts to our end-users. Here is my refund request for gas taking Carl Eugen and myself to the venue. I'll send the invoice to Stefano. It is 64,43€. please provide some more details like the distance driven or from what city to which city We went from Berlin to Chemnitz on Friday, back from Chemnitz to Berlin on Sunday - overall around 550km. Also Hotel<->Venue transfer. Thomas made some pictures, he payed for the hotel around 160€. I think he'll request refunds for that, too. Carl Eugen took a flight form Vienna to Berlin and vice versa, joined me in the car. I think he'll also request refunding for that. Thomas wanted to post some more details on the experience itself as soon as he can. Pictures from the event are now available on Facebook. Additionally, the used command lines for the live demos are listed there (some visitors asked for them). Best regards, Thomas. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] Introduce ff_bprint_to_codecpar_extradata for avformat
From: Hendrik Leppkes --- libavformat/internal.h | 7 +++ libavformat/utils.c| 23 +++ 2 files changed, 30 insertions(+) diff --git a/libavformat/internal.h b/libavformat/internal.h index 7defce8..cd390dd 100644 --- a/libavformat/internal.h +++ b/libavformat/internal.h @@ -22,6 +22,8 @@ #define AVFORMAT_INTERNAL_H #include + +#include "libavutil/bprint.h" #include "avformat.h" #include "os_support.h" @@ -596,4 +598,9 @@ int ff_reshuffle_raw_rgb(AVFormatContext *s, AVPacket **ppkt, AVCodecContext *en */ int ff_get_packet_palette(AVFormatContext *s, AVPacket *pkt, int ret, uint32_t *palette); +/** + * Finalize buf into extradata and set its size appropriately. + */ +int ff_bprint_to_codecpar_extradata(AVCodecParameters *par, struct AVBPrint *buf); + #endif /* AVFORMAT_INTERNAL_H */ diff --git a/libavformat/utils.c b/libavformat/utils.c index 3bd2df3..3bf96ad 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -4866,3 +4866,26 @@ int ff_get_packet_palette(AVFormatContext *s, AVPacket *pkt, int ret, uint32_t * return 0; } + +int ff_bprint_to_codecpar_extradata(AVCodecParameters *par, struct AVBPrint *buf) +{ +int ret; +char *str; + +ret = av_bprint_finalize(buf, &str); +if (ret < 0) +return ret; +if (!av_bprint_is_complete(buf)) { +av_free(str); +return AVERROR(ENOMEM); +} + +par->extradata = str; +/* Note: the string is NUL terminated (so extradata can be read as a + * string), but the ending character is not accounted in the size (in + * binary formats you are likely not supposed to mux that character). When + * extradata is copied, it is also padded with AV_INPUT_BUFFER_PADDING_SIZE + * zeros. */ +par->extradata_size = buf->len; +return 0; +} -- 2.8.0.rc3 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] psxstr: Remove some commented out code
Signed-off-by: Derek Buitenhuis --- libavformat/psxstr.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/libavformat/psxstr.c b/libavformat/psxstr.c index b57981a..38186f7 100644 --- a/libavformat/psxstr.c +++ b/libavformat/psxstr.c @@ -104,13 +104,7 @@ static int str_probe(AVProbeData *p) && sector_count*VIDEO_DATA_CHUNK_SIZE >=frame_size)){ return 0; } - -/*st->codec->width = AV_RL16(§or[0x28]); -st->codec->height = AV_RL16(§or[0x2A]);*/ - -// if (current_sector == sector_count-1) { -vid++; -// } +vid++; } break; -- 2.8.0.rc3 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] psxstr: Remove some commented out code
On 3/31/16, Derek Buitenhuis wrote: > Signed-off-by: Derek Buitenhuis > --- > libavformat/psxstr.c | 8 +--- > 1 file changed, 1 insertion(+), 7 deletions(-) > > diff --git a/libavformat/psxstr.c b/libavformat/psxstr.c > index b57981a..38186f7 100644 > --- a/libavformat/psxstr.c > +++ b/libavformat/psxstr.c > @@ -104,13 +104,7 @@ static int str_probe(AVProbeData *p) > && sector_count*VIDEO_DATA_CHUNK_SIZE >=frame_size)){ > return 0; > } > - > -/*st->codec->width = AV_RL16(§or[0x28]); > -st->codec->height = AV_RL16(§or[0x2A]);*/ > - > -// if (current_sector == sector_count-1) { > -vid++; > -// } > +vid++; > > } > break; > -- > 2.8.0.rc3 > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > lgtm ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/2] swscale: add bt2020 yuv2rgb coefficients.
On Thu, Mar 31, 2016 at 04:01:17PM -0400, Ronald S. Bultje wrote: > --- > libswscale/swscale.h | 1 + > libswscale/swscale_internal.h | 2 +- > libswscale/version.h | 2 +- > libswscale/yuv2rgb.c | 9 ++--- > 4 files changed, 9 insertions(+), 5 deletions(-) LGTM thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Its not that you shouldnt use gotos but rather that you should write readable code and code with gotos often but not always is less readable signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavfi: new colorspace conversion filter.
Hi, On Wed, Mar 30, 2016 at 4:35 PM, Ronald S. Bultje wrote: > The intent here is similar to colormatrix, but it's LGPLv2.1-or-later > (instead of GPLv2.0) and supports gamma/chromaticity correction. One of the things I'm not 100% happy with is that this is hard to set up, you need to set a lot of properties, and they are sort of mutually related. Would people want me to create a "merged" property that (if the specific ones are missing) allows you to set "all" variables to "bt709", "smpte170m", "smpte240m", "bt2020" (assuming ncl, and bitdepth of the trc depends on out_format), bt601-6-525, bt601-6-625, bt470m, bt470bg? I'm probably missing a few (see comments in pixfmt.h) but I believe these are the most important ones. Ronald ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] APNG encoder can work incorrectly
On 3/31/16, Dmitriy wrote: > I create a special video. You can download it using the link > > https://drive.google.com/file/d/0B8rMLdq9Vq55QmwwcVJDVkZoM1E/view?usp=sharing > > Convert it to .apng format with > ffmpeg -i apng_test.avi apng_test.apng > > The result file will be empty. > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > Could you provide patch? ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] fate: Add regression test for Ticket 1239
Signed-off-by: Michael Niedermayer --- tests/fate/real.mak |3 ++ tests/ref/fate/rv20-1239 | 91 ++ 2 files changed, 94 insertions(+) create mode 100644 tests/ref/fate/rv20-1239 diff --git a/tests/fate/real.mak b/tests/fate/real.mak index c123e44..f9073dd 100644 --- a/tests/fate/real.mak +++ b/tests/fate/real.mak @@ -20,6 +20,9 @@ fate-ra-cook: CMD = pcm -i $(TARGET_SAMPLES)/real/ra_cook.rm fate-ra-cook: CMP = oneoff fate-ra-cook: REF = $(SAMPLES)/real/ra_cook.pcm +FATE_REALMEDIA_VIDEO-$(call DEMDEC, RM, RV20) += fate-rv20-1239 +fate-rv20-1239: CMD = framecrc -flags +bitexact -idct simple -lowres 1 -i $(TARGET_SAMPLES)/real/G2_with_SVT_320_240.rm + FATE_REALMEDIA_VIDEO-$(call DEMDEC, RM, RV30) += fate-rv30 fate-rv30: CMD = framecrc -flags +bitexact -idct simple -i $(TARGET_SAMPLES)/real/rv30.rm -an diff --git a/tests/ref/fate/rv20-1239 b/tests/ref/fate/rv20-1239 new file mode 100644 index 000..1c3f546 --- /dev/null +++ b/tests/ref/fate/rv20-1239 @@ -0,0 +1,91 @@ +#tb 0: 1/15 +0, 0, 0,1,28800, 0xe41c0ee2 +0, 1, 1,1,28800, 0x08054520 +0, 2, 2,1,28800, 0x272b3ed7 +0, 3, 3,1,28800, 0x456551d0 +0, 4, 4,1,28800, 0x4f96457f +0, 5, 5,1,28800, 0x4e78568a +0, 6, 6,1,28800, 0xe79151f3 +0, 7, 7,1,28800, 0x6d7350d8 +0, 8, 8,1,28800, 0x397250b2 +0, 9, 9,1,28800, 0x518750ae +0, 10, 10,1,28800, 0x4bfa4aa2 +0, 11, 11,1,28800, 0x085a5490 +0, 12, 12,1,28800, 0x7da56e74 +0, 13, 13,1,28800, 0xfdd08146 +0, 14, 14,1,28800, 0x99c295bd +0, 15, 15,1,28800, 0xc8bc88f2 +0, 16, 16,1,28800, 0x986eaa72 +0, 17, 17,1,28800, 0xa3f9aa6f +0, 18, 18,1,28800, 0xc1b4bed4 +0, 19, 19,1,28800, 0xf9a767bb +0, 20, 20,1,28800, 0x72e6b420 +0, 21, 21,1,28800, 0x30e7eabd +0, 22, 22,1,28800, 0xca100206 +0, 23, 23,1,28800, 0xe433f7b9 +0, 24, 24,1,28800, 0x1f70f4f2 +0, 25, 25,1,28800, 0x2e58f182 +0, 26, 26,1,28800, 0x4514cca8 +0, 27, 27,1,28800, 0xc0e1e144 +0, 28, 28,1,28800, 0x1a79e36a +0, 29, 29,1,28800, 0x0729de0b +0, 30, 30,1,28800, 0xd61ccbb1 +0, 31, 31,1,28800, 0x877aa65d +0, 32, 32,1,28800, 0x7cabbc37 +0, 33, 33,1,28800, 0x6591b87c +0, 34, 34,1,28800, 0x097dd8bc +0, 35, 35,1,28800, 0xa4549f78 +0, 36, 36,1,28800, 0x109f91ef +0, 37, 37,1,28800, 0x96a2c41b +0, 38, 38,1,28800, 0x3b71e985 +0, 39, 39,1,28800, 0xbb76ff57 +0, 40, 40,1,28800, 0x26701ae1 +0, 41, 41,1,28800, 0x9da03e9b +0, 42, 42,1,28800, 0x58fc3d9a +0, 43, 43,1,28800, 0x67947735 +0, 44, 44,1,28800, 0x3961cea4 +0, 45, 45,1,28800, 0x68fe0f3a +0, 46, 46,1,28800, 0x6623d61f +0, 47, 47,1,28800, 0x7df2c4ff +0, 48, 48,1,28800, 0xe9b9eaa6 +0, 49, 49,1,28800, 0xeec8c115 +0, 50, 50,1,28800, 0xbfd96ba4 +0, 51, 51,1,28800, 0x4d6dff71 +0, 52, 52,1,28800, 0x3ffbd6fe +0, 53, 53,1,28800, 0x7aa5e42e +0, 54, 54,1,28800, 0x4d05cf80 +0, 55, 55,1,28800, 0x9fb3b152 +0, 56, 56,1,28800, 0xc62b05b2 +0, 57, 57,1,28800, 0x82a2e7dd +0, 58, 58,1,28800, 0x4611b76f +0, 59, 59,1,28800, 0xc7f5acee +0, 60, 60,1,28800, 0x19149cc8 +0, 61, 61,1,28800, 0xe97d5933 +0, 62, 62,1,28800, 0x92960b73 +0, 63, 63,1,28800, 0x2369d90f +0, 64, 64,1,28800, 0x1d58d518 +0, 65, 65,1,28800, 0x2b29b6ee +0, 66, 66,1,2
[FFmpeg-devel] [PATCH] fate: Test for Ticket4560
Signed-off-by: Michael Niedermayer --- tests/fate/filter-video.mak |9 ++ tests/ref/fate/filter-meta-4560-rotate0 | 259 +++ 2 files changed, 268 insertions(+) create mode 100644 tests/ref/fate/filter-meta-4560-rotate0 diff --git a/tests/fate/filter-video.mak b/tests/fate/filter-video.mak index 18c856d..7fb7677 100644 --- a/tests/fate/filter-video.mak +++ b/tests/fate/filter-video.mak @@ -620,6 +620,15 @@ FATE_METADATA_FILTER-$(call ALLYES, $(EBUR128_METADATA_DEPS)) += fate-filter-met fate-filter-metadata-ebur128: SRC = $(TARGET_SAMPLES)/filter/seq-3341-7_seq-3342-5-24bit.flac fate-filter-metadata-ebur128: CMD = run $(FILTER_METADATA_COMMAND) "amovie='$(SRC)',ebur128=metadata=1" +tests/data/file4560-override2rotate0.mov: TAG = GEN +tests/data/file4560-override2rotate0.mov: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data + $(M)$(TARGET_EXEC) $(TARGET_PATH)/$< \ + -i $(TARGET_SAMPLES)/filter/sample-in-issue-505.mov -c copy -flags +bitexact -metadata:s:v:0 rotate=0 $(TARGET_PATH)/$@ -y 2>/dev/null + +FATE_AFILTER-$(call ALLYES, MOV_DEMUXER MOV_MUXER) += fate-filter-meta-4560-rotate0 +fate-filter-meta-4560-rotate0: tests/data/file4560-override2rotate0.mov +fate-filter-meta-4560-rotate0: CMD = framecrc -flags +bitexact -i $(TARGET_PATH)/tests/data/file4560-override2rotate0.mov + FATE_SAMPLES_FFPROBE += $(FATE_METADATA_FILTER-yes) fate-vfilter: $(FATE_FILTER-yes) $(FATE_FILTER_VSYNTH-yes) diff --git a/tests/ref/fate/filter-meta-4560-rotate0 b/tests/ref/fate/filter-meta-4560-rotate0 new file mode 100644 index 000..e0607dd --- /dev/null +++ b/tests/ref/fate/filter-meta-4560-rotate0 @@ -0,0 +1,259 @@ +#tb 0: 1/30 +#tb 1: 1/44100 +0, 0, 0,1, 195840, 0x0602351d +1, 0, 0, 1024, 2048, 0x +1, 1024, 1024, 1024, 2048, 0x456011fa +0, 1, 1,1, 195840, 0xcad55625 +1, 2048, 2048, 1024, 2048, 0x930b068a +0, 2, 2,1, 195840, 0x1a47a5ca +1, 3072, 3072, 1024, 2048, 0xcd35a7ce +1, 4096, 4096, 1024, 2048, 0x3f846a1e +0, 3, 3,1, 195840, 0x5cd02d7c +1, 5120, 5120, 1024, 2048, 0x59795fd0 +0, 4, 4,1, 195840, 0x07d08f16 +1, 6144, 6144, 1024, 2048, 0x97ed96ed +1, 7168, 7168, 1024, 2048, 0xb31e2c2a +0, 5, 5,1, 195840, 0xe8abf6dd +1, 8192, 8192, 1024, 2048, 0xd409cd68 +0, 6, 6,1, 195840, 0x096a5c58 +1, 9216, 9216, 1024, 2048, 0xbb0f8b20 +1, 10240, 10240, 1024, 2048, 0xe083ac47 +0, 7, 7,1, 195840, 0x4e1a17bd +1, 11264, 11264, 1024, 2048, 0x63d6813d +0, 8, 8,1, 195840, 0x96349c20 +1, 12288, 12288, 1024, 2048, 0x8e9d8349 +0, 9, 9,1, 195840, 0x6bb16907 +1, 13312, 13312, 1024, 2048, 0xa4248a45 +1, 14336, 14336, 1024, 2048, 0x169b8cf7 +0, 10, 10,1, 195840, 0x7e44e4dd +1, 15360, 15360, 1024, 2048, 0x2bdc7454 +0, 11, 11,1, 195840, 0x4c3c0cf1 +1, 16384, 16384, 1024, 2048, 0x22e87581 +1, 17408, 17408, 1024, 2048, 0x86377277 +0, 12, 12,1, 195840, 0x4f2e3f2d +1, 18432, 18432, 1024, 2048, 0x1a9f5ff8 +0, 13, 13,1, 195840, 0xcba539cd +1, 19456, 19456, 1024, 2048, 0x77be49e3 +1, 20480, 20480, 1024, 2048, 0xa66c7183 +0, 14, 14,1, 195840, 0xf2811c9b +1, 21504, 21504, 1024, 2048, 0xc5166453 +0, 15, 15,1, 195840, 0x8357eab2 +1, 22528, 22528, 1024, 2048, 0x5f888a53 +0, 16, 16,1, 195840, 0xdba9c438 +1, 23552, 23552, 1024, 2048, 0xa9a36e11 +1, 24576, 24576, 1024, 2048, 0xa3df67f7 +0, 17, 17,1, 195840, 0x58bcb594 +1, 25600, 25600, 1024, 2048, 0xcbb13f33 +0, 18, 18,1, 195840, 0x3edc5a1c +1, 26624, 26624, 1024, 2048, 0x70ed8364 +1, 27648, 27648, 1024, 2048, 0xdb3e9d70 +0, 19, 19,1, 195840, 0x94e4c186 +1, 28672, 28672, 1024, 2048, 0x71f883e9 +0, 20, 20,1, 195840, 0xffad5f59 +1, 29696, 29696, 1024, 2048, 0x90ed97a8 +1, 30720, 30720, 1024, 2048, 0x072ea78e +0, 21, 21,1, 195840, 0x84d1b114 +1, 31744, 31744, 1024, 2048, 0x9b127ba5 +0, 22, 22,1, 195840, 0x358c1d0a +1, 32768, 32768, 1
[FFmpeg-devel] codecpar regressions
Hi from #ffmpeg-devel im not doing any fixes today though, im beat. ... michaelni, if im not around mail me them, or putthem on github or something i found another regression, thought "here" is a good "something" that way more people can search for and fix regressions heres one regression: ./ffmpeg -i Broadway-5.1-48khz-448kbit.ac3 -t 10 out.wav ./ffmpeg-codecpar-2016-0331-23 -i Broadway-5.1-48khz-448kbit.ac3 -t 10 out-codecpar.wav ls -alF out-codecpar.wav out.wav -rw-r- 1 michael michael 6681702 Apr 1 01:38 out-codecpar.wav -rw-r- 1 michael michael 5760102 Apr 1 01:38 out.wav the codecpar case also fills the screen with Non-monotonous DTS in output stream 0:0; previous: 75264, current: 66048; changing to 75264. This may result in incorrect timestamps in the output file warnings not yet rebased onto origin tree used for the testing: https://github.com/dwbuiten/FFmpeg/tree/codecpar PS: i suggest to wait at least 48h with no new regressions being found before this is pushed, its a exceptionally large merge -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Never trust a computer, one day, it may think you are the virus. -- Compn signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] lavfi: new colorspace conversion filter.
The intent here is similar to colormatrix, but it's LGPLv2.1-or-later (instead of GPLv2.0) and supports gamma/chromaticity correction. --- doc/filters.texi | 183 +++ libavfilter/Makefile | 1 + libavfilter/allfilters.c | 1 + libavfilter/colorspacedsp.c | 130 + libavfilter/colorspacedsp.h | 51 ++ libavfilter/colorspacedsp_template.c | 256 ++ libavfilter/vf_colorspace.c | 909 +++ 7 files changed, 1531 insertions(+) create mode 100644 libavfilter/colorspacedsp.c create mode 100644 libavfilter/colorspacedsp.h create mode 100644 libavfilter/colorspacedsp_template.c create mode 100644 libavfilter/vf_colorspace.c diff --git a/doc/filters.texi b/doc/filters.texi index 528e0f8..93b260b 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -4888,6 +4888,189 @@ For example to convert from BT.601 to SMPTE-240M, use the command: colormatrix=bt601:smpte240m @end example +@section colorspace + +Convert colorspace, transfer characteristics or color primaries. + +The filter accepts the following options: + +@table @option +@item all +Specify all color properties at once. + +The accepted values are: +@table @samp +@item bt470m +BT.470M + +@item bt470bg +BT.470BG + +@item bt601-6-525 +BT.601-6 525 + +@item bt601-6-625 +BT.601-6 625 + +@item bt709 +BT.709 + +@item smpte170m +SMPTE-170M + +@item smpte240m +SMPTE-240M + +@item bt2020 +BT.2020 + +@end table + +@item space +Specify output colorspace. + +The accepted values are: +@table @samp +@item bt709 +BT.709 + +@item fcc +FCC + +@item bt470bg +BT.470BG or BT.601-6 625 + +@item smpte170m +SMPTE-170M or BT.601-6 525 + +@item smpte240m +SMPTE-240M + +@item bt2020ncl +BT.2020 with non-constant luminance + +@end table + +@item trc +Specify output transfer characteristics. + +The accepted values are: +@table @samp +@item bt709 +BT.709 + +@item gamma22 +Constant gamma of 2.2 + +@item gamma28 +Constant gamma of 2.8 + +@item smpte170m +SMPTE-170M, BT.601-6 625 or BT.601-6 525 + +@item smpte240m +SMPTE-240M + +@item bt2020-10 +BT.2020 for 10-bits content + +@item bt2020-12 +BT.2020 for 12-bits content + +@end table + +@item prm +Specify output color primaries. + +The accepted values are: +@table @samp +@item bt709 +BT.709 + +@item bt470m +BT.470M + +@item bt470bg +BT.470BG or BT.601-6 625 + +@item smpte170m +SMPTE-170M or BT.601-6 525 + +@item smpte240m +SMPTE-240M + +@item bt2020 +BT.2020 + +@end table + +@item rng +Specify output color range. + +The accepted values are: +@table @samp +@item mpeg +MPEG (restricted) range + +@item jpeg +JPEG (full) range + +@end table + +@item format +Specify output color format. + +The accepted values are: +@table @samp +@item yuv420p +YUV 4:2:0 planar 8-bits + +@item yuv420p +YUV 4:2:0 planar 10-bits + +@item yuv420p +YUV 4:2:0 planar 12-bits + +@item yuv420p +YUV 4:2:2 planar 8-bits + +@item yuv420p +YUV 4:2:2 planar 10-bits + +@item yuv420p +YUV 4:2:2 planar 12-bits + +@item yuv420p +YUV 4:4:4 planar 8-bits + +@item yuv420p +YUV 4:4:4 planar 10-bits + +@item yuv420p +YUV 4:4:4 planar 12-bits + +@end table + +@item fast +Do a fast conversion, which skips gamma/primary correction. This will take +significantly less CPU, but will be mathematically incorrect. To get output +compatible with that produced by the colormatrix filter, use fast=1. +@end table + +The filter converts the transfer characteristics, color space and color +primaries to the specified user values. The output value, if not specified, +is set to a default value based on the "all" property. If that property is +also not specified, the filter will log an error. The output color range and +format default to the same value as the input color range and format. The +input transfer characteristics, color space, color primaries and color range +should be set on the input data. If any of these are missing, the filter will +log an error and no conversion will take place. + +For example to convert the input to SMPTE-240M, use the command: +@example +colorspace=smpte240m +@end example + @section convolution Apply convolution 3x3 or 5x5 filter. diff --git a/libavfilter/Makefile b/libavfilter/Makefile index b6e1999..9b7546d 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -131,6 +131,7 @@ OBJS-$(CONFIG_COLORCHANNELMIXER_FILTER) += vf_colorchannelmixer.o OBJS-$(CONFIG_COLORKEY_FILTER) += vf_colorkey.o OBJS-$(CONFIG_COLORLEVELS_FILTER)+= vf_colorlevels.o OBJS-$(CONFIG_COLORMATRIX_FILTER)+= vf_colormatrix.o +OBJS-$(CONFIG_COLORSPACE_FILTER) += vf_colorspace.o colorspacedsp.o OBJS-$(CONFIG_CONVOLUTION_FILTER)+= vf_convolution.o OBJS-$(CONFIG_COPY_FILTER) += vf_copy.o OBJS-$(CONFIG_COREIMAGE_FILTER) += vf_coreimage.o diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index 5c18fd1..3fc450f 100644 --- a/libavfilter/allfilter
Re: [FFmpeg-devel] [PATCH] added support for hardware assist H264 video encoding for the Raspberry Pi
I am not a lawyer… I updated the patch. vc264.c now has a the copyright notice embedded in a volatile global so if a binary is compiled against vc264.o , the copyright notice can be displayed by: strings ffmpeg | grep -i copyright LICENSE.md has been updated to include Broadcom’s copyright notice. A distribution of a binary that includes vc264.o should include LICENSE.md and if that is missing, the copyright notice can be displayed via the shell command ‘strings’ . Amancio c-0001-added-support-for-hardware-assist-H264-video-encodin.patch Description: Binary data > On Mar 22, 2016, at 12:12 PM, Lou Logan wrote: > > On Mon, 21 Mar 2016 20:07:01 -0700, Amancio Hasty wrote: > >> From 874a72eec2a78f4935fea091003e534b5f8d5413 Mon Sep 17 00:00:00 2001 >> From: Amancio Hasty >> Date: Mon, 21 Mar 2016 18:56:05 -0700 >> Subject: [PATCH] added support for hardware assist H264 video encoding for >> the Raspberry Pi >> >> --- >> configure | 12 ++ >> libavcodec/Makefile| 1 + >> libavcodec/allcodecs.c | 2 + >> libavcodec/vc264.c | 387 >> + >> 4 files changed, 402 insertions(+) >> create mode 100644 libavcodec/vc264.c >> > [...] >> diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c >> index 2a25d66..3c7bd9b 100644 >> --- a/libavcodec/allcodecs.c >> +++ b/libavcodec/allcodecs.c >> @@ -74,6 +74,7 @@ void avcodec_register_all(void) >> initialized = 1; >> > > Nit: Whitespace on the line above should be removed. > > [...] >> --- /dev/null >> +++ b/libavcodec/vc264.c >> @@ -0,0 +1,387 @@ >> +/* H.264 hardware assist video encoding code taken from >> + * raspberry's os : >> + * /opt/vc/src/hello_pi/hello_encode/encode.c >> + */ >> + >> +/* >> +Copyright (c) 2012, Broadcom Europe Ltd >> +Copyright (c) 2012, Kalle Vahlman >> +Tuomas Kulve >> +All rights reserved. >> + >> +Redistribution and use in source and binary forms, with or without >> +modification, are permitted provided that the following conditions are met: >> +* Redistributions of source code must retain the above copyright >> + notice, this list of conditions and the following disclaimer. >> + * Redistributions in binary form must reproduce the above copyright >> + notice, this list of conditions and the following disclaimer in the >> + documentation and/or other materials provided with the distribution. >> + * Neither the name of the copyright holder nor the >> + names of its contributors may be used to endorse or promote products >> + derived from this software without specific prior written permission. >> + >> +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" >> AND >> +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >> IMPLIED >> +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >> +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE >> LIABLE FOR ANY >> +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES >> +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; >> +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND >> +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >> +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF >> THIS >> +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > > I wonder if any of the above legalese is compatible. Granted, I see a > similar paragraph in "libavformat/aadec.c". > >> + * ffmpeg driver for hardware assist video H.264 encoding using Broadcom's >> GPU >> + * Copyright (C) 2016 Amancio Hasty aha...@gmail.com >> + * >> + * >> + * 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 >> + * version 2.1 of the License, or (at your option) any later version. >> + * >> + * FFmpeg is distributed in the hope that it will be useful, >> + * but WITHOUT ANY WARRANTY; without even the implied warranty of >> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >> + * Lesser General Public License for more details. >> + * >> + * You should have received a copy of the GNU Lesser General Public >> + * License along with FFmpeg; if not, write to the Free Software >> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 >> USA >> + * >> + */ >> + >> + >> +/** >> + * @ file vc264.c >> + * Broadcom bm2865's Visual Core hardware assist h264 using >> + openMax interface to the GPU. >> + >> +*/ >> + >> +#include >> +#include >> +#include >> +#define OMX_SKIP64BIT >> +#include "bcm_host.h" >> +#include "ilclient.h" >> +#include "avcodec.h" >> +#include "internal.h" >> + >> +typedef struct VC264Context { >> + OMX_VIDEO_PARAM_PORTFORMATTYPE
Re: [FFmpeg-devel] [PATCH 2/6] lavc/audiotoolboxenc: fix a number of config issues
Merge please On Mon, Mar 28, 2016 at 1:20 AM, Rodger Combs wrote: > - size variables were used in a confusing way > - incorrect size var use led to channel layouts not being set properly > - channel layouts were incorrectly mapped for >2-channel AAC > - bitrates not accepted by the encoder were discarded instead of being > clamped > - some minor style/indentation fixes > --- > libavcodec/audiotoolboxenc.c | 198 > ++- > 1 file changed, 176 insertions(+), 22 deletions(-) > > diff --git a/libavcodec/audiotoolboxenc.c b/libavcodec/audiotoolboxenc.c > index 4797b2a..22352da 100644 > --- a/libavcodec/audiotoolboxenc.c > +++ b/libavcodec/audiotoolboxenc.c > @@ -146,6 +146,86 @@ static int get_ilbc_mode(AVCodecContext *avctx) > return 30; > } > > +static av_cold int get_channel_label(int channel) > +{ > +uint64_t map = 1 << channel; > +if (map <= AV_CH_LOW_FREQUENCY) > +return channel + 1; > +else if (map <= AV_CH_BACK_RIGHT) > +return channel + 29; > +else if (map <= AV_CH_BACK_CENTER) > +return channel - 1; > +else if (map <= AV_CH_SIDE_RIGHT) > +return channel - 4; > +else if (map <= AV_CH_TOP_BACK_RIGHT) > +return channel + 1; > +else if (map <= AV_CH_STEREO_RIGHT) > +return -1; > +else if (map <= AV_CH_WIDE_RIGHT) > +return channel + 4; > +else if (map <= AV_CH_SURROUND_DIRECT_RIGHT) > +return channel - 23; > +else if (map == AV_CH_LOW_FREQUENCY_2) > +return kAudioChannelLabel_LFE2; > +else > +return -1; > +} > + > +static int remap_layout(AudioChannelLayout *layout, uint64_t in_layout, > int count) > +{ > +int i; > +int c = 0; > +layout->mChannelLayoutTag = > kAudioChannelLayoutTag_UseChannelDescriptions; > +layout->mNumberChannelDescriptions = count; > +for (i = 0; i < count; i++) { > +int label; > +while (!(in_layout & (1 << c)) && c < 64) > +c++; > +if (c == 64) > +return AVERROR(EINVAL); // This should never happen > +label = get_channel_label(c); > +layout->mChannelDescriptions[i].mChannelLabel = label; > +if (label < 0) > +return AVERROR(EINVAL); > +c++; > +} > +return 0; > +} > + > +static int get_aac_tag(uint64_t in_layout) > +{ > +switch (in_layout) { > +case AV_CH_LAYOUT_MONO: > +return kAudioChannelLayoutTag_Mono; > +case AV_CH_LAYOUT_STEREO: > +return kAudioChannelLayoutTag_Stereo; > +case AV_CH_LAYOUT_QUAD: > +return kAudioChannelLayoutTag_AAC_Quadraphonic; > +case AV_CH_LAYOUT_OCTAGONAL: > +return kAudioChannelLayoutTag_AAC_Octagonal; > +case AV_CH_LAYOUT_SURROUND: > +return kAudioChannelLayoutTag_AAC_3_0; > +case AV_CH_LAYOUT_4POINT0: > +return kAudioChannelLayoutTag_AAC_4_0; > +case AV_CH_LAYOUT_5POINT0: > +return kAudioChannelLayoutTag_AAC_5_0; > +case AV_CH_LAYOUT_5POINT1: > +return kAudioChannelLayoutTag_AAC_5_1; > +case AV_CH_LAYOUT_6POINT0: > +return kAudioChannelLayoutTag_AAC_6_0; > +case AV_CH_LAYOUT_6POINT1: > +return kAudioChannelLayoutTag_AAC_6_1; > +case AV_CH_LAYOUT_7POINT0: > +return kAudioChannelLayoutTag_AAC_7_0; > +case AV_CH_LAYOUT_7POINT1_WIDE_BACK: > +return kAudioChannelLayoutTag_AAC_7_1; > +case AV_CH_LAYOUT_7POINT1: > +return kAudioChannelLayoutTag_MPEG_7_1_C; > +default: > +return 0; > +} > +} > + > static av_cold int ffat_init_encoder(AVCodecContext *avctx) > { > ATDecodeContext *at = avctx->priv_data; > @@ -170,11 +250,12 @@ static av_cold int ffat_init_encoder(AVCodecContext > *avctx) > .mFormatID = ffat_get_format_id(avctx->codec_id, avctx->profile), > .mChannelsPerFrame = in_format.mChannelsPerFrame, > }; > -AudioChannelLayout channel_layout = { > -.mChannelLayoutTag = kAudioChannelLayoutTag_UseChannelBitmap, > -.mChannelBitmap = avctx->channel_layout, > -}; > -UInt32 size = sizeof(channel_layout); > +UInt32 layout_size = sizeof(AudioChannelLayout) + > + sizeof(AudioChannelDescription) * > avctx->channels; > +AudioChannelLayout *channel_layout = av_malloc(layout_size); > + > +if (!channel_layout) > +return AVERROR(ENOMEM); > > if (avctx->codec_id == AV_CODEC_ID_ILBC) { > int mode = get_ilbc_mode(avctx); > @@ -186,22 +267,45 @@ static av_cold int ffat_init_encoder(AVCodecContext > *avctx) > > if (status != 0) { > av_log(avctx, AV_LOG_ERROR, "AudioToolbox init error: %i\n", > (int)status); > +av_free(channel_layout); > return AVERROR_UNKNOWN; > } > > -size = sizeof(UInt32); > +if (!avctx->channel_layout) > +avctx->channel_layout = > av_get_default_channel_layout(avctx->channels); > + > +if ((status = remap_layout(channel_layout, avc