Re: [FFmpeg-devel] [PATCH 1/3] avutil/frame: add use_last_roi
On Fri, Feb 14, 2020 at 4:41 AM Guo, Yejun wrote: > > For some cases, the regions of interest do not change, it is not > convenient to always prepare the roi data for every frame. So, add > use_last_roi to show it uses the same roi data as last frame. > > Since a new flag is added into AVFrame, the major version number of > lavu is changed. > Changing the major version for a field addition is not acceptable, it should be added to the end and not require that. Furthermore, I feel like the entire presence of that field in AVFrame is not a good idea. Its a very specific field, and we actively tried to remove such fields from the very generic structures like AVFrame, using side-data and other feature/codec-specific things instead. ROI itself is side-data, so this flag should be as well. - Hendrik ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg_filter: add -autoscale to disable/enable the default scale
On 2/14/20, Fu, Linjie wrote: >> -Original Message- >> From: ffmpeg-devel On Behalf Of Fu, >> Linjie >> Sent: Tuesday, February 11, 2020 20:58 >> To: FFmpeg development discussions and patches > de...@ffmpeg.org> >> Subject: Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg_filter: add -autoscale >> to disable/enable the default scale >> >> > -Original Message- >> > From: ffmpeg-devel On Behalf Of >> > Moritz Barsnick >> > Sent: Tuesday, February 11, 2020 19:04 >> > To: FFmpeg development discussions and patches > > de...@ffmpeg.org> >> > Subject: Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg_filter: add >> > -autoscale >> > to disable/enable the default scale >> > >> > On Mon, Feb 10, 2020 at 17:27:03 +0800, Linjie Fu wrote: >> > > +{ "autoscale",HAS_ARG | OPT_BOOL | OPT_SPEC | >> > > + OPT_EXPERT | OPT_OUTPUT, >> > >{ .off = >> > OFFSET(autoscale) }, >> > > +"automatically insert a scale filter at the end of the filter >> > > graph if a >> > resolution" >> > > +"change is detected. This ensures all frames are the same >> > > resolution >> > as the first frame" >> > > +"when they leave the filter chain (this option is enabled by >> default)." >> > > +"If disabled, some encoders/muxers may not support this >> > > mode."}, >> > >> > Have you checked the output of "ffmpeg -h"? Your C strings merge >> > directly together, and are therefore missing spaces, e.g. in >> > "resolutionchange" and "as the first framewhen they leave", >> > >> Yes, spaces should be added, thanks for pointing this out :). >> >> I'll fix this in next version together with other suggestions if there is >> any. >> > Ping, any suggestions? Send updated patch with spaces fixed. > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg: allow forcing input framerate on streamcopy
On Tue, Feb 11, 2020 at 6:05 PM Paul B Mahol wrote: > From: Leo Izen > > Signed-off-by: Paul B Mahol > --- > The OP has been asked to improve the commit message [1] and the same applies to you. E.g. I did not initially know that this was supposed to apply to video only. > fftools/ffmpeg.c | 18 +- > 1 file changed, 13 insertions(+), 5 deletions(-) > > diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c > index b0bffe0a54..9bfa853253 100644 > --- a/fftools/ffmpeg.c > +++ b/fftools/ffmpeg.c > @@ -2045,10 +2045,12 @@ static void do_streamcopy(InputStream *ist, > OutputStream *ost, const AVPacket *p > if (av_packet_ref(&opkt, pkt) < 0) > exit_program(1); > > -if (pkt->pts != AV_NOPTS_VALUE) > +if (ist->framerate.num) > +opkt.pts = av_rescale_q(ist->pts, AV_TIME_BASE_Q, > ost->mux_timebase) - ost_tb_start_time; > +else if (pkt->pts != AV_NOPTS_VALUE) > opkt.pts = av_rescale_q(pkt->pts, ist->st->time_base, > ost->mux_timebase) - ost_tb_start_time; > > -if (pkt->dts == AV_NOPTS_VALUE) > +if (pkt->dts == AV_NOPTS_VALUE || ist->framerate.num) > opkt.dts = av_rescale_q(ist->dts, AV_TIME_BASE_Q, > ost->mux_timebase); > else > opkt.dts = av_rescale_q(pkt->dts, ist->st->time_base, > ost->mux_timebase); > @@ -2590,7 +2592,7 @@ static int process_input_packet(InputStream *ist, > const AVPacket *pkt, int no_eo > avpkt = *pkt; > } > > -if (pkt && pkt->dts != AV_NOPTS_VALUE) { > +if (pkt && pkt->dts != AV_NOPTS_VALUE && !ist->framerate.num) { > ist->next_dts = ist->dts = av_rescale_q(pkt->dts, > ist->st->time_base, AV_TIME_BASE_Q); > if (ist->dec_ctx->codec_type != AVMEDIA_TYPE_VIDEO || > !ist->decoding_needed) > ist->next_pts = ist->pts = ist->dts; > @@ -3146,8 +3148,14 @@ static int > init_output_stream_streamcopy(OutputStream *ost) > else > sar = par_src->sample_aspect_ratio; > ost->st->sample_aspect_ratio = par_dst->sample_aspect_ratio = sar; > -ost->st->avg_frame_rate = ist->st->avg_frame_rate; > -ost->st->r_frame_rate = ist->st->r_frame_rate; > + > +if (ist->framerate.num) { > +ost->st->avg_frame_rate = ist->framerate; > +ost->st->r_frame_rate = ist->framerate; > +} else { > +ost->st->avg_frame_rate = ist->st->avg_frame_rate; > +ost->st->r_frame_rate = ist->st->r_frame_rate; > +} > This could be better aligned. > break; > } > Generally, this doesn't work as expected. The most serious flaw is that the created pts are simply not reordered. Original file: #tb 0: 1/1000 (so the stream is 50fps) 0,-40, 0, 20, 201020, 5ef3fbbc 0,-20, 80, 20,79258, 2738de70 0, 0, 40, 20,27268, 887d2c5f 0, 20, 20, 20, 2243, 79d47408 0, 40, 60, 20, 744, 6a0b3a95 0, 60,160, 20,94582, 7d8fc434 0, 80,120, 20,35017, b9116d81 0,100,100, 20, 3046, 5922a16f 0,120,140, 20, 1888, b8c56629 0,140,240, 20,93439, 96494831 0,160,200, 20,32545, 01c93da0 0,180,180, 20, 1819, f8a1e391 0,200,220, 20, 1875, f536397a 0,220,320, 20,91395, f5fb5adf 0,240,280, 20,32321, 9a8def28 0,260,260, 20, 1663, 057d9518 0,280,300, 20, 1943, 30b376fa 0,300,400, 20,92881, 8fef50e1 0,320,360, 20,32350, 0c08ceed 0,340,340, 20, 1648, b1b33864 0,360,380, 20, 2047, 3de28d48 0,380,480, 20,90021, 96b24f3b 0,400,440, 20,31372, 4a9411ec 0,420,420, 20, 1706, 11cc3687 0,440,460, 20, 2022, a19a3246 With your patch and -r 50 (which is already the framerate) as input option this becomes: #tb 0: 1/50 0, -2, -2,1, 201020, 5ef3fbbc 0, -1, -1,1,79258, 2738de70 0, 0, 0,1,27268, 887d2c5f 0, 1, 1,1, 2243, 79d47408 0, 2, 2,1, 744, 6a0b3a95 0, 3, 3,1,94582, 7d8fc434 0, 4, 4,1,35017, b9116d81 0, 5, 5,1, 3046, 5922a16f 0, 6, 6,1, 1888, b8c56629 0, 7, 7,1,93439, 96494831 0, 8, 8,1,32545, 01c93da0 0, 9, 9,1, 1819, f8a1e391 0, 10, 10,1, 1875, f536397a 0, 11, 11,1,91395, f5fb5adf 0,
Re: [FFmpeg-devel] [PATCH 2/2] fftools/ffprobe: Remove unneeded casts
On Tue, Aug 6, 2019 at 3:18 AM Andreas Rheinhardt < andreas.rheinha...@gmail.com> wrote: > Signed-off-by: Andreas Rheinhardt > --- > fftools/ffprobe.c | 20 ++-- > 1 file changed, 10 insertions(+), 10 deletions(-) > > diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c > index 2380417229..9d55810cf9 100644 > --- a/fftools/ffprobe.c > +++ b/fftools/ffprobe.c > @@ -3507,13 +3507,13 @@ static const OptionDef real_options[] = { >"use sexagesimal format HOURS:MM:SS.MICROSECONDS for time units" }, > { "pretty", 0, {.func_arg = opt_pretty}, >"prettify the format of displayed values, make it more human > readable" }, > -{ "print_format", OPT_STRING | HAS_ARG, {(void*)&print_format}, > +{ "print_format", OPT_STRING | HAS_ARG, { &print_format }, >"set the output printing format (available formats are: default, > compact, csv, flat, ini, json, xml)", "format" }, > -{ "of", OPT_STRING | HAS_ARG, {(void*)&print_format}, "alias for > -print_format", "format" }, > -{ "select_streams", OPT_STRING | HAS_ARG, {(void*)&stream_specifier}, > "select the specified streams", "stream_specifier" }, > +{ "of", OPT_STRING | HAS_ARG, { &print_format }, "alias for > -print_format", "format" }, > +{ "select_streams", OPT_STRING | HAS_ARG, { &stream_specifier }, > "select the specified streams", "stream_specifier" }, > { "sections", OPT_EXIT, {.func_arg = opt_sections}, "print sections > structure and section information, and exit" }, > -{ "show_data",OPT_BOOL, {(void*)&do_show_data}, "show packets > data" }, > -{ "show_data_hash", OPT_STRING | HAS_ARG, {(void*)&show_data_hash}, > "show packets data hash" }, > +{ "show_data",OPT_BOOL, { &do_show_data }, "show packets data" }, > +{ "show_data_hash", OPT_STRING | HAS_ARG, { &show_data_hash }, "show > packets data hash" }, > { "show_error", 0, { .func_arg = &opt_show_error }, "show probing > error" }, > { "show_format", 0, { .func_arg = &opt_show_format }, "show > format/container info" }, > { "show_frames", 0, { .func_arg = &opt_show_frames }, "show frames > info" }, > @@ -3522,20 +3522,20 @@ static const OptionDef real_options[] = { > { "show_entries", HAS_ARG, {.func_arg = opt_show_entries}, >"show a set of specified entries", "entry_list" }, > #if HAVE_THREADS > -{ "show_log", OPT_INT|HAS_ARG, {(void*)&do_show_log}, "show log" }, > +{ "show_log", OPT_INT|HAS_ARG, { &do_show_log }, "show log" }, > #endif > { "show_packets", 0, { .func_arg = &opt_show_packets }, "show packets > info" }, > { "show_programs", 0, { .func_arg = &opt_show_programs }, "show > programs info" }, > { "show_streams", 0, { .func_arg = &opt_show_streams }, "show streams > info" }, > { "show_chapters", 0, { .func_arg = &opt_show_chapters }, "show > chapters info" }, > -{ "count_frames", OPT_BOOL, {(void*)&do_count_frames}, "count the > number of frames per stream" }, > -{ "count_packets", OPT_BOOL, {(void*)&do_count_packets}, "count the > number of packets per stream" }, > +{ "count_frames", OPT_BOOL, { &do_count_frames }, "count the number > of frames per stream" }, > +{ "count_packets", OPT_BOOL, { &do_count_packets }, "count the number > of packets per stream" }, > { "show_program_version", 0, { .func_arg = &opt_show_program_version > }, "show ffprobe version" }, > { "show_library_versions", 0, { .func_arg = > &opt_show_library_versions }, "show library versions" }, > { "show_versions", 0, { .func_arg = &opt_show_versions }, > "show program and library versions" }, > { "show_pixel_formats", 0, { .func_arg = &opt_show_pixel_formats }, > "show pixel format descriptions" }, > -{ "show_private_data", OPT_BOOL, {(void*)&show_private_data}, "show > private data" }, > -{ "private", OPT_BOOL, {(void*)&show_private_data}, "same > as show_private_data" }, > +{ "show_private_data", OPT_BOOL, { &show_private_data }, "show > private data" }, > +{ "private", OPT_BOOL, { &show_private_data }, "same as > show_private_data" }, > { "bitexact", OPT_BOOL, {&do_bitexact}, "force bitexact output" }, > { "read_intervals", HAS_ARG, {.func_arg = opt_read_intervals}, "set > read intervals", "read_intervals" }, > { "default", HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, {.func_arg > = opt_default}, "generic catch all option", "" }, > -- > Ping. - Andreas ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH] avfilter/vf_program_opencl: make it possible to pass plane as argument to kernel
Fixes #7190 Signed-off-by: Paul B Mahol --- doc/filters.texi| 4 libavfilter/vf_program_opencl.c | 17 + 2 files changed, 21 insertions(+) diff --git a/doc/filters.texi b/doc/filters.texi index b957b9302e..5bd0e44b67 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -21297,6 +21297,8 @@ Number of inputs to the filter. Defaults to 1. @item size, s Size of output frames. Defaults to the same as the first input. +@item plane +Currently processed plane number is set as last kernel argument. @end table The program source file must contain a kernel function with the given name, @@ -22483,6 +22485,8 @@ Pixel format to use for the generated frames. This must be set. @item rate, r Number of frames generated every second. Default value is '25'. +@item plane +Currently processed plane number is set as last kernel argument. @end table For details of how the program loading works, see the @ref{program_opencl} diff --git a/libavfilter/vf_program_opencl.c b/libavfilter/vf_program_opencl.c index ec25e931f5..3cf93464ba 100644 --- a/libavfilter/vf_program_opencl.c +++ b/libavfilter/vf_program_opencl.c @@ -42,6 +42,7 @@ typedef struct ProgramOpenCLContext { const char *source_file; const char *kernel_name; int nb_inputs; +int plane_is_arg; int width, height; enum AVPixelFormat source_format; AVRational source_rate; @@ -138,6 +139,16 @@ static int program_opencl_run(AVFilterContext *avctx) } } +if (ctx->plane_is_arg) { +cle = clSetKernelArg(ctx->kernel, 2 + ctx->nb_inputs, sizeof(cl_int), &plane); +if (cle != CL_SUCCESS) { +av_log(avctx, AV_LOG_ERROR, "Failed to set kernel " + "plane argument %d: %d.\n", plane, cle); +err = AVERROR_UNKNOWN; +goto fail; +} +} + err = ff_opencl_filter_work_size_from_image(avctx, global_work, output, plane, 0); if (err < 0) @@ -348,6 +359,9 @@ static const AVOption program_opencl_options[] = { { "s", "Video size", OFFSET(width), AV_OPT_TYPE_IMAGE_SIZE, { .str = NULL }, 0, 0, FLAGS }, +{ "plane", "Pass currently processed plane as argument", OFFSET(plane_is_arg), + AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS }, + { NULL }, }; @@ -400,6 +414,9 @@ static const AVOption openclsrc_options[] = { { "r", "Video frame rate", OFFSET(source_rate), AV_OPT_TYPE_VIDEO_RATE, { .str = "25" }, 0, INT_MAX, FLAGS }, +{ "plane", "Pass currently processed plane as argument", OFFSET(plane_is_arg), + AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS }, + { NULL }, }; -- 2.17.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH]lavc/mlp_parse: Read wordlength from 0xba streams
Am Fr., 14. Feb. 2020 um 01:26 Uhr schrieb Hendrik Leppkes : > > On Fri, Feb 14, 2020 at 12:29 AM Carl Eugen Hoyos wrote: > > > > Attached patch allows detecting s16 truehd streams encoded with > > FFmpeg, only tested with FFmpeg's encoder, I did not look into any > > specification. > > According to Dolbys Bitstream specification this read does not seem > right. It reads half of a reserved field and 3 single-bit control > fields - in a structure called "channel meaning", which otherwise only > includes fields on channel assignment and interpretation, so this > field being in there seems weird. > Also, why would they code a literal value, and not a lookup table with > fewer bits like the 0xbb case does? > > Unless we can find an actual real-world sample from a licensed encoder > that can confirm the presence and accuracy of this field, I'm going to > assume its not correct. It looks to me like it may be writing a MLP > (ie. 0xbb) header, and not a TrueHD header - beyond the first > differences, anyway. The high-level bitstream specification was not > available when mlpenc.c was initially written. Thank you for looking into this! Is there a link to the high-level bitstream specification? Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH]lavc/mlp_parse: Read wordlength from 0xba streams
On Fri, Feb 14, 2020 at 11:45 AM Carl Eugen Hoyos wrote: > > Am Fr., 14. Feb. 2020 um 01:26 Uhr schrieb Hendrik Leppkes > : > > > > On Fri, Feb 14, 2020 at 12:29 AM Carl Eugen Hoyos > > wrote: > > > > > > Attached patch allows detecting s16 truehd streams encoded with > > > FFmpeg, only tested with FFmpeg's encoder, I did not look into any > > > specification. > > > > According to Dolbys Bitstream specification this read does not seem > > right. It reads half of a reserved field and 3 single-bit control > > fields - in a structure called "channel meaning", which otherwise only > > includes fields on channel assignment and interpretation, so this > > field being in there seems weird. > > Also, why would they code a literal value, and not a lookup table with > > fewer bits like the 0xbb case does? > > > > Unless we can find an actual real-world sample from a licensed encoder > > that can confirm the presence and accuracy of this field, I'm going to > > assume its not correct. It looks to me like it may be writing a MLP > > (ie. 0xbb) header, and not a TrueHD header - beyond the first > > differences, anyway. The high-level bitstream specification was not > > available when mlpenc.c was initially written. > > Thank you for looking into this! > Is there a link to the high-level bitstream specification? > Its here: https://developer.dolby.com/globalassets/technology/dolby-truehd/dolbytruehdhighlevelbitstreamdescription.pdf - Hendrik ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH]lavc/mlp_parse: Read wordlength from 0xba streams
Am Fr., 14. Feb. 2020 um 11:48 Uhr schrieb Hendrik Leppkes : > > On Fri, Feb 14, 2020 at 11:45 AM Carl Eugen Hoyos wrote: > > > > Am Fr., 14. Feb. 2020 um 01:26 Uhr schrieb Hendrik Leppkes > > : > > > > > > On Fri, Feb 14, 2020 at 12:29 AM Carl Eugen Hoyos > > > wrote: > > > > > > > > Attached patch allows detecting s16 truehd streams encoded with > > > > FFmpeg, only tested with FFmpeg's encoder, I did not look into any > > > > specification. > > > > > > According to Dolbys Bitstream specification this read does not seem > > > right. It reads half of a reserved field and 3 single-bit control > > > fields - in a structure called "channel meaning", which otherwise only > > > includes fields on channel assignment and interpretation, so this > > > field being in there seems weird. > > > Also, why would they code a literal value, and not a lookup table with > > > fewer bits like the 0xbb case does? > > > > > > Unless we can find an actual real-world sample from a licensed encoder > > > that can confirm the presence and accuracy of this field, I'm going to > > > assume its not correct. It looks to me like it may be writing a MLP > > > (ie. 0xbb) header, and not a TrueHD header - beyond the first > > > differences, anyway. The high-level bitstream specification was not > > > available when mlpenc.c was initially written. > > > > Thank you for looking into this! > > Is there a link to the high-level bitstream specification? > > > > Its here: > https://developer.dolby.com/globalassets/technology/dolby-truehd/dolbytruehdhighlevelbitstreamdescription.pdf Thank you. The way I read this document is that precision is not stored and that we need a decoder option to force decoding less than 24 bits. Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH]lavc/mlp_parse: Read wordlength from 0xba streams
On 2/14/20, Carl Eugen Hoyos wrote: > Am Fr., 14. Feb. 2020 um 11:48 Uhr schrieb Hendrik Leppkes > : >> >> On Fri, Feb 14, 2020 at 11:45 AM Carl Eugen Hoyos >> wrote: >> > >> > Am Fr., 14. Feb. 2020 um 01:26 Uhr schrieb Hendrik Leppkes >> > : >> > > >> > > On Fri, Feb 14, 2020 at 12:29 AM Carl Eugen Hoyos >> > > wrote: >> > > > >> > > > Attached patch allows detecting s16 truehd streams encoded with >> > > > FFmpeg, only tested with FFmpeg's encoder, I did not look into any >> > > > specification. >> > > >> > > According to Dolbys Bitstream specification this read does not seem >> > > right. It reads half of a reserved field and 3 single-bit control >> > > fields - in a structure called "channel meaning", which otherwise only >> > > includes fields on channel assignment and interpretation, so this >> > > field being in there seems weird. >> > > Also, why would they code a literal value, and not a lookup table with >> > > fewer bits like the 0xbb case does? >> > > >> > > Unless we can find an actual real-world sample from a licensed encoder >> > > that can confirm the presence and accuracy of this field, I'm going to >> > > assume its not correct. It looks to me like it may be writing a MLP >> > > (ie. 0xbb) header, and not a TrueHD header - beyond the first >> > > differences, anyway. The high-level bitstream specification was not >> > > available when mlpenc.c was initially written. >> > >> > Thank you for looking into this! >> > Is there a link to the high-level bitstream specification? >> > >> >> Its here: >> https://developer.dolby.com/globalassets/technology/dolby-truehd/dolbytruehdhighlevelbitstreamdescription.pdf > > Thank you. > The way I read this document is that precision is not stored and that we > need > a decoder option to force decoding less than 24 bits. No, your patch is nonsense. Encoder stores only 24 bit pcm, 16bit pcm is upconverted to 24 bit inside encoder, which is far from ideal. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH]lavc/mlp_parse: Read wordlength from 0xba streams
Am Fr., 14. Feb. 2020 um 12:02 Uhr schrieb Paul B Mahol : > > On 2/14/20, Carl Eugen Hoyos wrote: > > The way I read this document is that precision is not stored and that we > > need a decoder option to force decoding less than 24 bits. > > No, your patch is nonsense. Hendrik already explained this > Encoder stores only 24 bit pcm, 16bit pcm is upconverted to 24 bit > inside encoder, which is far from ideal. Isn't this what I wrote above? Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH]lavc/mlp_parse: Read wordlength from 0xba streams
On 2/14/20, Carl Eugen Hoyos wrote: > Am Fr., 14. Feb. 2020 um 12:02 Uhr schrieb Paul B Mahol : >> >> On 2/14/20, Carl Eugen Hoyos wrote: > >> > The way I read this document is that precision is not stored and that we >> > need a decoder option to force decoding less than 24 bits. >> >> No, your patch is nonsense. > > Hendrik already explained this > >> Encoder stores only 24 bit pcm, 16bit pcm is upconverted to 24 bit >> inside encoder, which is far from ideal. > > Isn't this what I wrote above? > No, I'm of opinion that 16bit should be remove from encoder. Instead of adding option to decoder. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH]lavc/mlp_parse: Read wordlength from 0xba streams
Am Fr., 14. Feb. 2020 um 12:07 Uhr schrieb Paul B Mahol : > > On 2/14/20, Carl Eugen Hoyos wrote: > > Am Fr., 14. Feb. 2020 um 12:02 Uhr schrieb Paul B Mahol : > >> > >> On 2/14/20, Carl Eugen Hoyos wrote: > > > >> > The way I read this document is that precision is not stored and that we > >> > need a decoder option to force decoding less than 24 bits. > >> > >> No, your patch is nonsense. > > > > Hendrik already explained this > > > >> Encoder stores only 24 bit pcm, 16bit pcm is upconverted to 24 bit > >> inside encoder, which is far from ideal. > > > > Isn't this what I wrote above? > > > > No, I'm of opinion that 16bit should be remove from encoder. Instead > of adding option to decoder. Understood. Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 1/2] avcodec/dstdec: Use local channels variable
lgtm On 2/13/20, Michael Niedermayer wrote: > Signed-off-by: Michael Niedermayer > --- > libavcodec/dstdec.c | 14 +++--- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/libavcodec/dstdec.c b/libavcodec/dstdec.c > index 880b838b0c..bdabced823 100644 > --- a/libavcodec/dstdec.c > +++ b/libavcodec/dstdec.c > @@ -262,7 +262,7 @@ static int decode_frame(AVCodecContext *avctx, void > *data, > skip_bits1(gb); > if (get_bits(gb, 6)) > return AVERROR_INVALIDDATA; > -memcpy(frame->data[0], avpkt->data + 1, FFMIN(avpkt->size - 1, > frame->nb_samples * avctx->channels)); > +memcpy(frame->data[0], avpkt->data + 1, FFMIN(avpkt->size - 1, > frame->nb_samples * channels)); > goto dsd; > } > > @@ -287,7 +287,7 @@ static int decode_frame(AVCodecContext *avctx, void > *data, > > same_map = get_bits1(gb); > > -if ((ret = read_map(gb, &s->fsets, map_ch_to_felem, avctx->channels)) < > 0) > +if ((ret = read_map(gb, &s->fsets, map_ch_to_felem, channels)) < 0) > return ret; > > if (same_map) { > @@ -295,13 +295,13 @@ static int decode_frame(AVCodecContext *avctx, void > *data, > memcpy(map_ch_to_pelem, map_ch_to_felem, sizeof(map_ch_to_felem)); > } else { > avpriv_request_sample(avctx, "Not Same Mapping"); > -if ((ret = read_map(gb, &s->probs, map_ch_to_pelem, > avctx->channels)) < 0) > +if ((ret = read_map(gb, &s->probs, map_ch_to_pelem, channels)) < 0) > return ret; > } > > /* Half Probability (10.10) */ > > -for (ch = 0; ch < avctx->channels; ch++) > +for (ch = 0; ch < channels; ch++) > half_prob[ch] = get_bits1(gb); > > /* Filter Coef Sets (10.12) */ > @@ -325,7 +325,7 @@ static int decode_frame(AVCodecContext *avctx, void > *data, > build_filter(s->filter, &s->fsets); > > memset(s->status, 0xAA, sizeof(s->status)); > -memset(dsd, 0, frame->nb_samples * 4 * avctx->channels); > +memset(dsd, 0, frame->nb_samples * 4 * channels); > > ac_get(ac, gb, prob_dst_x_bit(s->fsets.coeff[0][0]), &dst_x_bit); > > @@ -364,10 +364,10 @@ static int decode_frame(AVCodecContext *avctx, void > *data, > } > > dsd: > -for (i = 0; i < avctx->channels; i++) { > +for (i = 0; i < channels; i++) { > ff_dsd2pcm_translate(&s->dsdctx[i], frame->nb_samples, 0, > frame->data[0] + i * 4, > - avctx->channels * 4, pcm + i, > avctx->channels); > + channels * 4, pcm + i, channels); > } > > *got_frame_ptr = 1; > -- > 2.17.1 > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH] avcodec/dvdsub: Fix warning about incompatible pointer type
Fixes "passing argument 2 of ‘strtoul’ from incompatible pointer type [-Wincompatible-pointer-types]" ("expected ‘char ** restrict’ but argument is of type ‘const char **’") for GCC and "passing 'const char **' to parameter of type 'char **' discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers]" for Clang. The cast itself is safe; it is only needed because strtoul itself is not const-correct. Signed-off-by: Andreas Rheinhardt --- libavcodec/dvdsub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/dvdsub.c b/libavcodec/dvdsub.c index a03ff27754..87215d2bd1 100644 --- a/libavcodec/dvdsub.c +++ b/libavcodec/dvdsub.c @@ -26,7 +26,7 @@ void ff_dvdsub_parse_palette(uint32_t *palette, const char *p) { for (int i = 0; i < 16; i++) { -palette[i] = strtoul(p, &p, 16); +palette[i] = strtoul(p, (char **)&p, 16); while (*p == ',' || av_isspace(*p)) p++; } -- 2.20.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] avcodec/dvdsub: Fix warning about incompatible pointer type
LGTM On 2/14/20, Andreas Rheinhardt wrote: > Fixes "passing argument 2 of ‘strtoul’ from incompatible pointer > type [-Wincompatible-pointer-types]" ("expected ‘char ** restrict’ but > argument is of type ‘const char **’") for GCC and "passing 'const char > **' to parameter of type 'char **' discards qualifiers in nested pointer > types [-Wincompatible-pointer-types-discards-qualifiers]" for Clang. > > The cast itself is safe; it is only needed because strtoul itself is not > const-correct. > > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/dvdsub.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavcodec/dvdsub.c b/libavcodec/dvdsub.c > index a03ff27754..87215d2bd1 100644 > --- a/libavcodec/dvdsub.c > +++ b/libavcodec/dvdsub.c > @@ -26,7 +26,7 @@ > void ff_dvdsub_parse_palette(uint32_t *palette, const char *p) > { > for (int i = 0; i < 16; i++) { > -palette[i] = strtoul(p, &p, 16); > +palette[i] = strtoul(p, (char **)&p, 16); > while (*p == ',' || av_isspace(*p)) > p++; > } > -- > 2.20.1 > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] avcodec/dvdsub: Fix warning about incompatible pointer type
On 2/14/2020 8:46 AM, Paul B Mahol wrote: > LGTM > > On 2/14/20, Andreas Rheinhardt wrote: >> Fixes "passing argument 2 of ‘strtoul’ from incompatible pointer >> type [-Wincompatible-pointer-types]" ("expected ‘char ** restrict’ but >> argument is of type ‘const char **’") for GCC and "passing 'const char >> **' to parameter of type 'char **' discards qualifiers in nested pointer >> types [-Wincompatible-pointer-types-discards-qualifiers]" for Clang. >> >> The cast itself is safe; it is only needed because strtoul itself is not >> const-correct. >> >> Signed-off-by: Andreas Rheinhardt >> --- >> libavcodec/dvdsub.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/libavcodec/dvdsub.c b/libavcodec/dvdsub.c >> index a03ff27754..87215d2bd1 100644 >> --- a/libavcodec/dvdsub.c >> +++ b/libavcodec/dvdsub.c >> @@ -26,7 +26,7 @@ >> void ff_dvdsub_parse_palette(uint32_t *palette, const char *p) >> { >> for (int i = 0; i < 16; i++) { >> -palette[i] = strtoul(p, &p, 16); >> +palette[i] = strtoul(p, (char **)&p, 16); >> while (*p == ',' || av_isspace(*p)) >> p++; >> } Pushed. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 1/3] avutil/frame: add use_last_roi
On 2/14/2020 5:33 AM, Hendrik Leppkes wrote: > On Fri, Feb 14, 2020 at 4:41 AM Guo, Yejun wrote: >> >> For some cases, the regions of interest do not change, it is not >> convenient to always prepare the roi data for every frame. So, add >> use_last_roi to show it uses the same roi data as last frame. >> >> Since a new flag is added into AVFrame, the major version number of >> lavu is changed. >> > > Changing the major version for a field addition is not acceptable, it > should be added to the end and not require that. Furthermore, I feel > like the entire presence of that field in AVFrame is not a good idea. > Its a very specific field, and we actively tried to remove such fields > from the very generic structures like AVFrame, using side-data and > other feature/codec-specific things instead. ROI itself is side-data, > so this flag should be as well. This new field is also not acceptable because, same as the disposable flag i wanted to add some time ago, it is not really an attribute of a frame in itself, but of a frame in a frame chain. > > - Hendrik > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 1/3] avutil/frame: add use_last_roi
Hi, On Thu, Feb 13, 2020 at 10:41 PM Guo, Yejun wrote: > For some cases, the regions of interest do not change, it is not > convenient to always prepare the roi data for every frame. Since side-data is refcounted, can't you just keep the "last" one in memory and refcount it? That way, if you wanted to know if it's the same, you can compare pointers, or if you want to access the ROI data directly, you can do that, but it doesn't require a copy. Ronald ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 1/2] avcodec/dstdec: Use local channels variable
On Fri, Feb 14, 2020 at 10:20:41AM +0100, Paul B Mahol wrote: > lgtm will apply thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Dictatorship naturally arises out of democracy, and the most aggravated form of tyranny and slavery out of the most extreme liberty. -- Plato signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 2/2] avcodec/dstdec: Check sample rate
LGTM On 2/13/20, Michael Niedermayer wrote: > Fixes: out of array access > Fixes: > 20659/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DST_fuzzer-5735812071424000 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer > --- > libavcodec/dstdec.c | 5 + > 1 file changed, 5 insertions(+) > > diff --git a/libavcodec/dstdec.c b/libavcodec/dstdec.c > index bdabced823..0505d3fde5 100644 > --- a/libavcodec/dstdec.c > +++ b/libavcodec/dstdec.c > @@ -86,6 +86,11 @@ static av_cold int decode_init(AVCodecContext *avctx) > return AVERROR_PATCHWELCOME; > } > > +if (DST_SAMPLES_PER_FRAME(avctx->sample_rate) & 7) { > +avpriv_request_sample(avctx, "sample rate %d", avctx->sample_rate); > +return AVERROR_PATCHWELCOME; > +} > + > avctx->sample_fmt = AV_SAMPLE_FMT_FLT; > > for (i = 0; i < avctx->channels; i++) > -- > 2.17.1 > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 2/2] avcodec/dstdec: Check sample rate
LGTM On 2/13/20, Michael Niedermayer wrote: > Fixes: out of array access > Fixes: > 20659/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DST_fuzzer-5735812071424000 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer > --- > libavcodec/dstdec.c | 5 + > 1 file changed, 5 insertions(+) > > diff --git a/libavcodec/dstdec.c b/libavcodec/dstdec.c > index bdabced823..0505d3fde5 100644 > --- a/libavcodec/dstdec.c > +++ b/libavcodec/dstdec.c > @@ -86,6 +86,11 @@ static av_cold int decode_init(AVCodecContext *avctx) > return AVERROR_PATCHWELCOME; > } > > +if (DST_SAMPLES_PER_FRAME(avctx->sample_rate) & 7) { > +avpriv_request_sample(avctx, "sample rate %d", avctx->sample_rate); > +return AVERROR_PATCHWELCOME; > +} > + > avctx->sample_fmt = AV_SAMPLE_FMT_FLT; > > for (i = 0; i < avctx->channels; i++) > -- > 2.17.1 > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 2/2] avcodec/dstdec: Check sample rate
Actually I'm pretty sure log message is not needed as not power of 8 is simply not possible. On 2/14/20, Paul B Mahol wrote: > LGTM > > On 2/13/20, Michael Niedermayer wrote: >> Fixes: out of array access >> Fixes: >> 20659/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DST_fuzzer-5735812071424000 >> >> Found-by: continuous fuzzing process >> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg >> Signed-off-by: Michael Niedermayer >> --- >> libavcodec/dstdec.c | 5 + >> 1 file changed, 5 insertions(+) >> >> diff --git a/libavcodec/dstdec.c b/libavcodec/dstdec.c >> index bdabced823..0505d3fde5 100644 >> --- a/libavcodec/dstdec.c >> +++ b/libavcodec/dstdec.c >> @@ -86,6 +86,11 @@ static av_cold int decode_init(AVCodecContext *avctx) >> return AVERROR_PATCHWELCOME; >> } >> >> +if (DST_SAMPLES_PER_FRAME(avctx->sample_rate) & 7) { >> +avpriv_request_sample(avctx, "sample rate %d", >> avctx->sample_rate); >> +return AVERROR_PATCHWELCOME; >> +} >> + >> avctx->sample_fmt = AV_SAMPLE_FMT_FLT; >> >> for (i = 0; i < avctx->channels; i++) >> -- >> 2.17.1 >> >> ___ >> ffmpeg-devel mailing list >> ffmpeg-devel@ffmpeg.org >> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel >> >> To unsubscribe, visit link above, or email >> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 2/2] fftools/ffprobe: Remove unneeded casts
On Tue, Aug 06, 2019 at 03:17:06AM +0200, Andreas Rheinhardt wrote: > Signed-off-by: Andreas Rheinhardt > --- > fftools/ffprobe.c | 20 ++-- > 1 file changed, 10 insertions(+), 10 deletions(-) will apply thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Freedom in capitalist society always remains about the same as it was in ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 4/7] avformat/segafilmenc: Remove AVClass
Andreas Rheinhardt: > This muxer does not have any private options and so does not need a > private class. > > Signed-off-by: Andreas Rheinhardt > --- > libavformat/segafilmenc.c | 8 > 1 file changed, 8 deletions(-) > > diff --git a/libavformat/segafilmenc.c b/libavformat/segafilmenc.c > index bd7c03faf5..5ac60ea5c3 100644 > --- a/libavformat/segafilmenc.c > +++ b/libavformat/segafilmenc.c > @@ -45,7 +45,6 @@ typedef struct FILMPacket { > } FILMPacket; > > typedef struct FILMOutputContext { > -const AVClass *class; > int audio_index; > int video_index; > int64_t stab_pos; > @@ -377,12 +376,6 @@ static int film_write_header(AVFormatContext > *format_context) > return 0; > } > > -static const AVClass film_muxer_class = { > -.class_name = "Sega FILM muxer", > -.item_name = av_default_item_name, > -.version= LIBAVUTIL_VERSION_INT, > -}; > - > AVOutputFormat ff_segafilm_muxer = { > .name = "film_cpk", > .long_name = NULL_IF_CONFIG_SMALL("Sega FILM / CPK"), > @@ -393,5 +386,4 @@ AVOutputFormat ff_segafilm_muxer = { > .init = film_init, > .write_trailer = film_write_header, > .write_packet = film_write_packet, > -.priv_class = &film_muxer_class, > }; > Ping. - Andreas ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH] avcodec: fix pcm zork decoder
Fixes #1939 Signed-off-by: Paul B Mahol --- libavcodec/Makefile | 2 +- libavcodec/adpcm.c | 60 + libavcodec/allcodecs.c | 2 +- libavcodec/codec_desc.c | 4 +-- libavcodec/pcm.c| 9 --- 5 files changed, 64 insertions(+), 13 deletions(-) diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 7825f2741b..b007b1e31e 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -809,7 +809,6 @@ OBJS-$(CONFIG_PCM_U32LE_DECODER) += pcm.o OBJS-$(CONFIG_PCM_U32LE_ENCODER) += pcm.o OBJS-$(CONFIG_PCM_VIDC_DECODER) += pcm.o OBJS-$(CONFIG_PCM_VIDC_ENCODER) += pcm.o -OBJS-$(CONFIG_PCM_ZORK_DECODER) += pcm.o OBJS-$(CONFIG_ADPCM_4XM_DECODER) += adpcm.o adpcm_data.o OBJS-$(CONFIG_ADPCM_ADX_DECODER) += adxdec.o adx.o @@ -864,6 +863,7 @@ OBJS-$(CONFIG_ADPCM_VIMA_DECODER) += vima.o adpcm_data.o OBJS-$(CONFIG_ADPCM_XA_DECODER) += adpcm.o adpcm_data.o OBJS-$(CONFIG_ADPCM_YAMAHA_DECODER) += adpcm.o adpcm_data.o OBJS-$(CONFIG_ADPCM_YAMAHA_ENCODER) += adpcmenc.o adpcm_data.o +OBJS-$(CONFIG_PCM_ZORK_DECODER) += adpcm.o adpcm_data.o # hardware accelerators OBJS-$(CONFIG_D3D11VA)+= dxva2.o diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index 0cd28431d7..6ede0bbb09 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -83,6 +83,10 @@ static const int8_t swf_index_tables[4][16] = { /*5*/ { -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 4, 6, 8, 10, 13, 16 } }; +static const int8_t zork_index_table[8] = { +-1, -1, -1, 1, 4, 7, 10, 12, +}; + /* end of tables */ typedef struct ADPCMDecodeContext { @@ -154,6 +158,10 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx) if (avctx->bits_per_coded_sample != 4) return AVERROR_INVALIDDATA; break; +case AV_CODEC_ID_PCM_ZORK: +if (avctx->bits_per_coded_sample != 8) +return AVERROR_INVALIDDATA; +break; default: break; } @@ -416,6 +424,41 @@ static inline int16_t adpcm_mtaf_expand_nibble(ADPCMChannelStatus *c, uint8_t ni return c->predictor; } +static inline int16_t adpcm_zork_expand_nibble(ADPCMChannelStatus *c, uint8_t nibble) +{ +int16_t index = c->step_index; +uint32_t lookup_sample = ff_adpcm_step_table[index]; +int32_t sample = 0; + +if (nibble & 0x40) +sample += lookup_sample; +if (nibble & 0x20) +sample += lookup_sample >> 1; +if (nibble & 0x10) +sample += lookup_sample >> 2; +if (nibble & 0x08) +sample += lookup_sample >> 3; +if (nibble & 0x04) +sample += lookup_sample >> 4; +if (nibble & 0x02) +sample += lookup_sample >> 5; +if (nibble & 0x01) +sample += lookup_sample >> 6; +if (nibble & 0x80) +sample = -sample; + +sample += c->predictor; +sample = av_clip_int16(sample); + +index += zork_index_table[(nibble >> 4) & 7]; +index = av_clip(index, 0, 88); + +c->predictor = sample; +c->step_index = index; + +return sample; +} + static int xa_decode(AVCodecContext *avctx, int16_t *out0, int16_t *out1, const uint8_t *in, ADPCMChannelStatus *left, ADPCMChannelStatus *right, int channels, int sample_offset) @@ -780,6 +823,9 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb, case AV_CODEC_ID_ADPCM_PSX: nb_samples = buf_size / (16 * ch) * 28; break; +case AV_CODEC_ID_PCM_ZORK: +nb_samples = buf_size / ch; +break; } /* validate coded sample count */ @@ -1842,6 +1888,19 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data, } } break; +case AV_CODEC_ID_PCM_ZORK: +if (!c->has_status) { +for (channel = 0; channel < avctx->channels; channel++) { +c->status[channel].predictor = 0; +c->status[channel].step_index = 0; +} +c->has_status = 1; +} +for (n = 0; n < nb_samples * avctx->channels; n++) { +int v = bytestream2_get_byteu(&gb); +*samples++ = adpcm_zork_expand_nibble(&c->status[n % avctx->channels], v); +} +break; default: av_assert0(0); // unsupported codec_id should not happen } @@ -1930,3 +1989,4 @@ ADPCM_DECODER(AV_CODEC_ID_ADPCM_THP_LE, sample_fmts_s16p, adpcm_thp_le, ADPCM_DECODER(AV_CODEC_ID_ADPCM_THP, sample_fmts_s16p, adpcm_thp, "ADPCM Nintendo THP"); ADPCM_DECODER(AV_CODEC_ID_ADPCM_XA, sample_fmts_s16p, adpcm_xa, "ADPCM CDROM XA"); ADPCM_DECODER(AV_CODEC_ID_ADPCM_YAMAHA, sample_fmts_s16, adpcm_yamaha, "ADPCM Yamaha"); +ADPCM_DECODER(AV_CODEC_ID_PCM_ZORK, sample_fmts_s16, adpcm_zork, "ADPCM Zork"); diff --git a/libavcodec/allcodecs.c
Re: [FFmpeg-devel] [PATCH 01/12] avformat/tests/url: make format more readable
On Sat, 8 Feb 2020, Marton Balint wrote: Signed-off-by: Marton Balint --- libavformat/tests/url.c | 3 ++- tests/ref/fate/url | 27 ++- 2 files changed, 16 insertions(+), 14 deletions(-) Ping for the series, will apply soon... Thanks, Marton diff --git a/libavformat/tests/url.c b/libavformat/tests/url.c index 1623179128..11ed5bb0b7 100644 --- a/libavformat/tests/url.c +++ b/libavformat/tests/url.c @@ -24,7 +24,7 @@ static void test(const char *base, const char *rel) { char buf[200], buf2[200]; ff_make_absolute_url(buf, sizeof(buf), base, rel); -printf("%s\n", buf); +printf("%50s %-20s => %s\n", base, rel, buf); if (base) { /* Test in-buffer replacement */ snprintf(buf2, sizeof(buf2), "%s", base); @@ -38,6 +38,7 @@ static void test(const char *base, const char *rel) int main(void) { +printf("Testing ff_make_absolute_url:\n"); test(NULL, "baz"); test("/foo/bar", "baz"); test("/foo/bar", "../baz"); diff --git a/tests/ref/fate/url b/tests/ref/fate/url index 1a6051ee0f..b5deba88ae 100644 --- a/tests/ref/fate/url +++ b/tests/ref/fate/url @@ -1,13 +1,14 @@ -baz -/foo/baz -/baz -/baz -http://server/foo/baz -http://server/foo/baz -http://server/baz -http://server/baz -http://server/baz -https://other/url -http://server/baz -http://server/foo/bar?someparam -http://other/url +Testing ff_make_absolute_url: +(null) baz => baz + /foo/bar baz => /foo/baz + /foo/bar ../baz => /baz + /foo/bar /baz => /baz +http://server/foo/ baz => http://server/foo/baz + http://server/foo/bar baz => http://server/foo/baz +http://server/foo/ ../baz => http://server/baz + http://server/foo/bar/123 ../../baz=> http://server/baz + http://server/foo/bar/123 /baz => http://server/baz + http://server/foo/bar/123 https://other/url=> https://other/url +http://server/foo/bar?param=value/with/slashes /baz => http://server/baz +http://server/foo/bar?param&otherparam ?someparam => http://server/foo/bar?someparam + http://server/foo/bar //other/url => http://other/url -- 2.16.4 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH] fftools/ffmpeg_filter: add -autoscale to disable/enable the default scale
Currently, ffmpeg inserts scale filter by default in the filter graph to force the whole decoded stream to scale into the same size with the first frame. It's not quite make sense in resolution changing cases if user wants the rawvideo without any scale. Using autoscale/noautoscale as an output option to indicate whether auto inserting the scale filter in the filter graph: -noautoscale or -autoscale 0: disable the default auto scale filter inserting. ffmpeg -y input.mp4 out1.yuv -noautoscale out2.yuv -autoscale 0 out3.yuv Update docs. Signed-off-by: U. Artie Eoff Signed-off-by: Linjie Fu --- Using autoscale as an output option and fix the missing spaces. doc/ffmpeg.texi | 16 fftools/ffmpeg.h| 3 +++ fftools/ffmpeg_filter.c | 2 +- fftools/ffmpeg_opt.c| 8 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi index 29753f0..aebafb3 100644 --- a/doc/ffmpeg.texi +++ b/doc/ffmpeg.texi @@ -734,10 +734,6 @@ ffmpeg -dump_attachment:t "" -i INPUT Technical note -- attachments are implemented as codec extradata, so this option can actually be used to extract extradata from any stream, not just attachments. - -@item -noautorotate -Disable automatically rotating video based on file metadata. - @end table @section Video Options @@ -819,6 +815,18 @@ Create the filtergraph specified by @var{filtergraph} and use it to filter the stream. This is an alias for @code{-filter:v}, see the @ref{filter_option,,-filter option}. + +@item -autorotate +Automatically rotate the video according to file metadata. Enabled by +default, use @option{-noautorotate} to disable it. + +@item -autoscale +Automatically scale the video according to the resolution of first frame. +Enabled by default, use @option{-noautoscale} to disable it. When autoscale is +disabled, all output frames of filter graph might not be in the same resolution +and may be inadequate for some encoder/muxer. Therefore, it is not recommended +to disable it unless you really know what you are doing. +Disable autoscale at your own risk. @end table @section Advanced Video options diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index 7b6f802..8beba6c 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -230,6 +230,8 @@ typedef struct OptionsContext { intnb_time_bases; SpecifierOpt *enc_time_bases; intnb_enc_time_bases; +SpecifierOpt *autoscale; +intnb_autoscale; } OptionsContext; typedef struct InputFilter { @@ -479,6 +481,7 @@ typedef struct OutputStream { int force_fps; int top_field_first; int rotate_overridden; +int autoscale; double rotate_override_value; AVRational frame_aspect_ratio; diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index 40cc4c1..46c8ea8 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -469,7 +469,7 @@ static int configure_output_video_filter(FilterGraph *fg, OutputFilter *ofilter, if (ret < 0) return ret; -if (ofilter->width || ofilter->height) { +if ((ofilter->width || ofilter->height) && ofilter->ost->autoscale) { char args[255]; AVFilterContext *filter; AVDictionaryEntry *e = NULL; diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index 12d4488..62bcfc1 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -1405,6 +1405,8 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e ost->encoder_opts = filter_codec_opts(o->g->codec_opts, ost->enc->id, oc, st, ost->enc); MATCH_PER_STREAM_OPT(presets, str, preset, oc, st); +ost->autoscale = 1; +MATCH_PER_STREAM_OPT(autoscale, i, ost->autoscale, oc, st); if (preset && (!(ret = get_preset_file_2(preset, ost->enc->name, &s { do { buf = get_line(s); @@ -3650,6 +3652,12 @@ const OptionDef options[] = { { "autorotate", HAS_ARG | OPT_BOOL | OPT_SPEC | OPT_EXPERT | OPT_INPUT, { .off = OFFSET(autorotate) }, "automatically insert correct rotate filters" }, +{ "autoscale",HAS_ARG | OPT_BOOL | OPT_SPEC | + OPT_EXPERT | OPT_OUTPUT, { .off = OFFSET(autoscale) }, +"automatically insert a scale filter at the end of the filter graph if a resolution " +"change is detected. This ensures all frames are the same resolution as the first frame " +"when they leave the filter chain (this option is enabled by default). " +"If disabled, some encoders/muxers may not support this mode."}, /* audio options */ { "aframes",OPT_AUDIO | HAS_ARG | OPT_PERFILE | OPT_OUTPUT, { .func_arg = opt_audio_frames }, -- 2.7.4 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.
Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg_filter: add -autoscale to disable/enable the default scale
> -Original Message- > From: ffmpeg-devel On Behalf Of > Paul B Mahol > Sent: Friday, February 14, 2020 16:55 > To: FFmpeg development discussions and patches de...@ffmpeg.org> > Subject: Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg_filter: add -autoscale > to disable/enable the default scale > > On 2/14/20, Fu, Linjie wrote: > >> -Original Message- > >> From: ffmpeg-devel On Behalf Of > Fu, > >> Linjie > >> Sent: Tuesday, February 11, 2020 20:58 > >> To: FFmpeg development discussions and patches >> de...@ffmpeg.org> > >> Subject: Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg_filter: add - > autoscale > >> to disable/enable the default scale > >> > >> > -Original Message- > >> > From: ffmpeg-devel On Behalf > Of > >> > Moritz Barsnick > >> > Sent: Tuesday, February 11, 2020 19:04 > >> > To: FFmpeg development discussions and patches >> > de...@ffmpeg.org> > >> > Subject: Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg_filter: add > >> > -autoscale > >> > to disable/enable the default scale > >> > > >> > On Mon, Feb 10, 2020 at 17:27:03 +0800, Linjie Fu wrote: > >> > > +{ "autoscale",HAS_ARG | OPT_BOOL | OPT_SPEC | > >> > > + OPT_EXPERT | OPT_OUTPUT, > >> > >{ .off = > >> > OFFSET(autoscale) }, > >> > > +"automatically insert a scale filter at the end of the filter > >> > > graph if a > >> > resolution" > >> > > +"change is detected. This ensures all frames are the same > >> > > resolution > >> > as the first frame" > >> > > +"when they leave the filter chain (this option is enabled by > >> default)." > >> > > +"If disabled, some encoders/muxers may not support this > >> > > mode."}, > >> > > >> > Have you checked the output of "ffmpeg -h"? Your C strings merge > >> > directly together, and are therefore missing spaces, e.g. in > >> > "resolutionchange" and "as the first framewhen they leave", > >> > > >> Yes, spaces should be added, thanks for pointing this out :). > >> > >> I'll fix this in next version together with other suggestions if there is > >> any. > >> > > Ping, any suggestions? > > Send updated patch with spaces fixed. > Updated and resend the patch, thanks for review. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] avfilter/vf_zscale: fix crash on unaligned input
Sent with [ProtonMail](https://protonmail.com) Secure Email. 0001-avfilter-vf_zscale-fix-crash-on-unaligned-input.patch Description: Binary data ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] lavc/qsvenc: add support for external bitrate control for HEVC
Linjie Fu 于2020年2月13日周四 下午8:50写道: > > Enables option for hevc_qsv encoder: > -extbrc > > Improvements in BD-Rate could be observed with extbrc on. > > Signed-off-by: Linjie Fu > --- > Details for extbrc: > https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#external-bit-rate-control > > The improvement differs depending on the platform/clips/bitrate. > Based on the verifying on ICL, ~20% improvement in BD-Rate could be observed. Is there any HW platform requirement for this feature? And how much quality improvement for H264? > libavcodec/qsvenc.c | 18 -- > 1 file changed, 12 insertions(+), 6 deletions(-) > > diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c > index 9e41650..7f964ad 100644 > --- a/libavcodec/qsvenc.c > +++ b/libavcodec/qsvenc.c > @@ -681,11 +681,8 @@ FF_ENABLE_DEPRECATION_WARNINGS > > q->extparam_internal[q->nb_extparam_internal++] = (mfxExtBuffer > *)&q->extco; > > -if (avctx->codec_id == AV_CODEC_ID_H264) { > #if QSV_HAVE_CO2 > -q->extco2.Header.BufferId = MFX_EXTBUFF_CODING_OPTION2; > -q->extco2.Header.BufferSz = sizeof(q->extco2); > - > +if (avctx->codec_id == AV_CODEC_ID_H264) { > if (q->int_ref_type >= 0) > q->extco2.IntRefType = q->int_ref_type; > if (q->int_ref_cycle_size >= 0) > @@ -697,8 +694,6 @@ FF_ENABLE_DEPRECATION_WARNINGS > q->extco2.BitrateLimit = q->bitrate_limit ? > MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF; > if (q->mbbrc >= 0) > q->extco2.MBBRC = q->mbbrc ? MFX_CODINGOPTION_ON : > MFX_CODINGOPTION_OFF; > -if (q->extbrc >= 0) > -q->extco2.ExtBRC = q->extbrc ? MFX_CODINGOPTION_ON : > MFX_CODINGOPTION_OFF; > > if (q->max_frame_size >= 0) > q->extco2.MaxFrameSize = q->max_frame_size; > @@ -746,9 +741,20 @@ FF_ENABLE_DEPRECATION_WARNINGS > q->extco2.MaxQPP = q->extco2.MaxQPB = q->extco2.MaxQPI; > } > #endif > +} > + > +if (avctx->codec_id == AV_CODEC_ID_H264 || avctx->codec_id == > AV_CODEC_ID_HEVC) { > +if (q->extbrc >= 0) > +q->extco2.ExtBRC = q->extbrc ? MFX_CODINGOPTION_ON : > MFX_CODINGOPTION_OFF; > + > +q->extco2.Header.BufferId = MFX_EXTBUFF_CODING_OPTION2; > +q->extco2.Header.BufferSz = sizeof(q->extco2); > + > q->extparam_internal[q->nb_extparam_internal++] = (mfxExtBuffer > *)&q->extco2; > +} > #endif > > +if (avctx->codec_id == AV_CODEC_ID_H264) { > #if QSV_HAVE_MF > if (QSV_RUNTIME_VERSION_ATLEAST(q->ver, 1, 25)) { > q->extmfp.Header.BufferId = > MFX_EXTBUFF_MULTI_FRAME_PARAM; > -- > 2.7.4 Patch LGTM ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".