Re: [FFmpeg-devel] [PATCH] Port mp=eq/eq2 to FFmpeg
On 1/19/15, arwa arif wrote: > On Mon, Jan 19, 2015 at 8:53 PM, Stefano Sabatini > wrote: > >> On date Monday 2015-01-19 15:20:54 +0100, Clement Boesch encoded: >> > On Mon, Jan 19, 2015 at 02:09:33PM +, Paul B Mahol wrote: >> > > On 1/18/15, arwa arif wrote: >> > > > Attached the patch. >> > > > >> > > >> > > I'm for dropping eq code and rename eq2 to eq. >> > >> > Yes please let's not add 2 filters for this, it's insane. Also, "eq" is >> > quite a bad name, but well... >> > >> >> > What happened to the idea of having the feature in hue instead? >> >> I'm not against that if we agree it's a better path. >> >> About eq/eq2, are there really performance concerns for having both of >> them? >> >> Arwa, can you show some benchmarks? >> > > The benchmark result for a demo video for > > 1.) eq filter: > > frame= 4690 fps=120 q=31.0 Lsize= 16788kB time=00:03:07.64 bitrate= > 732.9kbits/s > video:7828kB audio:8796kB subtitle:0kB other streams:0kB global headers:0kB > muxing overhead: 0.983091% > bench: utime=45.871s > bench: maxrss=19420kB > > > 2.) eq2 filter: > > frame= 4690 fps=110 q=31.0 Lsize= 16788kB time=00:03:07.64 bitrate= > 732.9kbits/s > video:7828kB audio:8796kB subtitle:0kB other streams:0kB global headers:0kB > muxing overhead: 0.983091% > bench: utime=51.475s > bench: maxrss=19920kB That is strange considering they share same code. > > >> -- >> FFmpeg = Fiendish Free Majestic Philosophical Ermetic Gem >> ___ >> 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 mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] Adding Closed caption in nut muxer
On 01/13/2015 06:50 PM, Michael Niedermayer wrote: On Tue, Jan 13, 2015 at 12:00:36PM +0100, Nicolas George wrote: Le quartidi 24 nivôse, an CCXXIII, Anshul a écrit : Please find attachment. Using this people can also mux cc608 stream in nut muxer IIRC, you need to submit a patch to libnut before, because it holds the official list of codes. libnut is an implementation of teh nut spec the nut spec is at svn://svn.mplayerhq.hu/nut see docs/nut4cc.txt also: https://lists.mplayerhq.hu/mailman/listinfo/nut-devel to add a new fourcc code to nut, send a patch that changes docs/nut4cc.txt to nut-devel I have subscribed the list, but it is still not confirmed yet. So things are in process. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] Post-processing filter Documentation
On date Monday 2015-01-19 04:41:37 +0530, Arwa Arif encoded: [...] http://trac.ffmpeg.org/wiki/Postprocessing [...] > Updated. Any comment on the images? Still missing benchmarks and pp filter covering. About the reference images, I think it would be useful to show the uncompressed original, and use FFmpeg to encode it (rather than xvid/Gimp), so that the whole sequence can be easily reproduced using only FFmpeg tools. -- FFmpeg = Friendly & Funny Most Programmable Enhancing Gadget ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [FFmpeg-cvslog] Adding Closed caption Support
On 01/13/2015 01:15 PM, Clément Bœsch wrote: On Tue, Jan 13, 2015 at 08:12:10AM +0100, Clément Bœsch wrote: On Tue, Jan 13, 2015 at 11:26:06AM +0530, Anshul Maheshwari wrote: [...] Also added roll-up functionality. patch is attached. Thanks Anshul Attaching patch From ca66e917f45bd47dd797930423d488fa9c781c4c Mon Sep 17 00:00:00 2001 From: Anshul Maheshwari Date: Mon, 12 Jan 2015 06:21:18 -0800 Subject: [PATCH] Addig Rollup functionality Signed-off-by: Anshul Maheshwari --- libavcodec/ccaption_dec.c | 222 +- 1 file changed, 140 insertions(+), 82 deletions(-) Please split your changes. One patch for the cosmetics One patch for the CHAR_DEBUG/av_dlog One patch for the addition of av_log One patch for the reflow of init_decoder() One patch for the roll-up functionality One patchset to rule them all. Thank you. hint: git add -p is your friend Thanks still learning it, most of the time git say patch cant be applied. Attached all patch. -Anshul >From 9c0e055165988ce3d5dfe4734d3736ec01da7b1c Mon Sep 17 00:00:00 2001 From: Anshul Maheshwari Date: Tue, 20 Jan 2015 15:51:23 +0530 Subject: [PATCH 1/8] Cosmetic changes in cc_caption Signed-off-by: Anshul Maheshwari --- libavcodec/ccaption_dec.c | 88 ++- 1 file changed, 49 insertions(+), 39 deletions(-) diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c index e05468f..1f2dfe6 100644 --- a/libavcodec/ccaption_dec.c +++ b/libavcodec/ccaption_dec.c @@ -27,9 +27,9 @@ #define SCREEN_ROWS 15 #define SCREEN_COLUMNS 32 -#define SET_FLAG(var, val) ( var |= ( 1 << (val) ) ) -#define UNSET_FLAG(var, val) ( var &= ~( 1 << (val)) ) -#define CHECK_FLAG(var, val) ( (var) & (1 << (val) ) ) +#define SET_FLAG(var, val) ( (var) |= ( 1 << (val)) ) +#define UNSET_FLAG(var, val) ( (var) &= ~( 1 << (val)) ) +#define CHECK_FLAG(var, val) ( (var) &( 1 << (val)) ) /* * TODO list @@ -44,8 +44,7 @@ enum cc_mode { CCMODE_TEXT, }; -enum cc_color_code -{ +enum cc_color_code { CCCOL_WHITE, CCCOL_GREEN, CCCOL_BLUE, @@ -58,8 +57,7 @@ enum cc_color_code CCCOL_TRANSPARENT, }; -enum cc_font -{ +enum cc_font { CCFONT_REGULAR, CCFONT_ITALICS, CCFONT_UNDERLINED, @@ -68,40 +66,41 @@ enum cc_font static const unsigned char pac2_attribs[][3] = // Color, font, ident { -{ CCCOL_WHITE, CCFONT_REGULAR, 0 }, // 0x40 || 0x60 -{ CCCOL_WHITE, CCFONT_UNDERLINED, 0 }, // 0x41 || 0x61 -{ CCCOL_GREEN, CCFONT_REGULAR, 0 }, // 0x42 || 0x62 -{ CCCOL_GREEN, CCFONT_UNDERLINED, 0 }, // 0x43 || 0x63 -{ CCCOL_BLUE, CCFONT_REGULAR, 0 }, // 0x44 || 0x64 -{ CCCOL_BLUE, CCFONT_UNDERLINED, 0 }, // 0x45 || 0x65 -{ CCCOL_CYAN, CCFONT_REGULAR, 0 }, // 0x46 || 0x66 -{ CCCOL_CYAN, CCFONT_UNDERLINED, 0 }, // 0x47 || 0x67 -{ CCCOL_RED, CCFONT_REGULAR, 0 }, // 0x48 || 0x68 -{ CCCOL_RED, CCFONT_UNDERLINED, 0 }, // 0x49 || 0x69 -{ CCCOL_YELLOW, CCFONT_REGULAR, 0 }, // 0x4a || 0x6a -{ CCCOL_YELLOW, CCFONT_UNDERLINED, 0 }, // 0x4b || 0x6b -{ CCCOL_MAGENTA, CCFONT_REGULAR, 0 }, // 0x4c || 0x6c -{ CCCOL_MAGENTA, CCFONT_UNDERLINED, 0 }, // 0x4d || 0x6d -{ CCCOL_WHITE, CCFONT_ITALICS, 0 }, // 0x4e || 0x6e -{ CCCOL_WHITE, CCFONT_UNDERLINED_ITALICS, 0 }, // 0x4f || 0x6f -{ CCCOL_WHITE, CCFONT_REGULAR, 0 }, // 0x50 || 0x70 -{ CCCOL_WHITE, CCFONT_UNDERLINED, 0 }, // 0x51 || 0x71 -{ CCCOL_WHITE, CCFONT_REGULAR, 4 }, // 0x52 || 0x72 -{ CCCOL_WHITE, CCFONT_UNDERLINED, 4 }, // 0x53 || 0x73 -{ CCCOL_WHITE, CCFONT_REGULAR, 8 }, // 0x54 || 0x74 -{ CCCOL_WHITE, CCFONT_UNDERLINED, 8 }, // 0x55 || 0x75 -{ CCCOL_WHITE, CCFONT_REGULAR, 12 }, // 0x56 || 0x76 -{ CCCOL_WHITE, CCFONT_UNDERLINED, 12 }, // 0x57 || 0x77 -{ CCCOL_WHITE, CCFONT_REGULAR, 16 }, // 0x58 || 0x78 -{ CCCOL_WHITE, CCFONT_UNDERLINED, 16 }, // 0x59 || 0x79 -{ CCCOL_WHITE, CCFONT_REGULAR, 20 }, // 0x5a || 0x7a -{ CCCOL_WHITE, CCFONT_UNDERLINED, 20 }, // 0x5b || 0x7b -{ CCCOL_WHITE, CCFONT_REGULAR, 24 }, // 0x5c || 0x7c -{ CCCOL_WHITE, CCFONT_UNDERLINED, 24 }, // 0x5d || 0x7d -{ CCCOL_WHITE, CCFONT_REGULAR, 28 }, // 0x5e || 0x7e -{ CCCOL_WHITE, CCFONT_UNDERLINED, 28 } // 0x5f || 0x7f +{ CCCOL_WHITE, CCFONT_REGULAR,0 }, // 0x40 || 0x60 +{ CCCOL_WHITE, CCFONT_UNDERLINED, 0 }, // 0x41 || 0x61 +{ CCCOL_GREEN, CCFONT_REGULAR,0 }, // 0x42 || 0x62 +{ CCCOL_GREEN, CCFONT_UNDERLINED, 0 }, // 0x43 || 0x63 +{ CCCOL_BLUE,CCFONT_REGULAR,0 }, // 0x44 || 0x64 +{ CCCOL_BLUE,CCFONT_UNDERLINED, 0 }, // 0x45 || 0x65 +{ CCCOL_CYAN,CCFONT_REGULAR,0 }, // 0x46 || 0x66 +{ CCCOL_CYAN,CCFONT_UNDERLINED, 0 }, // 0x47 || 0x67 +{ CCCOL_RED, CCFONT_REGULAR,0 }, // 0x48 || 0x68 +{ CCCOL_RED, CCFONT_UNDERLINED,
[FFmpeg-devel] Expanded decoder for CEA-608 and World System Teletext
Just a FYI, I noticed the recent, but limited CEA-608 decoder addition to the project. I have developed my own version to translate these to 25 frame STL files a while ago in my own time for the broadcaster I work for. I would have submitted them, but I loath using git for any thing but basic retrival. As my code has a lower memory footprint, has full char support with ASS styling, with built-in MXF VANC and DVB support. I've put it up on my google site at http://sites.google.com/site/xhelmboyx/code. So if any one wants to include it can go ahead. Also I would suggest due to the way VBI captions and subtitles are encapsulated. I would be an idea to promote the use of embedded timing for text based subtitles as packet timing will not work out. ie, the depricated SRT encoder is a better option than the SubRip encoder. PS, for MXF you need to added these lines to the demuxer: static const MXFCodecUL mxf_data_essence_container_uls[] = { // data essence container uls { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x09,0x0D,0x01,0x03,0x01,0x02,0x0D,0x00,0x00 }, 14, AV_CODEC_ID_NONE },/* Generic VBI Data */ { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x09,0x0D,0x01,0x03,0x01,0x02,0x0E,0x00,0x00 }, 14, AV_CODEC_ID_MXF_VANC }, /* Generic ANC Data */ { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0, AV_CODEC_ID_NONE }, }; { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x5C,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* VANC */ PPS, I not on this mailing list either. Shan ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] Adding Closed caption in nut muxer
On Tue, Jan 20, 2015 at 03:22:08PM +0530, Anshul wrote: > > On 01/13/2015 06:50 PM, Michael Niedermayer wrote: > >On Tue, Jan 13, 2015 at 12:00:36PM +0100, Nicolas George wrote: > >>Le quartidi 24 nivôse, an CCXXIII, Anshul a écrit : > >>>Please find attachment. > >>>Using this people can also mux cc608 stream in nut muxer > >>IIRC, you need to submit a patch to libnut before, because it holds the > >>official list of codes. > >libnut is an implementation of teh nut spec > >the nut spec is at > >svn://svn.mplayerhq.hu/nut > > > >see docs/nut4cc.txt > > > >also: > >https://lists.mplayerhq.hu/mailman/listinfo/nut-devel > > > >to add a new fourcc code to nut, send a patch that changes > >docs/nut4cc.txt to nut-devel > > > I have subscribed the list, but it is still not confirmed yet. So > things are in process. Theres no mail on nut-devel, also "There are no pending requests." and the list seems to have been set to reject mails from non subscribers, ive fixed the settings but if you posted a mail to the list as non subscriber, it has been lost [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Good people do not need laws to tell them to act responsibly, while bad people will find a way around the laws. -- Plato signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [FFmpeg-cvslog] Adding Closed caption Support
On Tue, Jan 20, 2015 at 04:39:40PM +0530, Anshul wrote: > > On 01/13/2015 01:15 PM, Clément Bœsch wrote: > >On Tue, Jan 13, 2015 at 08:12:10AM +0100, Clément Bœsch wrote: > >>On Tue, Jan 13, 2015 at 11:26:06AM +0530, Anshul Maheshwari wrote: > >>[...] > Also added roll-up functionality. > > patch is attached. > Thanks > Anshul > > >>>Attaching patch > >>> From ca66e917f45bd47dd797930423d488fa9c781c4c Mon Sep 17 00:00:00 2001 > >>>From: Anshul Maheshwari > >>>Date: Mon, 12 Jan 2015 06:21:18 -0800 > >>>Subject: [PATCH] Addig Rollup functionality > >>> > >>>Signed-off-by: Anshul Maheshwari > >>>--- > >>> libavcodec/ccaption_dec.c | 222 > >>> +- > >>> 1 file changed, 140 insertions(+), 82 deletions(-) > >>> > >>Please split your changes. > >> > >>One patch for the cosmetics > >>One patch for the CHAR_DEBUG/av_dlog > >>One patch for the addition of av_log > >>One patch for the reflow of init_decoder() > >>One patch for the roll-up functionality > >>One patchset to rule them all. > >> > >>Thank you. > >> > >hint: git add -p is your friend > > > > > Thanks still learning it, most of the time git say patch cant be applied. > > > > Attached all patch. applied 1-3 and 5, rest left to others, probably ubitux to review/apply, if noone else does ill look at them -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Many things microsoft did are stupid, but not doing something just because microsoft did it is even more stupid. If everything ms did were stupid they would be bankrupt already. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] tests: drop bc dependency
On Mon, Jan 19, 2015 at 10:58:02PM +0100, Clément Bœsch wrote: > We already have a dependency on awk, bc is sometimes not found in the > base system, and we save a shell fork. > --- > tests/fate-run.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) looks ok but iam no awk/bc/shell guru so "LGTM if noone else replies" [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Into a blind darkness they enter who follow after the Ignorance, they as if into a greater darkness enter who devote themselves to the Knowledge alone. -- Isha Upanishad signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] libavutil: Added twofish block cipher
On Thu, Jan 15, 2015 at 10:21:22PM +0530, supraja reddy wrote: > Hello, > > I have attached the patch for twofish implementation. Please let me know if > there are any changes to be made. > > Thank you, > > Supraja [...] > +av_cold int av_twofish_init(AVTWOFISH *cs, const uint8_t *Key, int key_bits) > +{ > +uint32_t key[8], Ke[4], Ko[4], rh, A, B; > +uint8_t keypad[32]; > +int i, j, k; > +k = cs->ksize = ((key_bits <=128) ? 128 : ((key_bits <=192) ? 192 : > 256)) >> 6; > +memset(keypad, 0, sizeof(keypad)); > +memcpy(keypad, Key, key_bits >> 3); key_bits should be checked to be a supported value otherwise the memcpy could write out of the array [...] > +#ifdef TEST > +#include > +#include > +#include"log.h" > + > +int main(int argc, char *argv[]) > +{ > +uint8_t Key[32] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xfe, > 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, > 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff > +}; > +const uint8_t rct[6][16] = { > +{0x9f, 0x58, 0x9f, 0x5c, 0xf6, 0x12, 0x2c, 0x32, 0xb6, 0xbf, 0xec, > 0x2f, 0x2a, 0xe8, 0xc3, 0x5a}, > +{0xcf, 0xd1, 0xd2, 0xe5, 0xa9, 0xbe, 0x9c, 0xdf, 0x50, 0x1f, 0x13, > 0xb8, 0x92, 0xbd, 0x22, 0x48}, > +{0x37, 0x52, 0x7b, 0xe0, 0x05, 0x23, 0x34, 0xb8, 0x9f, 0x0c, 0xfc, > 0xca, 0xe8, 0x7c, 0xfa, 0x20}, > +{0x5d, 0x9d, 0x4e, 0xef, 0xfa, 0x91, 0x51, 0x57, 0x55, 0x24, 0xf1, > 0x15, 0x81, 0x5a, 0x12, 0xe0}, > +{0xe7, 0x54, 0x49, 0x21, 0x2b, 0xee, 0xf9, 0xf4, 0xa3, 0x90, 0xbd, > 0x86, 0x0a, 0x64, 0x09, 0x41}, > +{0x37, 0xfe, 0x26, 0xff, 0x1c, 0xf6, 0x61, 0x75, 0xf5, 0xdd, 0xf4, > 0xc3, 0x3b, 0x97, 0xa2, 0x05} > +}; > +uint8_t temp[32], iv[16], rpt[32]; > +const int kbits[3] = {128, 192, 256}; > +int i, j, err = 0; > +AVTWOFISH *cs; > +cs = av_twofish_alloc(); > +if (!cs) > +return 1; > +memset(rpt, 0, sizeof(rpt)); could be avoided with: uint8_t rpt[32] = {0}; [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB There will always be a question for which you do not know the correct answer. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] Port mp=eq/eq2 to FFmpeg
> > > @@ -0,0 +1,342 @@ > > +/* > > + * Original MPlayer filters by Richard Felker, Hampa Hug, Daniel Moreno, > > + * and Michael Niedermeyer. > > + * > > + * Copyright (c) 2014 James Darnley > > + * Copyright (c) 2015 Arwa Arif > > + * > > + * This file is part of FFmpeg. > > + * > > + * FFmpeg is free software; you can redistribute it and/or modify > > + * it under the terms of the GNU General Public License as published by > > + * the Free Software Foundation; either version 2 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 General Public License for more details. > > + * > > + * You should have received a copy of the GNU 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 > > + * very simple video equalizer > > + */ > > + > > +/* TODO: > > > + * - copy plane pointers rather than data > > uh? drop this comment unless it is clear to you what it means > > > + * - support alpha channels > > Add also an entry to add support to .process_command(). You can > implement it in a later patch. > > What is meant by adding support to process_command? > > > > + > > +eq2->param[0].contrast = eq2->contrast; > > +eq2->param[0].lut_clean = 0; > > +check_values(&eq2->param[0]); > > +} > > + > > +static void set_brightness(EQ2Context *eq2) > > +{ > > +/* brightness already set as AVOpt */ > > + > > +eq2->param[0].brightness = eq2->brightness; > > +eq2->param[0].lut_clean = 0; > > +check_values(&eq2->param[0]); > > +} > > + > > +static void set_gamma(EQ2Context *eq2) > > +{ > > +int i; > > +/* gamma already set as AVOpt */ > > + > > +eq2->param[0].gamma = eq2->gamma * eq2->gamma_g; > > +eq2->param[1].gamma = sqrt(eq2->gamma_b / eq2->gamma_g); > > +eq2->param[2].gamma = sqrt(eq2->gamma_r / eq2->gamma_g); > > + > > +for (i = 0; i < 3; i++) { > > +eq2->param[i].weight = eq2->weight; > > +eq2->param[i].lut_clean = 0; > > +check_values(&eq2->param[i]); > > +} > > +} > > + > > +static void set_saturation(EQ2Context *eq2) > > +{ > > +int i; > > +/* saturation already set as AVOpt */ > > + > > +for (i = 1; i < 3; i++) { > > +eq2->param[i].contrast = eq2->saturation; > > +eq2->param[i].lut_clean = 0; > > +check_values(&eq2->param[i]); > > +} > > Is this really working with gray8 or crashing (like mp=eq does)? > Yes, I checked the formats, it is working with gray8. > You should store in the context the number of planes. > > Also, please add a fate test. > I am not able to run rsync, maybe because of proxy settings. I tried various ways of bypassing the proxy, but I am still unable to use it. Is there any other way of adding the fate test? Updated the patch. From b54fd33b1d4ad68487ce20480c7865ad95ac19d8 Mon Sep 17 00:00:00 2001 From: Arwa Arif Date: Mon, 19 Jan 2015 03:56:48 +0530 Subject: [PATCH] Port mp=eq/eq2 to FFmpeg Code adapted from James Darnley's previous commits --- configure|2 + doc/filters.texi | 65 ++ libavfilter/Makefile |2 + libavfilter/allfilters.c |2 + libavfilter/vf_eq.c | 325 ++ libavfilter/vf_eq.h | 63 + libavfilter/x86/Makefile |1 + libavfilter/x86/vf_eq.c | 94 ++ 8 files changed, 554 insertions(+) create mode 100644 libavfilter/vf_eq.c create mode 100644 libavfilter/vf_eq.h create mode 100644 libavfilter/x86/vf_eq.c diff --git a/configure b/configure index c73562b..a8042b2 100755 --- a/configure +++ b/configure @@ -2579,6 +2579,8 @@ delogo_filter_deps="gpl" deshake_filter_select="pixelutils" drawtext_filter_deps="libfreetype" ebur128_filter_deps="gpl" +eq_filter_deps="gpl" +eq2_filter_deps="gpl" flite_filter_deps="libflite" frei0r_filter_deps="frei0r dlopen" frei0r_src_filter_deps="frei0r dlopen" diff --git a/doc/filters.texi b/doc/filters.texi index d7b2273..ded154a 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -4320,6 +4320,71 @@ edgedetect=mode=colormix:high=0 @end example @end itemize +@anchor{eq} +@section eq +Control brightness and contrast. It can be used for fixing poorly captured movies, +or for slightly reducing contrast to mask artifacts and get by with lower bitrates. + +The filter accepts the following options: + +@table @option + +@item brightness +Set the brightness value. It accepts a float value in range @code{-1.0} to +@code{1.0}. The default value is @code{0.0}. + +@item contrast +Set the contrast value. It accepts a float value in range @code{-1.0} to +@code{1.0}. The default value is @code{0.0}. +@end tab
Re: [FFmpeg-devel] Post-processing filter Documentation
> > Still missing benchmarks and pp filter covering. > > What is meant by pp filter covering? Do you want benchmark for each image? And by benchmark you mean runtime, right? > About the reference images, I think it would be useful to show the > uncompressed original, and use FFmpeg to encode it (rather than > xvid/Gimp), so that the whole sequence can be easily reproduced using > only FFmpeg tools. > I will update the reference images. > -- > FFmpeg = Friendly & Funny Most Programmable Enhancing Gadget > ___ > 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] avfilter/vf_lenscorrection: support 8bit planar RGB formats
Signed-off-by: Paul B Mahol --- libavfilter/vf_lenscorrection.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavfilter/vf_lenscorrection.c b/libavfilter/vf_lenscorrection.c index 9fb1424..82ddb29 100644 --- a/libavfilter/vf_lenscorrection.c +++ b/libavfilter/vf_lenscorrection.c @@ -104,6 +104,7 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV422P, +AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP, AV_PIX_FMT_NONE }; -- 1.7.11.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avfilter/vf_lenscorrection: support 8bit planar RGB formats
On Tue, 20 Jan 2015 17:17:16 + Paul B Mahol wrote: > AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVJ420P, > AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUVA420P, > AV_PIX_FMT_YUV422P, > +AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP, > AV_PIX_FMT_NONE looks ok to me , if tested... :) do we have good 8bit rgb samples? -compn ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] libavcodec/ppc/mpegvideoencdsp.c: fix stack smashing in pix_norm1_altivec() and pix_sum_altivec()
Hi, after enabling the altivec optimizations on ppc64el, many fate tests failed, some of them with 'stack smashing detected'. For the full build log see [1]. The attached patch fixes all the stack smashing crashes. But I don't know, what causes the other test failures. Rong Yan, maybe you can have a look? Best regards, Andreas 1: https://buildd.debian.org/status/fetch.php?pkg=ffmpeg&arch=ppc64el&ver=7%3A2.5.3-1&stamp=1421583916 >From 93d465397d95594870b2ff9bbd662ccfa306bfb7 Mon Sep 17 00:00:00 2001 From: Andreas Cadhalpun Date: Tue, 20 Jan 2015 18:46:01 +0100 Subject: [PATCH] libavcodec/ppc/mpegvideoencdsp.c: fix stack smashing in pix_norm1_altivec() and pix_sum_altivec() The vec_ste calls were mistakenly changed to vec_vsx_st in c5ca76a, which caused stack smashing. Changing them back fixes crashes on ppc64el, when configured with --toolchain=hardened. --- libavcodec/ppc/mpegvideoencdsp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/ppc/mpegvideoencdsp.c b/libavcodec/ppc/mpegvideoencdsp.c index e91ba5d..3e6765c 100644 --- a/libavcodec/ppc/mpegvideoencdsp.c +++ b/libavcodec/ppc/mpegvideoencdsp.c @@ -55,7 +55,7 @@ static int pix_norm1_altivec(uint8_t *pix, int line_size) /* Sum up the four partial sums, and put the result into s. */ sum = vec_sums((vector signed int) sv, (vector signed int) zero); sum = vec_splat(sum, 3); -vec_vsx_st(sum, 0, &s); +vec_ste(sum, 0, &s); return s; } #else @@ -113,7 +113,7 @@ static int pix_sum_altivec(uint8_t *pix, int line_size) /* Sum up the four partial sums, and put the result into s. */ sumdiffs = vec_sums((vector signed int) sad, (vector signed int) zero); sumdiffs = vec_splat(sumdiffs, 3); -vec_vsx_st(sumdiffs, 0, &s); +vec_ste(sumdiffs, 0, &s); return s; } #else -- 2.1.4 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avcodec/h264: Partially decode and display single fields try #2
This like the previous attempt does not fully correctly decode this type of non standard H.264, but it now works fully automatic requiring no manual filters or flags to be used See Ticket2254 Signed-off-by: Michael Niedermayer --- libavcodec/h264.c | 31 ++- libavcodec/h264.h |2 ++ libavcodec/h264_slice.c |2 ++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index ab9acde..62a5c2b 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -762,7 +762,10 @@ static void decode_postinit(H264Context *h, int setup_finished) * yet, so we assume the worst for now. */ // if (setup_finished) //ff_thread_finish_setup(h->avctx); -return; +if (cur->field_poc[0] == INT_MAX && cur->field_poc[1] == INT_MAX) +return; +if (h->avctx->hwaccel || h->missing_fields <=1) +return; } cur->f.interlaced_frame = 0; @@ -1912,6 +1915,32 @@ static int h264_decode_frame(AVCodecContext *avctx, void *data, if (!h->next_output_pic->recovered) h->next_output_pic->f.flags |= AV_FRAME_FLAG_CORRUPT; +if (!h->avctx->hwaccel && + (h->next_output_pic->field_poc[0] == INT_MAX || + h->next_output_pic->field_poc[1] == INT_MAX) +) { +int p, y; +int h_chroma_shift, v_chroma_shift; +AVFrame *f = &h->next_output_pic->f; +int field = h->next_output_pic->field_poc[0] == INT_MAX; + +av_pix_fmt_get_chroma_sub_sample(f->format, &h_chroma_shift, &v_chroma_shift); +av_log(h->avctx, AV_LOG_DEBUG, "Duplicating field %d to fill missing\n", field); + +for(p=0; p<3; p++) { +int h = f->height; +int w = f->width; +if (p) { +w >>= h_chroma_shift; +h >>= v_chroma_shift; +} +for(y=field; ydata[p][ (y^1)*f->linesize[p] ], +&f->data[p][ y*f->linesize[p] ], w); +} +} +} + ret = output_frame(h, pict, h->next_output_pic); if (ret < 0) return ret; diff --git a/libavcodec/h264.h b/libavcodec/h264.h index 2d8e137..cf4998f 100644 --- a/libavcodec/h264.h +++ b/libavcodec/h264.h @@ -740,6 +740,8 @@ typedef struct H264Context { int has_recovery_point; +int missing_fields; + int luma_weight_flag[2];///< 7.4.3.2 luma_weight_lX_flag int chroma_weight_flag[2]; ///< 7.4.3.2 chroma_weight_lX_flag diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index 3874d07..6d19c73 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -1663,9 +1663,11 @@ int ff_h264_decode_slice_header(H264Context *h, H264Context *h0) if (!FIELD_PICTURE(h) || h->picture_structure == last_pic_structure) { /* Previous field is unmatched. Don't display it, but let it * remain for reference if marked as such. */ +h0->missing_fields ++; h0->cur_pic_ptr = NULL; h0->first_field = FIELD_PICTURE(h); } else { +h0->missing_fields = 0; if (h0->cur_pic_ptr->frame_num != h->frame_num) { ff_thread_report_progress(&h0->cur_pic_ptr->tf, INT_MAX, h0->picture_structure==PICT_BOTTOM_FIELD); -- 1.7.9.5 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] libavutil: Added twofish block cipher
Hello, Thanks for you reviews. I see this is only use during init but if it still matters speedwise > and assuming this is a galois field multiplication the it can be > written as > > EXP_GF256[LOG_GF256[a] + LOG_GF256[b]] (for a!=0 && b!=0) > > Do you want me to insert tables EXP_GF256 and LOG_GF256 in the code or are there any existing tables ? I have updated the patch with other changes suggested. Please let me know if there is anything else to be changed. Thanks, Supraja On Tue, Jan 20, 2015 at 8:45 PM, Michael Niedermayer wrote: > On Thu, Jan 15, 2015 at 10:21:22PM +0530, supraja reddy wrote: > > Hello, > > > > I have attached the patch for twofish implementation. Please let me know > if > > there are any changes to be made. > > > > Thank you, > > > > Supraja > > [...] > > > +av_cold int av_twofish_init(AVTWOFISH *cs, const uint8_t *Key, int > key_bits) > > +{ > > +uint32_t key[8], Ke[4], Ko[4], rh, A, B; > > +uint8_t keypad[32]; > > +int i, j, k; > > +k = cs->ksize = ((key_bits <=128) ? 128 : ((key_bits <=192) ? 192 : > 256)) >> 6; > > +memset(keypad, 0, sizeof(keypad)); > > +memcpy(keypad, Key, key_bits >> 3); > > key_bits should be checked to be a supported value otherwise > the memcpy could write out of the array > > > [...] > > +#ifdef TEST > > +#include > > +#include > > +#include"log.h" > > + > > +int main(int argc, char *argv[]) > > +{ > > +uint8_t Key[32] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, > 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10, 0x00, 0x11, 0x22, 0x33, > 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff > > +}; > > +const uint8_t rct[6][16] = { > > +{0x9f, 0x58, 0x9f, 0x5c, 0xf6, 0x12, 0x2c, 0x32, 0xb6, 0xbf, > 0xec, 0x2f, 0x2a, 0xe8, 0xc3, 0x5a}, > > +{0xcf, 0xd1, 0xd2, 0xe5, 0xa9, 0xbe, 0x9c, 0xdf, 0x50, 0x1f, > 0x13, 0xb8, 0x92, 0xbd, 0x22, 0x48}, > > +{0x37, 0x52, 0x7b, 0xe0, 0x05, 0x23, 0x34, 0xb8, 0x9f, 0x0c, > 0xfc, 0xca, 0xe8, 0x7c, 0xfa, 0x20}, > > +{0x5d, 0x9d, 0x4e, 0xef, 0xfa, 0x91, 0x51, 0x57, 0x55, 0x24, > 0xf1, 0x15, 0x81, 0x5a, 0x12, 0xe0}, > > +{0xe7, 0x54, 0x49, 0x21, 0x2b, 0xee, 0xf9, 0xf4, 0xa3, 0x90, > 0xbd, 0x86, 0x0a, 0x64, 0x09, 0x41}, > > +{0x37, 0xfe, 0x26, 0xff, 0x1c, 0xf6, 0x61, 0x75, 0xf5, 0xdd, > 0xf4, 0xc3, 0x3b, 0x97, 0xa2, 0x05} > > +}; > > +uint8_t temp[32], iv[16], rpt[32]; > > +const int kbits[3] = {128, 192, 256}; > > +int i, j, err = 0; > > +AVTWOFISH *cs; > > +cs = av_twofish_alloc(); > > +if (!cs) > > +return 1; > > > +memset(rpt, 0, sizeof(rpt)); > > could be avoided with: > uint8_t rpt[32] = {0}; > > [...] > > -- > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB > > There will always be a question for which you do not know the correct > answer. > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > From b46d6a457aeee319fc6e56217a265c9881a34c2c Mon Sep 17 00:00:00 2001 From: Supraja Meedinti Date: Thu, 15 Jan 2015 21:35:16 +0530 Subject: [PATCH] libavutil: Added Twofish block cipher Signed-off-by: Supraja Meedinti --- libavutil/Makefile | 3 + libavutil/twofish.c | 373 libavutil/twofish.h | 70 ++ 3 files changed, 446 insertions(+) create mode 100644 libavutil/twofish.c create mode 100644 libavutil/twofish.h diff --git a/libavutil/Makefile b/libavutil/Makefile index 4db89b8..6caf896 100644 --- a/libavutil/Makefile +++ b/libavutil/Makefile @@ -60,6 +60,7 @@ HEADERS = adler32.h \ time.h\ timecode.h\ timestamp.h \ + twofish.h \ version.h \ xtea.h\ @@ -129,6 +130,7 @@ OBJS = adler32.o\ time.o \ timecode.o \ tree.o \ + twofish.o\ utils.o \ xga_font_data.o \ xtea.o \ @@ -184,6 +186,7 @@ TESTPROGS = adler32 \ sha512 \ softfloat
Re: [FFmpeg-devel] [PATCH] tests: drop bc dependency
On Mon, Jan 19, 2015 at 10:58:02PM +0100, Clément Bœsch wrote: > -echo "scale=2; v = $1 - $2; if (v < 0) v = -v; if (v > $3) r = 1; r" | bc > +awk "BEGIN { v=$1-$2; printf \"%d\\n\", ((v<0?v:-v) > $3) ? 1 : 0 }" I'd suggest single quotes for the outer ones, then you do not need to escape \ and ". Also it's broken, you inverted the absolute value condition. Lastly, at least with gawk the last ?: is pointless, conditions evaluate to 1/0 like in C. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec/h264: Partially decode and display single fields try #2
> +for(p=0; p<3; p++) { > +int h = f->height; > +int w = f->width; > +if (p) { > +w >>= h_chroma_shift; > +h >>= v_chroma_shift; > +} > +for(y=field; y +memcpy(&f->data[p][ (y^1)*f->linesize[p] ], > +&f->data[p][ y*f->linesize[p] ], w); > +} Can this not be written with a standard function? ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 0/2] [RFC] avformat/flv subtitle fixes
this patchset (tries to) fix onTextData handling in flv kurosu spotted that flv_data_packet() is not used and this is my attempt to fix it. Note, i do not have a flv file with onTextData, so if someone has one please share! Also this probably still contains some bugs, a review from someone knowing the subtitle stuff is very welcome, ive just quickly written it and quikly tested Thanks ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 2/2] avformat/flvdec: re enable flv_data_packet() and use AVMEDIA_TYPE_SUBTITLE
Found-by: kurosu Signed-off-by: Michael Niedermayer --- libavformat/flvdec.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index 572268f..f98cb97 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -482,7 +482,7 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream, 0 <= (int)(num_val * 1024.0)) acodec->bit_rate = num_val * 1024.0; else if (!strcmp(key, "datastream")) { -AVStream *st = create_stream(s, AVMEDIA_TYPE_DATA); +AVStream *st = create_stream(s, AVMEDIA_TYPE_SUBTITLE); if (!st) return AVERROR(ENOMEM); st->codec->codec_id = AV_CODEC_ID_TEXT; @@ -749,12 +749,12 @@ static int flv_data_packet(AVFormatContext *s, AVPacket *pkt, for (i = 0; i < s->nb_streams; i++) { st = s->streams[i]; -if (st->codec->codec_type == AVMEDIA_TYPE_DATA) +if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) break; } if (i == s->nb_streams) { -st = create_stream(s, AVMEDIA_TYPE_DATA); +st = create_stream(s, AVMEDIA_TYPE_SUBTITLE); if (!st) return AVERROR(ENOMEM); st->codec->codec_id = AV_CODEC_ID_TEXT; @@ -830,11 +830,14 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) goto skip; } else if (type == FLV_TAG_TYPE_META) { stream_type=FLV_STREAM_TYPE_DATA; -if (size > 13 + 1 + 4 && dts == 0) { // Header-type metadata stuff +if (size > 13 + 1 + 4) { // Header-type metadata stuff +int type; meta_pos = avio_tell(s->pb); -if (flv_read_metabody(s, next) <= 0) { +type = flv_read_metabody(s, next); +if (type == 0 && dts == 0 || type < 0) { goto skip; -} +} else if (type == TYPE_ONTEXTDATA) +return flv_data_packet(s, pkt, dts, next); avio_seek(s->pb, meta_pos, SEEK_SET); } } else { -- 1.7.9.5 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 1/2] avformat/flvenc: accept AVMEDIA_TYPE_SUBTITLE instead of DATA for subtitles
Signed-off-by: Michael Niedermayer --- libavformat/flvenc.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c index 5e27ed0..7d3a0ca 100644 --- a/libavformat/flvenc.c +++ b/libavformat/flvenc.c @@ -389,6 +389,14 @@ static int flv_write_header(AVFormatContext *s) } flv->data_enc = enc; break; +case AVMEDIA_TYPE_SUBTITLE: +if (enc->codec_id != AV_CODEC_ID_TEXT) { +av_log(s, AV_LOG_ERROR, "Subtitle codec '%s' for stream %d is not compatible with FLV\n", + avcodec_get_name(enc->codec_id), i); +return AVERROR_INVALIDDATA; +} +flv->data_enc = enc; +break; default: av_log(s, AV_LOG_ERROR, "Codec type '%s' for stream %d is not compatible with FLV\n", av_get_media_type_string(enc->codec_type), i); @@ -545,6 +553,7 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) avio_w8(pb, FLV_TAG_TYPE_AUDIO); break; +case AVMEDIA_TYPE_SUBTITLE: case AVMEDIA_TYPE_DATA: avio_w8(pb, FLV_TAG_TYPE_META); break; @@ -588,7 +597,8 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) avio_w8(pb, (ts >> 24) & 0x7F); // timestamps are 32 bits _signed_ avio_wb24(pb, flv->reserved); -if (enc->codec_type == AVMEDIA_TYPE_DATA) { +if (enc->codec_type == AVMEDIA_TYPE_DATA || +enc->codec_type == AVMEDIA_TYPE_SUBTITLE ) { int data_size; int64_t metadata_size_pos = avio_tell(pb); if (enc->codec_id == AV_CODEC_ID_TEXT) { -- 1.7.9.5 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec/h264: Partially decode and display single fields try #2
On Tue, Jan 20, 2015 at 09:51:25PM +, Kieran Kunhya wrote: > > +for(p=0; p<3; p++) { > > +int h = f->height; > > +int w = f->width; > > +if (p) { > > +w >>= h_chroma_shift; > > +h >>= v_chroma_shift; > > +} > > +for(y=field; y > +memcpy(&f->data[p][ (y^1)*f->linesize[p] ], > > +&f->data[p][ y*f->linesize[p] ], w); > > +} > > Can this not be written with a standard function? yes, its overall 3 lines shorter as well ive locally changed it to this: +for (p = 0; p<4; p++) { +dst_data[p] = f->data[p] + (field^1)*f->linesize[p]; +src_data[p] = f->data[p] + field *f->linesize[p]; +linesizes[p] = 2*f->linesize[p]; +} + +av_image_copy(dst_data, linesizes, src_data, linesizes, + f->format, f->width, f->height>>1) [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Let us carefully observe those good qualities wherein our enemies excel us and endeavor to excel them, by avoiding what is faulty, and imitating what is excellent in them. -- Plutarch signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avformat/mov: simplify pasp value before setting SAR
This avoids a 65536:65536 SAR Signed-off-by: Michael Niedermayer --- libavformat/mov.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index 556411f..2a9a3f7 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -737,8 +737,8 @@ static int mov_read_pasp(MOVContext *c, AVIOContext *pb, MOVAtom atom) st->sample_aspect_ratio.num, st->sample_aspect_ratio.den, num, den); } else if (den != 0) { -st->sample_aspect_ratio.num = num; -st->sample_aspect_ratio.den = den; +av_reduce(&st->sample_aspect_ratio.num, &st->sample_aspect_ratio.den, + num, den, 32767); } return 0; } -- 1.7.9.5 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] libavcodec/ppc/mpegvideoencdsp.c: fix stack smashing in pix_norm1_altivec() and pix_sum_altivec()
On Tue, Jan 20, 2015 at 07:12:09PM +0100, Andreas Cadhalpun wrote: > Hi, > > after enabling the altivec optimizations on ppc64el, many fate tests > failed, some of them with 'stack smashing detected'. For the full > build log see [1]. > > The attached patch fixes all the stack smashing crashes. > > But I don't know, what causes the other test failures. > > Rong Yan, maybe you can have a look? > > Best regards, > Andreas > > > 1: > https://buildd.debian.org/status/fetch.php?pkg=ffmpeg&arch=ppc64el&ver=7%3A2.5.3-1&stamp=1421583916 > mpegvideoencdsp.c |4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > 18a044d7378032058db3cf5d6d07d9d54d4b27f7 > libavcodec-ppc-mpegvideoencdsp.c-fix-stack-smashing.patch > From 93d465397d95594870b2ff9bbd662ccfa306bfb7 Mon Sep 17 00:00:00 2001 > From: Andreas Cadhalpun > Date: Tue, 20 Jan 2015 18:46:01 +0100 > Subject: [PATCH] libavcodec/ppc/mpegvideoencdsp.c: fix stack smashing in > pix_norm1_altivec() and pix_sum_altivec() patch applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If you think the mosad wants you dead since a long time then you are either wrong or dead since a long time. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] ffprobe: fix memleaks on errors
Found-by: Andreas Cadhalpun Signed-off-by: Michael Niedermayer --- ffprobe.c | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/ffprobe.c b/ffprobe.c index faddc16..38879f1 100644 --- a/ffprobe.c +++ b/ffprobe.c @@ -2398,6 +2398,7 @@ static int open_input_file(AVFormatContext **fmt_ctx_ptr, const char *filename) print_error(filename, err); return err; } +*fmt_ctx_ptr = fmt_ctx; if (scan_all_pmts_set) av_dict_set(&format_opts, "scan_all_pmts", NULL, AV_DICT_MATCH_CASE); if ((t = av_dict_get(format_opts, "", NULL, AV_DICT_IGNORE_SUFFIX))) { @@ -2409,14 +2410,17 @@ static int open_input_file(AVFormatContext **fmt_ctx_ptr, const char *filename) opts = setup_find_stream_info_opts(fmt_ctx, codec_opts); orig_nb_streams = fmt_ctx->nb_streams; -if ((err = avformat_find_stream_info(fmt_ctx, opts)) < 0) { -print_error(filename, err); -return err; -} +err = avformat_find_stream_info(fmt_ctx, opts); + for (i = 0; i < orig_nb_streams; i++) av_dict_free(&opts[i]); av_freep(&opts); +if (err < 0) { +print_error(filename, err); +return err; +} + av_dump_format(fmt_ctx, 0, filename, 0); /* bind a decoder to each input stream */ @@ -2466,7 +2470,7 @@ static void close_input_file(AVFormatContext **ctx_ptr) static int probe_file(WriterContext *wctx, const char *filename) { -AVFormatContext *fmt_ctx; +AVFormatContext *fmt_ctx = NULL; int ret, i; int section_id; @@ -2475,7 +2479,7 @@ static int probe_file(WriterContext *wctx, const char *filename) ret = open_input_file(&fmt_ctx, filename); if (ret < 0) -return ret; +goto end; #define CHECK_END if (ret < 0) goto end @@ -2533,7 +2537,8 @@ static int probe_file(WriterContext *wctx, const char *filename) } end: -close_input_file(&fmt_ctx); +if (fmt_ctx) +close_input_file(&fmt_ctx); av_freep(&nb_streams_frames); av_freep(&nb_streams_packets); av_freep(&selected_streams); -- 1.7.9.5 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] nvenc: Compensate for hardware trying to mess with aspect ratio of DVD content.
On 2015/1/18 4:01, Philip Langdale wrote: There is a long sad story behind all this, but it's somewhat ambiguous as to whether DVD content should be treated as 720 pixels wide or 704 pixels, with 16 pixels cut off. If you decide is should be 704 pixels wide, you need to adjust the sample aspect ratio to keep the final display aspect ratio correct. For reasons we are not privy too, nvidia decided that the nvenc encoder should apply this aspect correction, whether you want it to or not. (I guess there might be a flag for it, but if there is it's not documented). So, if you want to transcode DVD content at the original size, you need to adjust the aspect ratio information you pass to the encoder to compensate for their 'correction'. This 'correction' is only applied to 720x480 and 720x576 content - and it does so regardless of the input aspect ratio. --- libavcodec/nvenc.c | 12 1 file changed, 12 insertions(+) diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c index efa3f04..8a0d584 100644 --- a/libavcodec/nvenc.c +++ b/libavcodec/nvenc.c @@ -587,6 +587,18 @@ static av_cold int nvenc_encode_init(AVCodecContext *avctx) ctx->init_encode_params.darWidth = avctx->width; } +// De-compensate for hardware, dubiously, trying to compensate for +// playback at 704 pixel width. +if (avctx->width == 720 && +(avctx->height == 480 || avctx->height == 576)) { +av_reduce(&dw, &dh, + ctx->init_encode_params.darWidth * 44, + ctx->init_encode_params.darHeight * 45, + 1024 * 1204); +ctx->init_encode_params.darHeight = dh; +ctx->init_encode_params.darWidth = dw; +} + ctx->init_encode_params.frameRateNum = avctx->time_base.den; ctx->init_encode_params.frameRateDen = avctx->time_base.num * avctx->ticks_per_frame; Here's the reply from NVENC engineers It is not same thing as SAR. It is the display aspect ratio i.e width/height = DAR/SAR The calculation below should be like If (avctx->sample_aspect_ratio.num > 0 && avctx->sample_aspect_ratio.den > 0 ) av_reduce(&dw, &dh, avctx->sample_aspect_ratio.num * avctx->width, avctx->sample_aspect_ratio.den * avctx->height, INT_MAX); else av_reduce(&dw, &dh, avctx->width, avctx->height, INT_MAX); ctx->init_encode_params.darHeight = dw; ctx->init_encode_params.darWidth = dh; Agatha Hu ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avcodec/nvenc: add repeatSPSPPS flag for streaming
Still using attachment to prevent word-wrapping. For video streaming, repeatSPSPPS flag should be set as 1 besides disableSPSPPS=0, elsewise if running ffmpeg before vlc/ffmpeg, there will be no video header, decoder can't work properly. Agatha Hu >From 526f4f37f1fbd8214a2866dad1d6c2ea480ffd9a Mon Sep 17 00:00:00 2001 From: agathah Date: Wed, 21 Jan 2015 13:53:29 +0800 Subject: [PATCH] set repeatSPSPPS flag for streaming --- libavcodec/nvenc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c index 26f010e..7d82d58 100644 --- a/libavcodec/nvenc.c +++ b/libavcodec/nvenc.c @@ -683,6 +683,7 @@ static av_cold int nvenc_encode_init(AVCodecContext *avctx) ctx->encode_config.encodeCodecConfig.h264Config.h264VUIParameters.videoFullRangeFlag = avctx->color_range == AVCOL_RANGE_JPEG; ctx->encode_config.encodeCodecConfig.h264Config.disableSPSPPS = (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) ? 1 : 0; +ctx->encode_config.encodeCodecConfig.h264Config.repeatSPSPPS = (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) ? 0 : 1; nv_status = p_nvenc->nvEncInitializeEncoder(ctx->nvencoder, &ctx->init_encode_params); if (nv_status != NV_ENC_SUCCESS) { -- 1.9.5.github.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec/nvenc: add repeatSPSPPS flag for streaming
Still using attachment to prevent word-wrapping. For video streaming, repeatSPSPPS flag should be set as 1 besides disableSPSPPS=0, elsewise if running ffmpeg before vlc/ffmpeg, there will be no video header, decoder can't work properly. Agatha Hu Looks good to merge. signature.asc Description: OpenPGP digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel