Re: [FFmpeg-devel] [PATCH] hevc: extract SEI caption data
On Fri, Nov 06, 2015 at 02:48:46PM -0600, Will Kelleher wrote: > Signed-off-by: Will Kelleher > --- > libavcodec/hevc.c | 10 +++ > libavcodec/hevc.h | 4 +++ > libavcodec/hevc_sei.c | 80 > +++ > 3 files changed, 94 insertions(+) applied do you have a sample that you can share ? thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] apng: use correct size for output buffer
On 07.11.2015 00:17, wm4 wrote: > On Fri, 6 Nov 2015 23:56:52 +0100 > Andreas Cadhalpun wrote: >> Attached is a patch increasing the buffer size to 10 and >> adding an assert that s->bpp is not larger. > > I'm find with this, though I'm not (A)PNG maintainer. On 07.11.2015 06:03, Paul B Mahol wrote: > Should be fine. Thanks, pushed. Best regards, Andreas ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] jvdec: avoid unsized overflow in comparison
On 07.11.2015 06:07, Paul B Mahol wrote: > On 11/6/15, Andreas Cadhalpun wrote: >> The return type of strlen is size_t, i.e. unsigned, so if pd->buf_size >> is 3, the right side overflows leading to a wrong result of the >> comparison and subsequently a heap buffer overflow. >> >> Signed-off-by: Andreas Cadhalpun >> --- >> libavformat/jvdec.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) > > lgtm Pushed... On 07.11.2015 06:19, Timothy Gu wrote: > On Fri, Nov 06, 2015 at 09:11:40PM +0100, Andreas Cadhalpun wrote: >> Subject: [FFmpeg-devel] [PATCH] jvdec: avoid unsized overflow in comparison > > *unsigned ...with the typo fixed. Best regards, Andreas ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCHv2] ffserver: fix incorrect strlcpy usage
Somewhat ironic that this "safe" interface is actually being used unsafely here. This fixes the usage preventing potential null pointer dereference, where the old code was doubly broken: ctime can return NULL, and ctime can return an arbitrarily long buffer. Signed-off-by: Ganesh Ajjanagadde --- ffserver.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ffserver.c b/ffserver.c index 526cbfc..c1746dc 100644 --- a/ffserver.c +++ b/ffserver.c @@ -305,15 +305,19 @@ static void ffm_set_write_index(AVFormatContext *s, int64_t pos, ffm->file_size = file_size; } -static char *ctime1(char *buf2, int buf_size) +static char *ctime1(char *buf2, size_t buf_size) { time_t ti; char *p; ti = time(NULL); p = ctime(&ti); +if (!p || !strcmp(p, "")) { +*buf2 = '\0'; +return buf2; +} av_strlcpy(buf2, p, buf_size); -p = buf2 + strlen(p) - 1; +p = buf2 + strlen(buf2) - 1; if (*p == '\n') *p = '\0'; return buf2; -- 2.6.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] web/download: point to the official Debian/Ubuntu packages
On 07.11.2015 03:39, Timothy Gu wrote: > On Fri, Nov 06, 2015 at 08:18:39PM +0100, Andreas Cadhalpun wrote: > [...] >> diff --git a/src/download b/src/download >> index 5691fbd..6d3517e 100644 >> --- a/src/download >> +++ b/src/download >> @@ -53,13 +53,22 @@ >> >> Linux Packages >> >> + > href="https://tracker.debian.org/pkg/ffmpeg";> >> +Debian ??? Official packages for >> Stable-Backports, Testing, Unstable >> +(amd64, arm64, armel, armhf, i386, kfreebsd-amd64, >> kfreebsd-i386, mips, mipsel, powerpc, ppc64el, s390x) > > What do you think of removing the architecture list? It's not very > helpful for most people reading this page, and feels out-of-place. That would be fine with me, but it should probably be a separate commit. Best regards, Andreas ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] swresample/options: change rematrix_maxval default to 1.0
On Fri, Nov 6, 2015 at 2:52 AM, Nicolas George wrote: > Le sextidi 16 brumaire, an CCXXIV, Michael Niedermayer a écrit : >> iam with whatever default people prefer > > IIRC, the current default yields different results when rematrixing from > float to float and then converting from float to int than when doing both in > a single step. I beliee this is not good. Patch dropped. Pushed just the typo fixes. Thanks. > > Regards, > > -- > Nicolas George > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] hevc: extract SEI caption data
On 11/7/15, 5:10 AM, "ffmpeg-devel on behalf of Michael Niedermayer" wrote: >On Fri, Nov 06, 2015 at 02:48:46PM -0600, Will Kelleher wrote: >> Signed-off-by: Will Kelleher >> --- >> libavcodec/hevc.c | 10 +++ >> libavcodec/hevc.h | 4 +++ >> libavcodec/hevc_sei.c | 80 >> +++ >> 3 files changed, 94 insertions(+) > >Applied Thanks! > >do you have a sample that you can share ? I do have a sample HEVC+AAC TS file. It’s about 7MB. Can I upload this to the FTP server? > >thanks > >[...] >-- >Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB > >Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avcodec/gifdec: skip data lzw consumed
fix the return code value of avcodec_decode_video2 for gif decoding, which should be the consumed data length. --- libavcodec/gifdec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c index 9f2e6eb..5bcb176 100644 --- a/libavcodec/gifdec.c +++ b/libavcodec/gifdec.c @@ -295,6 +295,8 @@ static int gif_read_image(GifState *s, AVFrame *frame) /* read the garbage data until end marker is found */ ff_lzw_decode_tail(s->lzw); +bytestream2_skipu(&s->gb, bytestream2_get_bytes_left(&s->gb)); + /* Graphic Control Extension's scope is single frame. * Remove its influence. */ s->transparent_color_index = -1; -- 2.4.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] qsvenc: write a53 caption data to SEI
--- libavcodec/qsvenc.c | 114 +-- libavcodec/qsvenc.h | 2 +- libavcodec/qsvenc_h264.c | 2 +- 3 files changed, 113 insertions(+), 5 deletions(-) diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index df1f777..0ee45f9 100644 --- a/libavcodec/qsvenc.c +++ b/libavcodec/qsvenc.c @@ -30,6 +30,7 @@ #include "libavutil/log.h" #include "libavutil/time.h" #include "libavutil/imgutils.h" +#include "libavcodec/bytestream.h" #include "avcodec.h" #include "internal.h" @@ -276,7 +277,7 @@ int ff_qsv_enc_init(AVCodecContext *avctx, QSVEncContext *q) q->param.AsyncDepth = q->async_depth; q->async_fifo = av_fifo_alloc((1 + q->async_depth) * - (sizeof(AVPacket) + sizeof(mfxSyncPoint) + sizeof(mfxBitstream*))); + (sizeof(AVPacket) + sizeof(mfxSyncPoint) + sizeof(mfxBitstream*) + sizeof(mfxEncodeCtrl*))); if (!q->async_fifo) return AVERROR(ENOMEM); @@ -494,6 +495,27 @@ static void print_interlace_msg(AVCodecContext *avctx, QSVEncContext *q) } } +static void freep_encoder_ctrl(mfxEncodeCtrl** enc_ptr) +{ +mfxEncodeCtrl* enc_ctrl; + +if (!enc_ptr) +return; + +enc_ctrl = *enc_ptr; + +if (enc_ctrl) { +int i; +for (i = 0; i < enc_ctrl->NumPayload; i++) { +av_free(enc_ctrl->Payload[i]->Data); +av_freep(&enc_ctrl->Payload[i]); +} +av_free(enc_ctrl->Payload); +av_freep(&enc_ctrl); +} +*enc_ptr = NULL; +} + int ff_qsv_encode(AVCodecContext *avctx, QSVEncContext *q, AVPacket *pkt, const AVFrame *frame, int *got_packet) { @@ -504,6 +526,10 @@ int ff_qsv_encode(AVCodecContext *avctx, QSVEncContext *q, mfxSyncPoint sync = NULL; int ret; +// for A53 CC data +mfxEncodeCtrl* enc_ctrl = NULL; +AVFrameSideData *side_data = NULL; + if (frame) { ret = submit_frame(q, frame, &surf); if (ret < 0) { @@ -526,8 +552,83 @@ int ff_qsv_encode(AVCodecContext *avctx, QSVEncContext *q, bs->Data = new_pkt.data; bs->MaxLength = new_pkt.size; +if (q->a53_cc && frame) { +side_data = av_frame_get_side_data(frame, AV_FRAME_DATA_A53_CC); +if (side_data) { + +int sei_payload_size = 0; +mfxU8* sei_data = NULL; +mfxPayload* payload = NULL; +mfxPayload** payloads = NULL; + +sei_payload_size = side_data->size + 13; + +sei_data = av_mallocz(sei_payload_size); +if (!sei_data) { +av_log(avctx, AV_LOG_ERROR, "No memory for CC, skipping...\n"); +goto skip_a53cc; +} + +// SEI header +sei_data[0] = 4; +sei_data[1] = sei_payload_size - 2; // size of SEI data + +// country code +sei_data[2] = 181; +sei_data[3] = 0; +sei_data[4] = 49; + +// ATSC_identifier - using 'GA94' only +AV_WL32(sei_data + 5, +MKTAG('G', 'A', '9', '4')); +sei_data[9] = 3; +sei_data[10] = +((side_data->size/3) & 0x1f) | 0xC0; + +sei_data[11] = 0xFF; // reserved + +memcpy(sei_data + 12, side_data->data, side_data->size); + +sei_data[side_data->size+12] = 255; + +payload = av_mallocz(sizeof(mfxPayload)); +if (!payload) { +av_log(avctx, AV_LOG_ERROR, "No memory, skipping captions\n"); +av_freep(&sei_data); +goto skip_a53cc; +} +payload->BufSize = side_data->size + 13; +payload->NumBit = payload->BufSize * 8; +payload->Type = 4; +payload->Data = sei_data; + +payloads = av_mallocz(sizeof(mfxPayload*)); +if (!payloads) { +av_log(avctx, AV_LOG_ERROR, "No memory, skipping captions\n"); +av_freep(&sei_data); +av_freep(&payload); +goto skip_a53cc; +} + +payloads[0] = payload; + +enc_ctrl = av_mallocz(sizeof(mfxEncodeCtrl)); +if (!enc_ctrl) +{ +av_log(avctx, AV_LOG_VERBOSE, "No memory for mfxEncodeCtrl\n"); +av_freep(&sei_data); +av_freep(&payload); +av_freep(&payloads); +goto skip_a53cc; +} +enc_ctrl->NumExtParam = 0; +enc_ctrl->NumPayload = 0; +enc_ctrl->Payload = payloads; + } +} +skip_a53cc: do { -ret = MFXVideoENCODE_EncodeFrameAsync(q->session, NULL, surf, bs, &sync); +ret = MFXVideoENCODE_EncodeFrameAsync(q->session, enc_ctrl, surf, bs, &sync); if (ret == MFX_WRN_DEVICE_BUSY) { av_usleep(500); continue; @@ -554,10 +655,12 @@ int ff_qsv_encode(
Re: [FFmpeg-devel] [PATCH] avcodec/gifdec: skip data lzw consumed
On 11/7/15, Ni Hui wrote: > fix the return code value of avcodec_decode_video2 for gif decoding, which > should be the consumed data length. > > --- > libavcodec/gifdec.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c > index 9f2e6eb..5bcb176 100644 > --- a/libavcodec/gifdec.c > +++ b/libavcodec/gifdec.c > @@ -295,6 +295,8 @@ static int gif_read_image(GifState *s, AVFrame *frame) > /* read the garbage data until end marker is found */ > ff_lzw_decode_tail(s->lzw); > > +bytestream2_skipu(&s->gb, bytestream2_get_bytes_left(&s->gb)); > + > /* Graphic Control Extension's scope is single frame. > * Remove its influence. */ > s->transparent_color_index = -1; > -- > 2.4.1 > > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > Are there files this actually fixes? ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCHv4] avfilter: add anoisesrc
On 11/6/15, Kyle Swanson wrote: > Signed-off-by: Kyle Swanson > --- > Changelog| 1 + > doc/filters.texi | 36 > libavfilter/Makefile | 1 + > libavfilter/allfilters.c | 1 + > libavfilter/asrc_anoisesrc.c | 207 > +++ > libavfilter/version.h| 4 +- > 6 files changed, 248 insertions(+), 2 deletions(-) > create mode 100644 libavfilter/asrc_anoisesrc.c > looks fine, will apply if none object in next 48h. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/2] lavfi: add testsrc2 test source.
Le sextidi 16 brumaire, an CCXXIV, Paul B Mahol a écrit : > Should be fine. Pushed like that. Thanks for all the remarks. Regards, -- Nicolas George signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] fate: add mpdecimate test.
Le sextidi 6 brumaire, an CCXXIV, Michael Niedermayer a écrit : > tested on linux32, 64, mingw32, 64 and mips > works fine, LGTM Pushed, thanks. Regards, -- Nicolas George signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavfi: add realtime filter.
Le quartidi 4 brumaire, an CCXXIV, Nicolas George a écrit : > Similar to the -re option in ffmpeg that only works for input files. > Can be used at any place in the filter graph. > > Signed-off-by: Nicolas George > --- > Changelog| 1 + > doc/filters.texi | 16 ++ > libavfilter/Makefile | 2 + > libavfilter/allfilters.c | 2 + > libavfilter/f_realtime.c | 130 > +++ > 5 files changed, 151 insertions(+) > create mode 100644 libavfilter/f_realtime.c Pushed. Regards, -- Nicolas George signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavu/opt: enhance printing durations.
Le quintidi 5 brumaire, an CCXXIV, Nicolas George a écrit : > Trim unneeded leading components and trailing zeros. > Move the formating code in a separate function. > Use the function also to format the default value, it was currently > printed as plain integer, inconsistent to the way it is parsed. > > Signed-off-by: Nicolas George > --- > libavutil/opt.c| 48 +++- > tests/ref/fate/opt | 8 > 2 files changed, 47 insertions(+), 9 deletions(-) Pushed. Regards, -- Nicolas George signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] swresample: allow double precision beta value for the Kaiser window
Kaiser windows inherently don't require beta to be an integer. This was an arbitrary restriction. Moreover, soxr does not require it, and in fact often estimates beta to a non-integral value. Thus, this patch allows greater flexibility for swresample clients. Signed-off-by: Ganesh Ajjanagadde --- doc/resampler.texi | 2 +- libswresample/options.c | 2 +- libswresample/resample.c| 4 ++-- libswresample/resample.h| 2 +- libswresample/soxr_resample.c | 2 +- libswresample/swresample_internal.h | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/resampler.texi b/doc/resampler.texi index 155230f..cb7d536 100644 --- a/doc/resampler.texi +++ b/doc/resampler.texi @@ -220,7 +220,7 @@ select Kaiser windowed sinc @end table @item kaiser_beta -For swr only, set Kaiser window beta value. Must be an integer in the +For swr only, set Kaiser window beta value. Must be a double float value in the interval [2,16], default value is 9. @item output_sample_bits diff --git a/libswresample/options.c b/libswresample/options.c index 2bf8ab1..654102a 100644 --- a/libswresample/options.c +++ b/libswresample/options.c @@ -120,7 +120,7 @@ static const AVOption options[]={ { "blackman_nuttall", "select Blackman Nuttall windowed sinc", 0 , AV_OPT_TYPE_CONST, { .i64 = SWR_FILTER_TYPE_BLACKMAN_NUTTALL }, INT_MIN, INT_MAX, PARAM, "filter_type" }, { "kaiser" , "select Kaiser windowed sinc" , 0 , AV_OPT_TYPE_CONST, { .i64 = SWR_FILTER_TYPE_KAISER }, INT_MIN, INT_MAX, PARAM, "filter_type" }, -{ "kaiser_beta" , "set swr Kaiser window beta" , OFFSET(kaiser_beta) , AV_OPT_TYPE_INT , {.i64=9 }, 2 , 16, PARAM }, +{ "kaiser_beta" , "set swr Kaiser window beta" , OFFSET(kaiser_beta) , AV_OPT_TYPE_DOUBLE , {.dbl=9 }, 2 , 16, PARAM }, { "output_sample_bits" , "set swr number of output sample bits", OFFSET(dither.output_sample_bits), AV_OPT_TYPE_INT , {.i64=0 }, 0 , 64 , PARAM }, {0} diff --git a/libswresample/resample.c b/libswresample/resample.c index 1a0c369..9f5e10e 100644 --- a/libswresample/resample.c +++ b/libswresample/resample.c @@ -142,7 +142,7 @@ static double bessel(double x) { * @return 0 on success, negative on error */ static int build_filter(ResampleContext *c, void *filter, double factor, int tap_count, int alloc, int phase_count, int scale, -int filter_type, int kaiser_beta){ +int filter_type, double kaiser_beta){ int ph, i; double x, y, w, t; double *tab = av_malloc_array(tap_count+1, sizeof(*tab)); @@ -283,7 +283,7 @@ static int build_filter(ResampleContext *c, void *filter, double factor, int tap } static ResampleContext *resample_init(ResampleContext *c, int out_rate, int in_rate, int filter_size, int phase_shift, int linear, -double cutoff0, enum AVSampleFormat format, enum SwrFilterType filter_type, int kaiser_beta, +double cutoff0, enum AVSampleFormat format, enum SwrFilterType filter_type, double kaiser_beta, double precision, int cheby) { double cutoff = cutoff0? cutoff0 : 0.97; diff --git a/libswresample/resample.h b/libswresample/resample.h index 99a89b7..a126b11 100644 --- a/libswresample/resample.h +++ b/libswresample/resample.h @@ -44,7 +44,7 @@ typedef struct ResampleContext { int phase_mask; int linear; enum SwrFilterType filter_type; -int kaiser_beta; +double kaiser_beta; double factor; enum AVSampleFormat format; int felem_size; diff --git a/libswresample/soxr_resample.c b/libswresample/soxr_resample.c index 535e9ce..807f508 100644 --- a/libswresample/soxr_resample.c +++ b/libswresample/soxr_resample.c @@ -30,7 +30,7 @@ #include static struct ResampleContext *create(struct ResampleContext *c, int out_rate, int in_rate, int filter_size, int phase_shift, int linear, -double cutoff, enum AVSampleFormat format, enum SwrFilterType filter_type, int kaiser_beta, double precision, int cheby){ +double cutoff, enum AVSampleFormat format, enum SwrFilterType filter_type, double kaiser_beta, double precision, int cheby){ soxr_error_t error; soxr_datatype_t type = diff --git a/libswresample/swresample_internal.h b/libswresample/swresample_internal.h index bf0cec7..5c46dda 100644 --- a/libswresample/swresample_internal.h +++ b/libswresample/swresample_internal.h @@ -69,7 +69,7 @@ struct DitherContext { }; typedef struct ResampleContext * (* resample_init_func)(struct ResampleContext *c, int out_rate, int in_rate, int filter_size, int phase_shift, int linear, -double cutoff, enum AVSampleFormat format, enum SwrFilterType filter_type, int kaiser_beta,
Re: [FFmpeg-devel] [PATCH] avcodec/gifdec: skip data lzw consumed
avcodec_decode_video2 should return the number of bytes used if frame decompressed correctly the current gif decoder just returns the number of bytes of header part of one frame, not including the lzw compressed image data bytes, which should be included too as one avpacket may contain multiple picture frame the following usecase will fail on the second call of decode function (nused is smaller than expected for gif animation) // pkt is a valid AVPacket from av_read_frame loop while (pkt.size > 0) { int nused = avcodec_decode_video2( . ); if (nused < 0) { // deocde error } .. // process here .. pkt.data += nused; pkt.size -= nused; } best wishes nihui At 2015-11-07 22:35:06, "Paul B Mahol" wrote: >On 11/7/15, Ni Hui wrote: >> fix the return code value of avcodec_decode_video2 for gif decoding, which >> should be the consumed data length. >> >> --- >> libavcodec/gifdec.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c >> index 9f2e6eb..5bcb176 100644 >> --- a/libavcodec/gifdec.c >> +++ b/libavcodec/gifdec.c >> @@ -295,6 +295,8 @@ static int gif_read_image(GifState *s, AVFrame *frame) >> /* read the garbage data until end marker is found */ >> ff_lzw_decode_tail(s->lzw); >> >> +bytestream2_skipu(&s->gb, bytestream2_get_bytes_left(&s->gb)); >> + >> /* Graphic Control Extension's scope is single frame. >> * Remove its influence. */ >> s->transparent_color_index = -1; >> -- >> 2.4.1 >> >> >> ___ >> ffmpeg-devel mailing list >> ffmpeg-devel@ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel >> > >Are there files this actually fixes? ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/2] mmaldec: add vc1 decoding support
On Fri, 6 Nov 2015 22:21:55 -0300 James Almer wrote: > On 11/6/2015 12:15 PM, wm4 wrote: > > --- > > configure | 3 +++ > > libavcodec/Makefile| 1 + > > libavcodec/allcodecs.c | 2 ++ > > libavcodec/mmaldec.c | 12 > > 4 files changed, 18 insertions(+) > > > > diff --git a/configure b/configure > > index f770534..8c940a7 100755 > > --- a/configure > > +++ b/configure > > @@ -2516,6 +2516,9 @@ vc1_vdpau_decoder_deps="vdpau" > > vc1_vdpau_decoder_select="vc1_decoder" > > vc1_vdpau_hwaccel_deps="vdpau" > > vc1_vdpau_hwaccel_select="vc1_decoder" > > +vc1_mmal_decoder_deps="mmal" > > +vc1_mmal_hwaccel_deps="mmal" > > +vc1_mmal_decoder_select="vc1video_decoder" > > vc1_mmal_decoder_select="vc1_decoder" Fixed locally. Anything else, or can I push? > Also, judging by every other hwaccel, shouldn't you also add a > vc1_mmal_hwaccel_select="vc1_decoder" line? The h264 and mpeg2 mmal ones do not do this either. It probably doesn't make sense to make them selectable, because the hwaccels exist only to make utils.c ff_get_format happy. Selection at build time can be done through the decoder configure options. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/2] mmaldec: add vc1 decoding support
On 11/7/2015 1:17 PM, wm4 wrote: > On Fri, 6 Nov 2015 22:21:55 -0300 > James Almer wrote: > >> On 11/6/2015 12:15 PM, wm4 wrote: >>> --- >>> configure | 3 +++ >>> libavcodec/Makefile| 1 + >>> libavcodec/allcodecs.c | 2 ++ >>> libavcodec/mmaldec.c | 12 >>> 4 files changed, 18 insertions(+) >>> >>> diff --git a/configure b/configure >>> index f770534..8c940a7 100755 >>> --- a/configure >>> +++ b/configure >>> @@ -2516,6 +2516,9 @@ vc1_vdpau_decoder_deps="vdpau" >>> vc1_vdpau_decoder_select="vc1_decoder" >>> vc1_vdpau_hwaccel_deps="vdpau" >>> vc1_vdpau_hwaccel_select="vc1_decoder" >>> +vc1_mmal_decoder_deps="mmal" >>> +vc1_mmal_hwaccel_deps="mmal" >>> +vc1_mmal_decoder_select="vc1video_decoder" >> >> vc1_mmal_decoder_select="vc1_decoder" > > Fixed locally. Anything else, or can I push? > I can't test it, so if you say it works then go ahead. >> Also, judging by every other hwaccel, shouldn't you also add a >> vc1_mmal_hwaccel_select="vc1_decoder" line? > > The h264 and mpeg2 mmal ones do not do this either. It probably doesn't > make sense to make them selectable, because the hwaccels exist only to > make utils.c ff_get_format happy. Selection at build time can be done > through the decoder configure options. > ___ > 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] avformat/wavdec: parse XMA2 tag
Signed-off-by: Paul B Mahol --- libavformat/wavdec.c | 56 ++-- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c index ef24e16..621d21f 100644 --- a/libavformat/wavdec.c +++ b/libavformat/wavdec.c @@ -146,6 +146,49 @@ static int wav_parse_fmt_tag(AVFormatContext *s, int64_t size, AVStream **st) return 0; } +static int wav_parse_xma2_tag(AVFormatContext *s, int64_t size, AVStream **st) +{ +AVIOContext *pb = s->pb; +int num_streams, i, channels = 0; + +if (size < 44) +return AVERROR_INVALIDDATA; + +*st = avformat_new_stream(s, NULL); +if (!*st) +return AVERROR(ENOMEM); + +(*st)->codec->codec_type = AVMEDIA_TYPE_AUDIO; +(*st)->codec->codec_id = AV_CODEC_ID_XMA2; +(*st)->need_parsing = AVSTREAM_PARSE_FULL_RAW; + +avio_skip(pb, 1); +num_streams = avio_r8(pb); +if (size < 40 + num_streams * 4) +return AVERROR_INVALIDDATA; +avio_skip(pb, 10); +(*st)->codec->sample_rate = avio_rb32(pb); +avio_skip(pb, 12); +(*st)->duration = avio_rb32(pb); +avio_skip(pb, 8); + +for (i = 0; i < num_streams; i++) { +channels += avio_r8(pb); +avio_skip(pb, 3); +} +(*st)->codec->channels = channels; + +if ((*st)->codec->channels <= 0 || (*st)->codec->sample_rate <= 0) +return AVERROR_INVALIDDATA; + +avpriv_set_pts_info(*st, 64, 1, (*st)->codec->sample_rate); +if (ff_alloc_extradata((*st)->codec, 34)) +return AVERROR(ENOMEM); +memset((*st)->codec->extradata, 0, 34); + +return 0; +} + static inline int wav_parse_bext_string(AVFormatContext *s, const char *key, int length) { @@ -254,7 +297,7 @@ static int wav_read_header(AVFormatContext *s) AVIOContext *pb = s->pb; AVStream *st = NULL; WAVDemuxContext *wav = s->priv_data; -int ret, got_fmt = 0; +int ret, got_fmt = 0, got_xma2 = 0; int64_t next_tag_ofs, data_ofs = -1; wav->unaligned = avio_tell(s->pb) & 1; @@ -326,8 +369,17 @@ static int wav_read_header(AVFormatContext *s) got_fmt = 1; break; +case MKTAG('X', 'M', 'A', '2'): +/* only parse the first 'XMA2' tag found */ +if (!got_xma2 && (ret = wav_parse_xma2_tag(s, size, &st)) < 0) { +return ret; +} else if (got_xma2) +av_log(s, AV_LOG_WARNING, "found more than one 'XMA2' tag\n"); + +got_xma2 = 1; +break; case MKTAG('d', 'a', 't', 'a'): -if (!got_fmt) { +if (!got_fmt && !got_xma2) { av_log(s, AV_LOG_ERROR, "found no 'fmt ' tag before the 'data' tag\n"); return AVERROR_INVALIDDATA; -- 1.9.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] swresample: allow double precision beta value for the Kaiser window
On 11/7/15, Ganesh Ajjanagadde wrote: > Kaiser windows inherently don't require beta to be an integer. This was > an arbitrary restriction. Moreover, soxr does not require it, and in > fact often estimates beta to a non-integral value. > > Thus, this patch allows greater flexibility for swresample clients. > > Signed-off-by: Ganesh Ajjanagadde > --- > doc/resampler.texi | 2 +- > libswresample/options.c | 2 +- > libswresample/resample.c| 4 ++-- > libswresample/resample.h| 2 +- > libswresample/soxr_resample.c | 2 +- > libswresample/swresample_internal.h | 4 ++-- > 6 files changed, 8 insertions(+), 8 deletions(-) > > diff --git a/doc/resampler.texi b/doc/resampler.texi > index 155230f..cb7d536 100644 > --- a/doc/resampler.texi > +++ b/doc/resampler.texi > @@ -220,7 +220,7 @@ select Kaiser windowed sinc > @end table > > @item kaiser_beta > -For swr only, set Kaiser window beta value. Must be an integer in the > +For swr only, set Kaiser window beta value. Must be a double float value in > the > interval [2,16], default value is 9. > > @item output_sample_bits > diff --git a/libswresample/options.c b/libswresample/options.c > index 2bf8ab1..654102a 100644 > --- a/libswresample/options.c > +++ b/libswresample/options.c > @@ -120,7 +120,7 @@ static const AVOption options[]={ > { "blackman_nuttall", "select Blackman Nuttall windowed sinc", 0 > , AV_OPT_TYPE_CONST, { .i64 = SWR_FILTER_TYPE_BLACKMAN_NUTTALL }, > INT_MIN, INT_MAX, PARAM, "filter_type" }, > { "kaiser" , "select Kaiser windowed sinc" , 0 > , AV_OPT_TYPE_CONST, { .i64 = SWR_FILTER_TYPE_KAISER }, > INT_MIN, INT_MAX, PARAM, "filter_type" }, > > -{ "kaiser_beta" , "set swr Kaiser window beta" , > OFFSET(kaiser_beta), AV_OPT_TYPE_INT , {.i64=9 }, 2 > , 16, PARAM }, > +{ "kaiser_beta" , "set swr Kaiser window beta" , > OFFSET(kaiser_beta), AV_OPT_TYPE_DOUBLE , {.dbl=9 > }, 2 , 16, PARAM }, > > { "output_sample_bits" , "set swr number of output sample bits", > OFFSET(dither.output_sample_bits), AV_OPT_TYPE_INT , {.i64=0 }, 0 , > 64, PARAM }, > {0} > diff --git a/libswresample/resample.c b/libswresample/resample.c > index 1a0c369..9f5e10e 100644 > --- a/libswresample/resample.c > +++ b/libswresample/resample.c > @@ -142,7 +142,7 @@ static double bessel(double x) { > * @return 0 on success, negative on error > */ > static int build_filter(ResampleContext *c, void *filter, double factor, > int tap_count, int alloc, int phase_count, int scale, > -int filter_type, int kaiser_beta){ > +int filter_type, double kaiser_beta){ > int ph, i; > double x, y, w, t; > double *tab = av_malloc_array(tap_count+1, sizeof(*tab)); > @@ -283,7 +283,7 @@ static int build_filter(ResampleContext *c, void > *filter, double factor, int tap > } > > static ResampleContext *resample_init(ResampleContext *c, int out_rate, int > in_rate, int filter_size, int phase_shift, int linear, > -double cutoff0, enum AVSampleFormat > format, enum SwrFilterType filter_type, int kaiser_beta, > +double cutoff0, enum AVSampleFormat > format, enum SwrFilterType filter_type, double kaiser_beta, > double precision, int cheby) > { > double cutoff = cutoff0? cutoff0 : 0.97; > diff --git a/libswresample/resample.h b/libswresample/resample.h > index 99a89b7..a126b11 100644 > --- a/libswresample/resample.h > +++ b/libswresample/resample.h > @@ -44,7 +44,7 @@ typedef struct ResampleContext { > int phase_mask; > int linear; > enum SwrFilterType filter_type; > -int kaiser_beta; > +double kaiser_beta; > double factor; > enum AVSampleFormat format; > int felem_size; > diff --git a/libswresample/soxr_resample.c b/libswresample/soxr_resample.c > index 535e9ce..807f508 100644 > --- a/libswresample/soxr_resample.c > +++ b/libswresample/soxr_resample.c > @@ -30,7 +30,7 @@ > #include > > static struct ResampleContext *create(struct ResampleContext *c, int > out_rate, int in_rate, int filter_size, int phase_shift, int linear, > -double cutoff, enum AVSampleFormat format, enum SwrFilterType > filter_type, int kaiser_beta, double precision, int cheby){ > +double cutoff, enum AVSampleFormat format, enum SwrFilterType > filter_type, double kaiser_beta, double precision, int cheby){ > soxr_error_t error; > > soxr_datatype_t type = > diff --git a/libswresample/swresample_internal.h > b/libswresample/swresample_internal.h > index bf0cec7..5c46dda 100644 > --- a/libswresample/swresample_internal.h > +++ b/libswresample/swresample_internal.h > @@ -69,7 +69,7 @@ struct DitherContext { > }; > > typedef struct ResampleContext * (* resample_init_func)(struct > ResampleContext *c, int out_
Re: [FFmpeg-devel] [PATCH] hevc: extract SEI caption data
On Sat, Nov 07, 2015 at 02:17:12PM +, Will Kelleher wrote: > On 11/7/15, 5:10 AM, "ffmpeg-devel on behalf of Michael Niedermayer" > wrote: > > > > >On Fri, Nov 06, 2015 at 02:48:46PM -0600, Will Kelleher wrote: > >> Signed-off-by: Will Kelleher > >> --- > >> libavcodec/hevc.c | 10 +++ > >> libavcodec/hevc.h | 4 +++ > >> libavcodec/hevc_sei.c | 80 > >> +++ > >> 3 files changed, 94 insertions(+) > > > >Applied > > Thanks! > > > > >do you have a sample that you can share ? > > I do have a sample HEVC+AAC TS file. It’s about 7MB. Can I upload this to > the FTP server? yes, please also tell us the filename afer uploading thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Opposition brings concord. Out of discord comes the fairest harmony. -- Heraclitus signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] qsvenc: write a53 caption data to SEI
Hello Will, Saturday, November 7, 2015, 5:29:15 PM, you wrote: WK> --- WK> libavcodec/qsvenc.c | 114 WK> +-- WK> libavcodec/qsvenc.h | 2 +- WK> libavcodec/qsvenc_h264.c | 2 +- WK> 3 files changed, 113 insertions(+), 5 deletions(-) WK> diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c WK> index df1f777..0ee45f9 100644 WK> --- a/libavcodec/qsvenc.c WK> +++ b/libavcodec/qsvenc.c WK> @@ -30,6 +30,7 @@ WK> #include "libavutil/log.h" WK> #include "libavutil/time.h" WK> #include "libavutil/imgutils.h" WK> +#include "libavcodec/bytestream.h" WK> WK> #include "avcodec.h" WK> #include "internal.h" WK> @@ -276,7 +277,7 @@ int ff_qsv_enc_init(AVCodecContext *avctx, QSVEncContext *q) WK> q->param.AsyncDepth = q->async_depth; WK> WK> q->async_fifo = av_fifo_alloc((1 + q->async_depth) * WK> - (sizeof(AVPacket) + WK> sizeof(mfxSyncPoint) + sizeof(mfxBitstream*))); WK> + (sizeof(AVPacket) + WK> sizeof(mfxSyncPoint) + sizeof(mfxBitstream*) + sizeof(mfxEncodeCtrl*))); WK> if (!q->async_fifo) WK> return AVERROR(ENOMEM); WK> WK> @@ -494,6 +495,27 @@ static void print_interlace_msg(AVCodecContext *avctx, QSVEncContext *q) WK> } WK> } WK> WK> +static void freep_encoder_ctrl(mfxEncodeCtrl** enc_ptr) WK> +{ WK> +mfxEncodeCtrl* enc_ctrl; WK> + WK> +if (!enc_ptr) WK> +return; WK> + WK> +enc_ctrl = *enc_ptr; WK> + WK> +if (enc_ctrl) { WK> +int i; WK> +for (i = 0; i < enc_ctrl->NumPayload; i++) { WK> +av_free(enc_ctrl->Payload[i]->Data); WK> +av_freep(&enc_ctrl->Payload[i]); WK> +} WK> +av_free(enc_ctrl->Payload); WK> +av_freep(&enc_ctrl); WK> +} WK> +*enc_ptr = NULL; WK> +} WK> + WK> int ff_qsv_encode(AVCodecContext *avctx, QSVEncContext *q, WK>AVPacket *pkt, const AVFrame *frame, int *got_packet) WK> { WK> @@ -504,6 +526,10 @@ int ff_qsv_encode(AVCodecContext *avctx, QSVEncContext *q, WK> mfxSyncPoint sync = NULL; WK> int ret; WK> WK> +// for A53 CC data WK> +mfxEncodeCtrl* enc_ctrl = NULL; WK> +AVFrameSideData *side_data = NULL; WK> + WK> if (frame) { WK> ret = submit_frame(q, frame, &surf); WK> if (ret < 0) { WK> @@ -526,8 +552,83 @@ int ff_qsv_encode(AVCodecContext *avctx, QSVEncContext *q, WK> bs->Data = new_pkt.data; WK> bs->MaxLength = new_pkt.size; WK> +if (q->>a53_cc && frame) { WK> +side_data = av_frame_get_side_data(frame, AV_FRAME_DATA_A53_CC); WK> +if (side_data) { Although the code looks ok by itself, I believe it is bad idea to place H.264-specific codeto the function which is commonfor all encoders. I believe H.264-specific user data insertion should locates into the qsvenc_h264.c I.e. there is necessary some kind of 'SetEncodeCtrl' callback which points to function into the encoder-specific module. I believe if you will define a callback pointer QSVEncContext::SetEncodeCtrlCB, setup it into qsv_enc_init() of the qsvenc_h264.c and call if it non-zero from ff_qsv_encode() we will have good base to extend add user data for MPEG2 later. Else we will get very bulky and ugly ff_qsv_encode(). I can release something but I hope you will able to catch my idea. Please let me know if something is unclear. -- Best regards, Ivanmailto:ivan.us...@nablet.com ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] swresample/options: change rematrix_maxval default to 1.0
On Fri, Nov 06, 2015 at 01:48:59PM +0100, wm4 wrote: > On Fri, 6 Nov 2015 12:58:23 +0100 > Michael Niedermayer wrote: > > > On Fri, Nov 06, 2015 at 11:16:49AM +0100, wm4 wrote: > > > On Fri, 6 Nov 2015 10:54:28 +0100 > > > Michael Niedermayer wrote: > > > > > > > On Fri, Nov 06, 2015 at 08:52:32AM +0100, Nicolas George wrote: > > > > > Le sextidi 16 brumaire, an CCXXIV, Michael Niedermayer a écrit : > > > > > > iam with whatever default people prefer > > > > > > > > > > IIRC, the current default yields different results when rematrixing > > > > > from > > > > > float to float and then converting from float to int than when doing > > > > > both in > > > > > a single step. > > > > > > > > yes, OTOH float -> float rematrix + "inverse" float->float should be > > > > closer to the original than with the changed default > > > > The difference between the defaults is in volume of the output > > > > > > > > > > > > > I beliee this is not good. > > > > > > > > no its not good, though the alternative isnt really good either. > > > > All choices have some kind of disadvantage. There also would be the > > > > possibility of implementing 2 pass mode to maintain the volume as much > > > > as possible without cliping (but that could not easily be default) > > > > For the default, the question is what people prefer ... > > > > > > Do you mean some kind of DRC? > > > > no but that would be another possibility as well > > Then I don't know what you meant by this 2 pass mode. Can you explain? > I'm interested in obtaining better downmix. i just meant a 2pass mode that would linearly scale the output so volume is maintained between input and output as good as possible without cliping (that is apply the same scaling factor to all channels and all points in time) dynamic range compression would apply some non linear scaling and thus strictly speaking add distortion / vary the volume compensation over time, amplitude or frequency. drc is better if maintaining absolute volume is more important than relative volume [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB DNS cache poisoning attacks, popular search engine, Google internet authority dont be evil, please signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/7] lavfi: remove astreamsync.
Series pushed. Regards, -- Nicolas George signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] swresample/options: change rematrix_maxval default to 1.0
On Sat, 7 Nov 2015 18:33:07 +0100 Michael Niedermayer wrote: > On Fri, Nov 06, 2015 at 01:48:59PM +0100, wm4 wrote: > > On Fri, 6 Nov 2015 12:58:23 +0100 > > Michael Niedermayer wrote: > > > > > On Fri, Nov 06, 2015 at 11:16:49AM +0100, wm4 wrote: > > > > On Fri, 6 Nov 2015 10:54:28 +0100 > > > > Michael Niedermayer wrote: > > > > > > > > > On Fri, Nov 06, 2015 at 08:52:32AM +0100, Nicolas George wrote: > > > > > > Le sextidi 16 brumaire, an CCXXIV, Michael Niedermayer a écrit : > > > > > > > > > > > > > iam with whatever default people prefer > > > > > > > > > > > > IIRC, the current default yields different results when rematrixing > > > > > > from > > > > > > float to float and then converting from float to int than when > > > > > > doing both in > > > > > > a single step. > > > > > > > > > > yes, OTOH float -> float rematrix + "inverse" float->float should be > > > > > closer to the original than with the changed default > > > > > The difference between the defaults is in volume of the output > > > > > > > > > > > > > > > > I beliee this is not good. > > > > > > > > > > no its not good, though the alternative isnt really good either. > > > > > All choices have some kind of disadvantage. There also would be the > > > > > possibility of implementing 2 pass mode to maintain the volume as much > > > > > as possible without cliping (but that could not easily be default) > > > > > For the default, the question is what people prefer ... > > > > > > > > Do you mean some kind of DRC? > > > > > > no but that would be another possibility as well > > > > Then I don't know what you meant by this 2 pass mode. Can you explain? > > I'm interested in obtaining better downmix. > > i just meant a 2pass mode that would linearly scale the output so > volume is maintained between input and output as good as possible > without cliping (that is apply the same scaling factor to all channels > and all points in time) I still don't understand. Isn't this done already? ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/2] mmaldec: add vc1 decoding support
On Sat, 7 Nov 2015 13:22:48 -0300 James Almer wrote: > On 11/7/2015 1:17 PM, wm4 wrote: > > On Fri, 6 Nov 2015 22:21:55 -0300 > > James Almer wrote: > > > >> On 11/6/2015 12:15 PM, wm4 wrote: > >>> --- > >>> configure | 3 +++ > >>> libavcodec/Makefile| 1 + > >>> libavcodec/allcodecs.c | 2 ++ > >>> libavcodec/mmaldec.c | 12 > >>> 4 files changed, 18 insertions(+) > >>> > >>> diff --git a/configure b/configure > >>> index f770534..8c940a7 100755 > >>> --- a/configure > >>> +++ b/configure > >>> @@ -2516,6 +2516,9 @@ vc1_vdpau_decoder_deps="vdpau" > >>> vc1_vdpau_decoder_select="vc1_decoder" > >>> vc1_vdpau_hwaccel_deps="vdpau" > >>> vc1_vdpau_hwaccel_select="vc1_decoder" > >>> +vc1_mmal_decoder_deps="mmal" > >>> +vc1_mmal_hwaccel_deps="mmal" > >>> +vc1_mmal_decoder_select="vc1video_decoder" > >> > >> vc1_mmal_decoder_select="vc1_decoder" > > > > Fixed locally. Anything else, or can I push? > > > > I can't test it, so if you say it works then go ahead. Maybe the decoder_select shouldn't actually be there in the first place (I really don't get how this holds together), but it does work. Pushed both patches, thanks for the review. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] swresample: allow double precision beta value for the Kaiser window
On 11/7/2015 4:47 PM, Paul B Mahol wrote: > I'm afraid that this can't be done this way. Perhaps providing more detail than HAL 9000 could help Ganesh here. - Derek ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] swresample: allow double precision beta value for the Kaiser window
On 11/7/15, Derek Buitenhuis wrote: > On 11/7/2015 4:47 PM, Paul B Mahol wrote: >> I'm afraid that this can't be done this way. > > Perhaps providing more detail than HAL 9000 could > help Ganesh here. AFAIK changing option from int to double will break programs which assume opttions is int. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] swresample: allow double precision beta value for the Kaiser window
On 11/7/2015 7:35 PM, Paul B Mahol wrote: > AFAIK changing option from int to double will break programs which > assume opttions is int. Not really sure how it could. The original range allowed was [2,16], and using any of the av_opt_set functions should still work with that, no? - Derek ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] swresample: allow double precision beta value for the Kaiser window
On Sat, 7 Nov 2015 20:00:50 + Derek Buitenhuis wrote: > On 11/7/2015 7:35 PM, Paul B Mahol wrote: > > AFAIK changing option from int to double will break programs which > > assume opttions is int. > > Not really sure how it could. The original range allowed was [2,16], > and using any of the av_opt_set functions should still work with that, > no? A program could use av_opt_find() and then compute the pointer to the option and set it manually. Is this valid API usage? Well, can you really tell? Or anyone? I've certainly seen at least one program do this with another option. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] swresample: allow double precision beta value for the Kaiser window
On Sat, Nov 07, 2015 at 10:49:42PM +0100, wm4 wrote: > On Sat, 7 Nov 2015 20:00:50 + > Derek Buitenhuis wrote: > > > On 11/7/2015 7:35 PM, Paul B Mahol wrote: > > > AFAIK changing option from int to double will break programs which > > > assume opttions is int. > > > > Not really sure how it could. The original range allowed was [2,16], > > and using any of the av_opt_set functions should still work with that, > > no? > > A program could use av_opt_find() and then compute the pointer to the > option and set it manually. > > Is this valid API usage? Well, can you really tell? Or anyone? I've > certainly seen at least one program do this with another option. its certainly valid API usage to scan the options and extract the types. But IMO the types are not part of the ABI/API, an application doing that should be able to handle cases where the type changed AVOptions would be less usefull if types (and offsets) could not change And yes we probably should document this if all agree that this is how it should work [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB No great genius has ever existed without some touch of madness. -- Aristotle signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] swresample: allow double precision beta value for the Kaiser window
On Sat, Nov 7, 2015 at 4:57 PM, Michael Niedermayer wrote: > On Sat, Nov 07, 2015 at 10:49:42PM +0100, wm4 wrote: >> On Sat, 7 Nov 2015 20:00:50 + >> Derek Buitenhuis wrote: >> >> > On 11/7/2015 7:35 PM, Paul B Mahol wrote: >> > > AFAIK changing option from int to double will break programs which >> > > assume opttions is int. >> > >> > Not really sure how it could. The original range allowed was [2,16], >> > and using any of the av_opt_set functions should still work with that, >> > no? >> >> A program could use av_opt_find() and then compute the pointer to the >> option and set it manually. >> >> Is this valid API usage? Well, can you really tell? Or anyone? I've >> certainly seen at least one program do this with another option. > > its certainly valid API usage to scan the options and extract the > types. But IMO the types are not part of the ABI/API, an application > doing that should be able to handle cases where the type changed > AVOptions would be less usefull if types (and offsets) could not > change This is what I felt - it is an internal struct, and there are explicit comments in the header saying that the struct's fields are meant to be manipulated via the options API unlike e.g libavcodec. The types were IMHO not part of the ABI/API since the struct was marked opaque. Anyway, this was my reasoning while submitting the patch. > And yes we probably should document this if all agree that this is > how it should work > > > [...] > -- > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB > > No great genius has ever existed without some touch of madness. -- Aristotle > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 1/4] softfloat: handle INT32_MIN correctly in av_normalize1_sf
Otherwise a.mant=INT32_MIN triggers the av_assert2. Signed-off-by: Andreas Cadhalpun --- libavutil/softfloat.h | 4 1 file changed, 4 insertions(+) diff --git a/libavutil/softfloat.h b/libavutil/softfloat.h index 00ff4a1..5fa5dc0 100644 --- a/libavutil/softfloat.h +++ b/libavutil/softfloat.h @@ -77,6 +77,10 @@ static inline av_const SoftFloat av_normalize1_sf(SoftFloat a){ if((int32_t)(a.mant + 0x4000U) <= 0){ a.exp++; a.mant>>=1; +if(a.mant == -0x4000){ +a.exp++; +a.mant>>=1; +} } av_assert2(a.mant < 0x4000 && a.mant > -0x4000); return a; -- 2.6.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 2/4] softfloat: use av_normalize1_sf in av_int2sf
Otherwise the aac_fixed decoder triggers av_assert2 in av_mul_sf, when the input happens to be INT32_MIN. Signed-off-by: Andreas Cadhalpun --- libavutil/softfloat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/softfloat.h b/libavutil/softfloat.h index 5fa5dc0..e87cbf4 100644 --- a/libavutil/softfloat.h +++ b/libavutil/softfloat.h @@ -147,7 +147,7 @@ static inline av_const SoftFloat av_sub_sf(SoftFloat a, SoftFloat b){ * @returns a SoftFloat with value v * 2^frac_bits */ static inline av_const SoftFloat av_int2sf(int v, int frac_bits){ -return av_normalize_sf((SoftFloat){v, ONE_BITS + 1 - frac_bits}); +return av_normalize_sf(av_normalize1_sf((SoftFloat){v, ONE_BITS + 1 - frac_bits})); } /** -- 2.6.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 4/4] softfloat: return one when the argument of av_sqrt_sf is negative
Mathematically this is bogus, but it is much better than the previous behaviour: returning a random value from an out of bounds read. Returning zero will just lead to division by zero problems. This fixes av_assert2 failures in the aac_fixed decoder. Signed-off-by: Andreas Cadhalpun --- libavutil/softfloat.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavutil/softfloat.h b/libavutil/softfloat.h index fefde8c..0a2074a 100644 --- a/libavutil/softfloat.h +++ b/libavutil/softfloat.h @@ -170,6 +170,8 @@ static av_always_inline SoftFloat av_sqrt_sf(SoftFloat val) if (val.mant == 0) val.exp = 0; +else if (val.mant < 0) +val = FLOAT_1; else { tabIndex = (val.mant - 0x2000) >> 20; -- 2.6.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 3/4] softfloat: fix av_add_sf if one argument is zero
Otherwise (0x2000, 1) + (0, 33) gives (0, 33), i.e. 1 + 0 = 0. This fixes a division by zero in the aac_fixed decoder. Signed-off-by: Andreas Cadhalpun --- libavutil/softfloat.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavutil/softfloat.h b/libavutil/softfloat.h index e87cbf4..fefde8c 100644 --- a/libavutil/softfloat.h +++ b/libavutil/softfloat.h @@ -130,7 +130,9 @@ static inline av_const int av_gt_sf(SoftFloat a, SoftFloat b) static inline av_const SoftFloat av_add_sf(SoftFloat a, SoftFloat b){ int t= a.exp - b.exp; -if (t <-31) return b; +if (a.mant == 0) return b; +else if (b.mant == 0) return a; +else if (t <-31) return b; else if (t < 0) return av_normalize_sf(av_normalize1_sf((SoftFloat){ b.mant + (a.mant >> (-t)), b.exp})); else if (t < 32) return av_normalize_sf(av_normalize1_sf((SoftFloat){ a.mant + (b.mant >> t ), a.exp})); else return a; -- 2.6.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 3/4] softfloat: fix av_add_sf if one argument is zero
On Sun, Nov 08, 2015 at 12:08:54AM +0100, Andreas Cadhalpun wrote: > Otherwise (0x2000, 1) + (0, 33) gives (0, 33), i.e. 1 + 0 = 0. > > This fixes a division by zero in the aac_fixed decoder. > > Signed-off-by: Andreas Cadhalpun > --- > libavutil/softfloat.h | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/libavutil/softfloat.h b/libavutil/softfloat.h > index e87cbf4..fefde8c 100644 > --- a/libavutil/softfloat.h > +++ b/libavutil/softfloat.h > @@ -130,7 +130,9 @@ static inline av_const int av_gt_sf(SoftFloat a, > SoftFloat b) > > static inline av_const SoftFloat av_add_sf(SoftFloat a, SoftFloat b){ > int t= a.exp - b.exp; > -if (t <-31) return b; > +if (a.mant == 0) return b; > +else if (b.mant == 0) return a; this looks strange 0 should probably have the minimum exponent not 33 now if you want to support denormalized numbers, that is ones that have exponents larger than needed then this patch is not sufficient the same problem would arrise with non 0 mantisses too if their exponents arent minimal [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB It is dangerous to be right in matters on which the established authorities are wrong. -- Voltaire signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] Add pixblockdsp checkasm tests
--- Consolidates BUF_SIZE macros --- tests/checkasm/Makefile | 1 + tests/checkasm/checkasm.c| 3 ++ tests/checkasm/checkasm.h| 1 + tests/checkasm/pixblockdsp.c | 107 +++ 4 files changed, 112 insertions(+) create mode 100644 tests/checkasm/pixblockdsp.c diff --git a/tests/checkasm/Makefile b/tests/checkasm/Makefile index c29ceef..1c0290b 100644 --- a/tests/checkasm/Makefile +++ b/tests/checkasm/Makefile @@ -5,6 +5,7 @@ AVCODECOBJS-$(CONFIG_FLACDSP) += flacdsp.o AVCODECOBJS-$(CONFIG_H264PRED) += h264pred.o AVCODECOBJS-$(CONFIG_H264QPEL) += h264qpel.o AVCODECOBJS-$(CONFIG_JPEG2000_DECODER) += jpeg2000dsp.o +AVCODECOBJS-$(CONFIG_PIXBLOCKDSP) += pixblockdsp.o AVCODECOBJS-$(CONFIG_V210_ENCODER) += v210enc.o AVCODECOBJS-$(CONFIG_VP9_DECODER) += vp9dsp.o diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c index e875120..3548bb3 100644 --- a/tests/checkasm/checkasm.c +++ b/tests/checkasm/checkasm.c @@ -76,6 +76,9 @@ static const struct { #if CONFIG_JPEG2000_DECODER { "jpeg2000dsp", checkasm_check_jpeg2000dsp }, #endif +#if CONFIG_PIXBLOCKDSP +{ "pixblockdsp", checkasm_check_pixblockdsp }, +#endif #if CONFIG_V210_ENCODER { "v210enc", checkasm_check_v210enc }, #endif diff --git a/tests/checkasm/checkasm.h b/tests/checkasm/checkasm.h index 1775a25..73b7e42 100644 --- a/tests/checkasm/checkasm.h +++ b/tests/checkasm/checkasm.h @@ -35,6 +35,7 @@ void checkasm_check_flacdsp(void); void checkasm_check_h264pred(void); void checkasm_check_h264qpel(void); void checkasm_check_jpeg2000dsp(void); +void checkasm_check_pixblockdsp(void); void checkasm_check_v210enc(void); void checkasm_check_vp9dsp(void); diff --git a/tests/checkasm/pixblockdsp.c b/tests/checkasm/pixblockdsp.c new file mode 100644 index 000..70e7f74 --- /dev/null +++ b/tests/checkasm/pixblockdsp.c @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2015 Tiancheng "Timothy" Gu + * + * 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. + */ + +#include +#include "checkasm.h" +#include "libavcodec/pixblockdsp.h" +#include "libavutil/common.h" +#include "libavutil/internal.h" +#include "libavutil/intreadwrite.h" + +#define BUF_UNITS 8 +#define BUF_SIZE (BUF_UNITS * 128 + BUF_UNITS) + +#define randomize_buffers() \ +do {\ +int i; \ +for (i = 0; i < BUF_SIZE; i += 4) { \ +uint32_t r = rnd(); \ +AV_WN32A(src10 + i, r); \ +AV_WN32A(src11 + i, r); \ +r = rnd(); \ +AV_WN32A(src20 + i, r); \ +AV_WN32A(src21 + i, r); \ +r = rnd(); \ +AV_WN32A(dst0_ + i, r); \ +AV_WN32A(dst1_ + i, r); \ +} \ +} while (0) + +#define check_get_pixels(type) \ +do { \ +int i; \ +declare_func(void, int16_t *block, const uint8_t *pixels, ptrdiff_t line_size);\ + \ +for (i = 0; i < BUF_UNITS; i++) { \ +int src_offset = i * 64 * sizeof(type) + i; /* Test various alignments */ \ +int dst_offset = i * 64; /* dst must be aligned */ \ +randomize_buffers(); \ +call_ref(dst0 + dst_offset, src10 + src_offset, 8); \ +call_new(dst1 + dst_offset, src11 + src_offset, 8); \ +if (memcmp(src10, src11, BUF_SIZE)|| memcmp(dst0, dst1, BUF_SIZE)) \ +fail(); \ +bench_new(dst1 + dst_offset, src11 + src_offset, 8); \ +
Re: [FFmpeg-devel] [PATCH 4/4] softfloat: return one when the argument of av_sqrt_sf is negative
On Sun, Nov 08, 2015 at 12:09:02AM +0100, Andreas Cadhalpun wrote: > Mathematically this is bogus, but it is much better than the previous > behaviour: returning a random value from an out of bounds read. > > Returning zero will just lead to division by zero problems. > > This fixes av_assert2 failures in the aac_fixed decoder. > > Signed-off-by: Andreas Cadhalpun > --- > libavutil/softfloat.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/libavutil/softfloat.h b/libavutil/softfloat.h > index fefde8c..0a2074a 100644 > --- a/libavutil/softfloat.h > +++ b/libavutil/softfloat.h > @@ -170,6 +170,8 @@ static av_always_inline SoftFloat av_sqrt_sf(SoftFloat > val) > > if (val.mant == 0) > val.exp = 0; > +else if (val.mant < 0) > +val = FLOAT_1; this is IMHO not ok sqrt(-1) has 3 sane possible outcomes 1. the complex number i 2. NaN 3. abort() like division by 0 sqare roots of negative numbers in a context of real values are a bug, there is likely something wrong in the code that is calling sqrt with a negative number and simply returning 1 silently would make it hard to find and debug such bugs [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Concerning the gods, I have no means of knowing whether they exist or not or of what sort they may be, because of the obscurity of the subject, and the brevity of human life -- Protagoras signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/4] softfloat: handle INT32_MIN correctly in av_normalize1_sf
On Sun, Nov 08, 2015 at 12:07:08AM +0100, Andreas Cadhalpun wrote: > Otherwise a.mant=INT32_MIN triggers the av_assert2. > > Signed-off-by: Andreas Cadhalpun > --- > libavutil/softfloat.h | 4 > 1 file changed, 4 insertions(+) > > diff --git a/libavutil/softfloat.h b/libavutil/softfloat.h > index 00ff4a1..5fa5dc0 100644 > --- a/libavutil/softfloat.h > +++ b/libavutil/softfloat.h > @@ -77,6 +77,10 @@ static inline av_const SoftFloat > av_normalize1_sf(SoftFloat a){ > if((int32_t)(a.mant + 0x4000U) <= 0){ > a.exp++; > a.mant>>=1; > +if(a.mant == -0x4000){ > +a.exp++; > +a.mant>>=1; > +} is av_int2sf() the only way to reach this case ? if so it would be better to modify only av_int2sf() ans avoid this extra check in other cases (would slow them down) [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The greatest way to live with honor in this world is to be what we pretend to be. -- Socrates signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avformat: Add v210 demuxer
Allows one to do: ffmpeg -s 1920x1080 -i blah.v210 ... ffmpeg -s 1920x1080 -f v210x -i blah.yuv10 ... Fixes #1869. --- libavformat/Makefile | 2 + libavformat/allformats.c | 2 + libavformat/v210.c | 133 +++ 3 files changed, 137 insertions(+) create mode 100644 libavformat/v210.c diff --git a/libavformat/Makefile b/libavformat/Makefile index f2326df..1a03e0c 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -447,6 +447,8 @@ OBJS-$(CONFIG_TTA_DEMUXER) += tta.o apetag.o img2.o OBJS-$(CONFIG_TTY_DEMUXER) += tty.o sauce.o OBJS-$(CONFIG_TXD_DEMUXER) += txd.o OBJS-$(CONFIG_UNCODEDFRAMECRC_MUXER) += uncodedframecrcenc.o framehash.o +OBJS-$(CONFIG_V210_DEMUXER) += v210.o +OBJS-$(CONFIG_V210X_DEMUXER) += v210.o OBJS-$(CONFIG_VAG_DEMUXER) += vag.o OBJS-$(CONFIG_VC1_DEMUXER) += rawdec.o vc1dec.o OBJS-$(CONFIG_VC1_MUXER) += rawenc.o diff --git a/libavformat/allformats.c b/libavformat/allformats.c index 92e321c..8b8d9f2 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -314,6 +314,8 @@ void av_register_all(void) REGISTER_DEMUXER (TXD, txd); REGISTER_DEMUXER (TTY, tty); REGISTER_MUXER (UNCODEDFRAMECRC, uncodedframecrc); +REGISTER_DEMUXER (V210, v210); +REGISTER_DEMUXER (V210X,v210x); REGISTER_DEMUXER (VAG, vag); REGISTER_MUXDEMUX(VC1, vc1); REGISTER_MUXDEMUX(VC1T, vc1t); diff --git a/libavformat/v210.c b/libavformat/v210.c new file mode 100644 index 000..c506d5b --- /dev/null +++ b/libavformat/v210.c @@ -0,0 +1,133 @@ +/* + * Raw v210 video demuxer + * Copyright (c) 2015 Tiancheng "Timothy" Gu + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/imgutils.h" +#include "libavutil/parseutils.h" +#include "libavutil/pixdesc.h" +#include "libavutil/opt.h" +#include "internal.h" +#include "avformat.h" + +typedef struct V210DemuxerContext { +const AVClass *class; /**< Class for private options. */ +int width, height;/**< Integers describing video size, set by a private option. */ +AVRational framerate; /**< AVRational describing framerate, set by a private option. */ +} V210DemuxerContext; + +// v210 frame width is padded to multiples of 48 +#define GET_PACKET_SIZE(w, h) (((w + 47) / 48) * 48 * h * 8 / 3) + +static int v210_read_header(AVFormatContext *ctx) +{ +V210DemuxerContext *s = ctx->priv_data; +AVStream *st; + +st = avformat_new_stream(ctx, NULL); +if (!st) +return AVERROR(ENOMEM); + +st->codec->codec_type = AVMEDIA_TYPE_VIDEO; + +st->codec->codec_id = ctx->iformat->raw_codec_id; + +avpriv_set_pts_info(st, 64, s->framerate.den, s->framerate.num); + +st->codec->width= s->width; +st->codec->height = s->height; +st->codec->pix_fmt = ctx->iformat->raw_codec_id == AV_CODEC_ID_V210 ? + AV_PIX_FMT_YUV422P10 : AV_PIX_FMT_YUV422P16; +st->codec->bit_rate = av_rescale_q(GET_PACKET_SIZE(s->width, s->height), + (AVRational){8,1}, st->time_base); + +return 0; +} + + +static int v210_read_packet(AVFormatContext *s, AVPacket *pkt) +{ +int packet_size, ret, width, height; +AVStream *st = s->streams[0]; + +width = st->codec->width; +height = st->codec->height; + +packet_size = GET_PACKET_SIZE(width, height); +if (packet_size < 0) +return -1; + +ret = av_get_packet(s->pb, pkt, packet_size); +pkt->pts = pkt->dts = pkt->pos / packet_size; + +pkt->stream_index = 0; +if (ret < 0) +return ret; +return 0; +} + +#define OFFSET(x) offsetof(V210DemuxerContext, x) +#define DEC AV_OPT_FLAG_DECODING_PARAM +static const AVOption v210_options[] = { +{ "video_size", "set frame size", OFFSET(width), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, DEC }, +{ "framerate", "set frame rate", OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, 0, DEC }, +{ NULL }, +}; + +#if CONFIG_V210_DEMUXER +static const AVClass v210_demuxer
[FFmpeg-devel] [PATCH] avformat: Add v210 demuxer
Allows one to do: ffmpeg -s 1920x1080 -i blah.v210 ... ffmpeg -s 1920x1080 -f v210x -i blah.yuv10 ... Fixes #1869. --- libavformat/Makefile | 2 + libavformat/allformats.c | 2 + libavformat/v210.c | 133 +++ 3 files changed, 137 insertions(+) create mode 100644 libavformat/v210.c diff --git a/libavformat/Makefile b/libavformat/Makefile index f2326df..1a03e0c 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -447,6 +447,8 @@ OBJS-$(CONFIG_TTA_DEMUXER) += tta.o apetag.o img2.o OBJS-$(CONFIG_TTY_DEMUXER) += tty.o sauce.o OBJS-$(CONFIG_TXD_DEMUXER) += txd.o OBJS-$(CONFIG_UNCODEDFRAMECRC_MUXER) += uncodedframecrcenc.o framehash.o +OBJS-$(CONFIG_V210_DEMUXER) += v210.o +OBJS-$(CONFIG_V210X_DEMUXER) += v210.o OBJS-$(CONFIG_VAG_DEMUXER) += vag.o OBJS-$(CONFIG_VC1_DEMUXER) += rawdec.o vc1dec.o OBJS-$(CONFIG_VC1_MUXER) += rawenc.o diff --git a/libavformat/allformats.c b/libavformat/allformats.c index 92e321c..8b8d9f2 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -314,6 +314,8 @@ void av_register_all(void) REGISTER_DEMUXER (TXD, txd); REGISTER_DEMUXER (TTY, tty); REGISTER_MUXER (UNCODEDFRAMECRC, uncodedframecrc); +REGISTER_DEMUXER (V210, v210); +REGISTER_DEMUXER (V210X,v210x); REGISTER_DEMUXER (VAG, vag); REGISTER_MUXDEMUX(VC1, vc1); REGISTER_MUXDEMUX(VC1T, vc1t); diff --git a/libavformat/v210.c b/libavformat/v210.c new file mode 100644 index 000..ab29171 --- /dev/null +++ b/libavformat/v210.c @@ -0,0 +1,133 @@ +/* + * Raw v210 video demuxer + * Copyright (c) 2015 Tiancheng "Timothy" Gu + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/imgutils.h" +#include "libavutil/parseutils.h" +#include "libavutil/pixdesc.h" +#include "libavutil/opt.h" +#include "internal.h" +#include "avformat.h" + +typedef struct V210DemuxerContext { +const AVClass *class; /**< Class for private options. */ +int width, height;/**< Integers describing video size, set by a private option. */ +AVRational framerate; /**< AVRational describing framerate, set by a private option. */ +} V210DemuxerContext; + +// v210 frame width is padded to multiples of 48 +#define GET_PACKET_SIZE(w, h) (((w + 47) / 48) * 48 * h * 8 / 3) + +static int v210_read_header(AVFormatContext *ctx) +{ +V210DemuxerContext *s = ctx->priv_data; +AVStream *st; + +st = avformat_new_stream(ctx, NULL); +if (!st) +return AVERROR(ENOMEM); + +st->codec->codec_type = AVMEDIA_TYPE_VIDEO; + +st->codec->codec_id = ctx->iformat->raw_codec_id; + +avpriv_set_pts_info(st, 64, s->framerate.den, s->framerate.num); + +st->codec->width= s->width; +st->codec->height = s->height; +st->codec->pix_fmt = ctx->iformat->raw_codec_id == AV_CODEC_ID_V210 ? + AV_PIX_FMT_YUV422P10 : AV_PIX_FMT_YUV422P16; +st->codec->bit_rate = av_rescale_q(GET_PACKET_SIZE(s->width, s->height), + (AVRational){8,1}, st->time_base); + +return 0; +} + + +static int v210_read_packet(AVFormatContext *s, AVPacket *pkt) +{ +int packet_size, ret, width, height; +AVStream *st = s->streams[0]; + +width = st->codec->width; +height = st->codec->height; + +packet_size = GET_PACKET_SIZE(width, height); +if (packet_size < 0) +return -1; + +ret = av_get_packet(s->pb, pkt, packet_size); +pkt->pts = pkt->dts = pkt->pos / packet_size; + +pkt->stream_index = 0; +if (ret < 0) +return ret; +return 0; +} + +#define OFFSET(x) offsetof(V210DemuxerContext, x) +#define DEC AV_OPT_FLAG_DECODING_PARAM +static const AVOption v210_options[] = { +{ "video_size", "set frame size", OFFSET(width), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, DEC }, +{ "framerate", "set frame rate", OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, 0, DEC }, +{ NULL }, +}; + +#if CONFIG_V210_DEMUXER +static const AVClass v210_demuxer
[FFmpeg-devel] [PATCH] avformat: Add v210 demuxer
Allows one to do: ffmpeg -s 1920x1080 -i blah.v210 ... ffmpeg -s 1920x1080 -f v210x -i blah.yuv10 ... Fixes #1869. --- Remove .yuv from the list of extensions. --- libavformat/Makefile | 2 + libavformat/allformats.c | 2 + libavformat/v210.c | 133 +++ 3 files changed, 137 insertions(+) create mode 100644 libavformat/v210.c diff --git a/libavformat/Makefile b/libavformat/Makefile index f2326df..1a03e0c 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -447,6 +447,8 @@ OBJS-$(CONFIG_TTA_DEMUXER) += tta.o apetag.o img2.o OBJS-$(CONFIG_TTY_DEMUXER) += tty.o sauce.o OBJS-$(CONFIG_TXD_DEMUXER) += txd.o OBJS-$(CONFIG_UNCODEDFRAMECRC_MUXER) += uncodedframecrcenc.o framehash.o +OBJS-$(CONFIG_V210_DEMUXER) += v210.o +OBJS-$(CONFIG_V210X_DEMUXER) += v210.o OBJS-$(CONFIG_VAG_DEMUXER) += vag.o OBJS-$(CONFIG_VC1_DEMUXER) += rawdec.o vc1dec.o OBJS-$(CONFIG_VC1_MUXER) += rawenc.o diff --git a/libavformat/allformats.c b/libavformat/allformats.c index 92e321c..8b8d9f2 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -314,6 +314,8 @@ void av_register_all(void) REGISTER_DEMUXER (TXD, txd); REGISTER_DEMUXER (TTY, tty); REGISTER_MUXER (UNCODEDFRAMECRC, uncodedframecrc); +REGISTER_DEMUXER (V210, v210); +REGISTER_DEMUXER (V210X,v210x); REGISTER_DEMUXER (VAG, vag); REGISTER_MUXDEMUX(VC1, vc1); REGISTER_MUXDEMUX(VC1T, vc1t); diff --git a/libavformat/v210.c b/libavformat/v210.c new file mode 100644 index 000..ab29171 --- /dev/null +++ b/libavformat/v210.c @@ -0,0 +1,133 @@ +/* + * Raw v210 video demuxer + * Copyright (c) 2015 Tiancheng "Timothy" Gu + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/imgutils.h" +#include "libavutil/parseutils.h" +#include "libavutil/pixdesc.h" +#include "libavutil/opt.h" +#include "internal.h" +#include "avformat.h" + +typedef struct V210DemuxerContext { +const AVClass *class; /**< Class for private options. */ +int width, height;/**< Integers describing video size, set by a private option. */ +AVRational framerate; /**< AVRational describing framerate, set by a private option. */ +} V210DemuxerContext; + +// v210 frame width is padded to multiples of 48 +#define GET_PACKET_SIZE(w, h) (((w + 47) / 48) * 48 * h * 8 / 3) + +static int v210_read_header(AVFormatContext *ctx) +{ +V210DemuxerContext *s = ctx->priv_data; +AVStream *st; + +st = avformat_new_stream(ctx, NULL); +if (!st) +return AVERROR(ENOMEM); + +st->codec->codec_type = AVMEDIA_TYPE_VIDEO; + +st->codec->codec_id = ctx->iformat->raw_codec_id; + +avpriv_set_pts_info(st, 64, s->framerate.den, s->framerate.num); + +st->codec->width= s->width; +st->codec->height = s->height; +st->codec->pix_fmt = ctx->iformat->raw_codec_id == AV_CODEC_ID_V210 ? + AV_PIX_FMT_YUV422P10 : AV_PIX_FMT_YUV422P16; +st->codec->bit_rate = av_rescale_q(GET_PACKET_SIZE(s->width, s->height), + (AVRational){8,1}, st->time_base); + +return 0; +} + + +static int v210_read_packet(AVFormatContext *s, AVPacket *pkt) +{ +int packet_size, ret, width, height; +AVStream *st = s->streams[0]; + +width = st->codec->width; +height = st->codec->height; + +packet_size = GET_PACKET_SIZE(width, height); +if (packet_size < 0) +return -1; + +ret = av_get_packet(s->pb, pkt, packet_size); +pkt->pts = pkt->dts = pkt->pos / packet_size; + +pkt->stream_index = 0; +if (ret < 0) +return ret; +return 0; +} + +#define OFFSET(x) offsetof(V210DemuxerContext, x) +#define DEC AV_OPT_FLAG_DECODING_PARAM +static const AVOption v210_options[] = { +{ "video_size", "set frame size", OFFSET(width), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, DEC }, +{ "framerate", "set frame rate", OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, 0, DEC }, +{ NULL }, +}; + +#if CONFIG_
Re: [FFmpeg-devel] [PATCHv4] swresample/resample: improve bessel function accuracy and speed
On Thu, Nov 05, 2015 at 08:18:36PM -0500, Ganesh Ajjanagadde wrote: > On Thu, Nov 5, 2015 at 8:15 PM, Ganesh Ajjanagadde > wrote: > > [...] > > Nothing new here, just moved the copyright to the top of the file to > satisfy some legal requirements I am completely unaware of, don't know > why an inline copyright does not work. Anyway, I don't want to spam > the ML with this kind of boring stuff, but Carl has objections to the > patch until the legal stuff is sorted out. the patch LGTM but iam a developer not a lawyer ;) [...] -- 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
Re: [FFmpeg-devel] [PATCH] avformat: Add v210 demuxer
On 11/7/2015 9:45 PM, Timothy Gu wrote: > +#define OFFSET(x) offsetof(V210DemuxerContext, x) > +#define DEC AV_OPT_FLAG_DECODING_PARAM > +static const AVOption v210_options[] = { > +{ "video_size", "set frame size", OFFSET(width), AV_OPT_TYPE_IMAGE_SIZE, > {.str = NULL}, 0, 0, DEC }, Isn't this what -s is for? ffmpeg -s 1280x720 -f v210 -i INPUT Also, in any case you're missing height. > +{ "framerate", "set frame rate", OFFSET(framerate), > AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, 0, DEC }, Same here, -r. Assuming it works for the input stream. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCHv4] swresample/resample: improve bessel function accuracy and speed
On Sat, Nov 7, 2015 at 8:19 PM, Michael Niedermayer wrote: > On Thu, Nov 05, 2015 at 08:18:36PM -0500, Ganesh Ajjanagadde wrote: >> On Thu, Nov 5, 2015 at 8:15 PM, Ganesh Ajjanagadde >> wrote: >> > [...] >> >> Nothing new here, just moved the copyright to the top of the file to >> satisfy some legal requirements I am completely unaware of, don't know >> why an inline copyright does not work. Anyway, I don't want to spam >> the ML with this kind of boring stuff, but Carl has objections to the >> patch until the legal stuff is sorted out. > > the patch LGTM but iam a developer not a lawyer ;) Will give Carl another day (he was on vacation, don't know if he is back), but I don't think it is worth waiting beyond that - all important legal aspects are covered: boost license for relevant function which must explicitly be there verbatim, and copyright notice. Where to place them is really secondary - I have seen FOSS projects with such copyright given "inline" if it is for a single function. > > [...] > -- > 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 > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] Add pixblockdsp checkasm tests
On Sat, Nov 07, 2015 at 03:58:28PM -0800, Timothy Gu wrote: > --- > > Consolidates BUF_SIZE macros > > --- > tests/checkasm/Makefile | 1 + > tests/checkasm/checkasm.c| 3 ++ > tests/checkasm/checkasm.h| 1 + > tests/checkasm/pixblockdsp.c | 107 > +++ > 4 files changed, 112 insertions(+) > create mode 100644 tests/checkasm/pixblockdsp.c tested on linux32, linux64, qemu-mips, mingw works fine [...] -- 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] [PATCH] avformat: Add v210 demuxer
On Sat, Nov 07, 2015 at 10:22:34PM -0300, James Almer wrote: > On 11/7/2015 9:45 PM, Timothy Gu wrote: > > +#define OFFSET(x) offsetof(V210DemuxerContext, x) > > +#define DEC AV_OPT_FLAG_DECODING_PARAM > > +static const AVOption v210_options[] = { > > +{ "video_size", "set frame size", OFFSET(width), > > AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, DEC }, > > Isn't this what -s is for? > > ffmpeg -s 1280x720 -f v210 -i INPUT Well -s is only available for ffmpeg.c, unless I'm mistaken. > > Also, in any case you're missing height. AV_OPT_TYPE_IMAGE_SIZE works in an unorthodox way: it fills *(&width) with the width and *(&width + 1) with the height. See https://github.com/FFmpeg/FFmpeg/blob/master/libavutil/opt.c#L269 In the struct an `int height;` follows `int width;`, so this should work fine. > > > +{ "framerate", "set frame rate", OFFSET(framerate), > > AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, 0, DEC }, > > Same here, -r. Assuming it works for the input stream. Ditto. Timothy ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] Add pixblockdsp checkasm tests
On Sun, Nov 08, 2015 at 03:04:21AM +0100, Michael Niedermayer wrote: > On Sat, Nov 07, 2015 at 03:58:28PM -0800, Timothy Gu wrote: > > --- > > > > Consolidates BUF_SIZE macros > > > > --- > > tests/checkasm/Makefile | 1 + > > tests/checkasm/checkasm.c| 3 ++ > > tests/checkasm/checkasm.h| 1 + > > tests/checkasm/pixblockdsp.c | 107 > > +++ > > 4 files changed, 112 insertions(+) > > create mode 100644 tests/checkasm/pixblockdsp.c > > tested on linux32, linux64, qemu-mips, mingw > works fine Pushed. Thanks for testing. Timothy ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat: Add v210 demuxer
On 11/7/2015 11:46 PM, Timothy Gu wrote: > On Sat, Nov 07, 2015 at 10:22:34PM -0300, James Almer wrote: >> On 11/7/2015 9:45 PM, Timothy Gu wrote: >>> +#define OFFSET(x) offsetof(V210DemuxerContext, x) >>> +#define DEC AV_OPT_FLAG_DECODING_PARAM >>> +static const AVOption v210_options[] = { >>> +{ "video_size", "set frame size", OFFSET(width), >>> AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, DEC }, >> >> Isn't this what -s is for? >> >> ffmpeg -s 1280x720 -f v210 -i INPUT > > Well -s is only available for ffmpeg.c, unless I'm mistaken. > >> >> Also, in any case you're missing height. > > AV_OPT_TYPE_IMAGE_SIZE works in an unorthodox way: it fills *(&width) with > the width and *(&width + 1) with the height. See > https://github.com/FFmpeg/FFmpeg/blob/master/libavutil/opt.c#L269 > > In the struct an `int height;` follows `int width;`, so this should work > fine. > >> >>> +{ "framerate", "set frame rate", OFFSET(framerate), >>> AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, 0, DEC }, >> >> Same here, -r. Assuming it works for the input stream. > > Ditto. I see the rawvideo demuxer has the same options, so i suppose it's ok then. > > Timothy > ___ > 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] avformat/cache: Avoid int-overflow in cache compare function
cache protocol indexes its cache using AVTreeNodes which require a cmp function for inserting and searching new cache-entries. This cmp function expects a 32-bit int return value (negative, zero, or positive) but the cache cmp function returns an int64_t which can overflow the int, giving negative numbers for when it should be positive, vice versa. This manifests itself only for very large files (e.g. 4GB+) --- libavformat/cache.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/libavformat/cache.c b/libavformat/cache.c index 31f63e6..5631586 100644 --- a/libavformat/cache.c +++ b/libavformat/cache.c @@ -67,7 +67,8 @@ typedef struct Context { static int cmp(const void *key, const void *node) { -return (*(const int64_t *) key) - ((const CacheEntry *) node)->logical_pos; +int64_t diff = (*(const int64_t *) key) - ((const CacheEntry *) node)->logical_pos; +return diff > 0 ? 1 : diff < 0 ? -1 : 0; } static int cache_open(URLContext *h, const char *arg, int flags, AVDictionary **options) -- 1.7.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 1/2] aaccoder_twoloop: Mark sfdiff as av_unused
--- libavcodec/aaccoder_twoloop.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/aaccoder_twoloop.h b/libavcodec/aaccoder_twoloop.h index e53257f..328d7c8 100644 --- a/libavcodec/aaccoder_twoloop.h +++ b/libavcodec/aaccoder_twoloop.h @@ -691,7 +691,7 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx, /** Check that there's no SF delta range violations */ if (!sce->zeroes[w*16+g]) { if (prev != -1) { -int sfdiff = sce->sf_idx[w*16+g] - prev + SCALE_DIFF_ZERO; +av_unused int sfdiff = sce->sf_idx[w*16+g] - prev + SCALE_DIFF_ZERO; av_assert1(sfdiff >= 0 && sfdiff <= 2*SCALE_MAX_DIFF); } prev = sce->sf_idx[w*16+g]; -- 2.1.4 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 2/2] genh: Removed unused variable coef_splitted
--- libavformat/genh.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libavformat/genh.c b/libavformat/genh.c index 260e320..44862b3 100644 --- a/libavformat/genh.c +++ b/libavformat/genh.c @@ -40,7 +40,6 @@ static int genh_read_header(AVFormatContext *s) { unsigned start_offset, header_size, codec, coef_type, coef[2]; GENHDemuxContext *c = s->priv_data; -unsigned coef_splitted[2]; int align, ch, ret; AVStream *st; @@ -112,8 +111,7 @@ static int genh_read_header(AVFormatContext *s) coef[1] = avio_rl32(s->pb); c->dsp_int_type = avio_rl32(s->pb); coef_type= avio_rl32(s->pb); -coef_splitted[0] = avio_rl32(s->pb); -coef_splitted[1] = avio_rl32(s->pb); +avio_rl64(s->pb); /* coef_splitted */ if (st->codec->codec_id == AV_CODEC_ID_ADPCM_THP) { if (st->codec->channels > 2) { -- 2.1.4 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/2] genh: Removed unused variable coef_splitted
On 11/8/2015 2:01 AM, Timothy Gu wrote: > --- > libavformat/genh.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/libavformat/genh.c b/libavformat/genh.c > index 260e320..44862b3 100644 > --- a/libavformat/genh.c > +++ b/libavformat/genh.c > @@ -40,7 +40,6 @@ static int genh_read_header(AVFormatContext *s) > { > unsigned start_offset, header_size, codec, coef_type, coef[2]; > GENHDemuxContext *c = s->priv_data; > -unsigned coef_splitted[2]; > int align, ch, ret; > AVStream *st; > > @@ -112,8 +111,7 @@ static int genh_read_header(AVFormatContext *s) > coef[1] = avio_rl32(s->pb); > c->dsp_int_type = avio_rl32(s->pb); > coef_type= avio_rl32(s->pb); > -coef_splitted[0] = avio_rl32(s->pb); > -coef_splitted[1] = avio_rl32(s->pb); > +avio_rl64(s->pb); /* coef_splitted */ > > if (st->codec->codec_id == AV_CODEC_ID_ADPCM_THP) { > if (st->codec->channels > 2) { > https://ffmpeg.org/pipermail/ffmpeg-devel/2015-October/181546.html ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel