[FFmpeg-cvslog] lavc/mjpegdec: honor skip_frame option
ffmpeg | branch: master | Matthieu Bouron | Fri Oct 9 15:15:15 2015 +0200| [ff0dfb5c361aae841147f9f0ad2f72c45b973da5] | committer: Matthieu Bouron lavc/mjpegdec: honor skip_frame option > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ff0dfb5c361aae841147f9f0ad2f72c45b973da5 --- libavcodec/mjpegdec.c | 25 + 1 file changed, 25 insertions(+) diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 1a86b7b..e17b213 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -2038,6 +2038,22 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, return AVERROR(ENOSYS); } +if (avctx->skip_frame == AVDISCARD_ALL) { +switch(start_code) { +case SOF0: +case SOF1: +case SOF2: +case SOF3: +case SOF48: +case SOI: +case SOS: +case EOI: +break; +default: +goto skip; +} +} + switch (start_code) { case SOI: s->restart_interval = 0; @@ -2103,6 +2119,10 @@ eoi_parser: if (s->bottom_field == !s->interlace_polarity) break; } +if (avctx->skip_frame == AVDISCARD_ALL) { +s->got_picture = 0; +goto the_end_no_picture; +} if ((ret = av_frame_ref(frame, s->picture_ptr)) < 0) return ret; *got_frame = 1; @@ -2126,6 +2146,9 @@ eoi_parser: goto the_end; case SOS: s->cur_scan++; +if (avctx->skip_frame == AVDISCARD_ALL) +break; + if ((ret = ff_mjpeg_decode_sos(s, NULL, 0, NULL)) < 0 && (avctx->err_recognition & AV_EF_EXPLODE)) goto fail; @@ -2148,6 +2171,7 @@ eoi_parser: break; } +skip: /* eof process start code */ buf_ptr += (get_bits_count(&s->gb) + 7) / 8; av_log(avctx, AV_LOG_DEBUG, @@ -2344,6 +2368,7 @@ the_end: av_dict_copy(avpriv_frame_get_metadatap(data), s->exif_metadata, 0); av_dict_free(&s->exif_metadata); +the_end_no_picture: av_log(avctx, AV_LOG_DEBUG, "decode frame unused %"PTRDIFF_SPECIFIER" bytes\n", buf_end - buf_ptr); // return buf_end - buf_ptr; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavc/pngdec: honor skip_frame option
ffmpeg | branch: master | Matthieu Bouron | Fri Oct 9 15:14:11 2015 +0200| [cbe2dfa4e51b92b0e291ed71be6fcee595c4201d] | committer: Matthieu Bouron lavc/pngdec: honor skip_frame option > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cbe2dfa4e51b92b0e291ed71be6fcee595c4201d --- libavcodec/pngdec.c | 32 1 file changed, 32 insertions(+) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 99111d4..0bdd04e 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -1088,6 +1088,13 @@ static int decode_frame_common(AVCodecContext *avctx, PNGDecContext *s, for (;;) { length = bytestream2_get_bytes_left(&s->gb); if (length <= 0) { + +if (avctx->codec_id == AV_CODEC_ID_PNG && +avctx->skip_frame == AVDISCARD_ALL) { +av_frame_set_metadata(p, metadata); +return 0; +} + if (CONFIG_APNG_DECODER && avctx->codec_id == AV_CODEC_ID_APNG && length == 0) { if (!(s->state & PNG_IDAT)) return 0; @@ -1115,6 +1122,20 @@ static int decode_frame_common(AVCodecContext *avctx, PNGDecContext *s, ((tag >> 8) & 0xff), ((tag >> 16) & 0xff), ((tag >> 24) & 0xff), length); + +if (avctx->codec_id == AV_CODEC_ID_PNG && +avctx->skip_frame == AVDISCARD_ALL) { +switch(tag) { +case MKTAG('I', 'H', 'D', 'R'): +case MKTAG('p', 'H', 'Y', 's'): +case MKTAG('t', 'E', 'X', 't'): +case MKTAG('I', 'D', 'A', 'T'): +break; +default: +goto skip_tag; +} +} + switch (tag) { case MKTAG('I', 'H', 'D', 'R'): if ((ret = decode_ihdr_chunk(avctx, s, length)) < 0) @@ -1197,6 +1218,11 @@ skip_tag: } } exit_loop: +if (avctx->codec_id == AV_CODEC_ID_PNG && +avctx->skip_frame == AVDISCARD_ALL) { +av_frame_set_metadata(p, metadata); +return 0; +} if (s->bits_per_pixel <= 4) handle_small_bpp(s, p); @@ -1294,6 +1320,12 @@ static int decode_frame_png(AVCodecContext *avctx, if ((ret = decode_frame_common(avctx, s, p, avpkt)) < 0) goto the_end; +if (avctx->skip_frame == AVDISCARD_ALL) { +*got_frame = 0; +ret = bytestream2_tell(&s->gb); +goto the_end; +} + if ((ret = av_frame_ref(data, s->picture.f)) < 0) return ret; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] vp9: update timestamps in ref files using multiple invisible frames.
ffmpeg | branch: master | Ronald S. Bultje | Thu Oct 29 07:34:37 2015 -0400| [c048303823164ad0039907760636d59cdb46ad0e] | committer: Ronald S. Bultje vp9: update timestamps in ref files using multiple invisible frames. For the 10-show-existing-frame, the source file indeed has a timestamp of 3 (or 100/33) for the second visible frame, so the fix appears to work correctly. For the other, only the timebase is fixed, but again appears to be correct now. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c048303823164ad0039907760636d59cdb46ad0e --- tests/ref/fate/vp9-10-show-existing-frame |2 +- tests/ref/fate/vp9-16-intra-only |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ref/fate/vp9-10-show-existing-frame b/tests/ref/fate/vp9-10-show-existing-frame index 2885b00..6a2c904 100644 --- a/tests/ref/fate/vp9-10-show-existing-frame +++ b/tests/ref/fate/vp9-10-show-existing-frame @@ -4,7 +4,7 @@ #tb 0: 1/30 #stream#, dts,pts, duration, size, hash 0, 0, 0,1, 152064, 18981342ec178e082519451062c3a67f -0, 1, 1,1, 152064, 04ab9dbeac49ec31be58f6e671698e05 +0, 3, 3,1, 152064, 04ab9dbeac49ec31be58f6e671698e05 0, 4, 4,1, 152064, 4ed58a0ba93a5d97a232a50c5876cda2 0, 6, 6,1, 152064, a41f00034923e56ba51a0b598acc2e3a 0, 7, 7,1, 152064, 63fa55ae9535ccdf06d44cce8065dda6 diff --git a/tests/ref/fate/vp9-16-intra-only b/tests/ref/fate/vp9-16-intra-only index 5802a53..1e8d280 100644 --- a/tests/ref/fate/vp9-16-intra-only +++ b/tests/ref/fate/vp9-16-intra-only @@ -1,7 +1,7 @@ #format: frame checksums #version: 1 #hash: MD5 -#tb 0: 12/359 +#tb 0: 1001/3 #stream#, dts,pts, duration, size, hash 0, 0, 0,1, 152064, d57529601178948afa4818c3c8938884 0, 1, 1,1, 152064, d47e00250c45733d64af067a417bcd06 ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat: Rework add_to_pktbuf
ffmpeg | branch: master | Luca Barbato | Fri Oct 23 11:11:32 2015 +0200| [d584533cf38141172e20bae5436629ee17c8ce50] | committer: Luca Barbato avformat: Rework add_to_pktbuf Make it return an error and check its return value when it is used. Simplify the usage by calling `av_packet_ref` internally when needed. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d584533cf38141172e20bae5436629ee17c8ce50 --- libavformat/utils.c | 70 --- 1 file changed, 38 insertions(+), 32 deletions(-) diff --git a/libavformat/utils.c b/libavformat/utils.c index 94ee9d9..42f60d5 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -209,12 +209,23 @@ static int init_input(AVFormatContext *s, const char *filename, s, 0, s->probesize); } -static AVPacket *add_to_pktbuf(AVPacketList **packet_buffer, AVPacket *pkt, - AVPacketList **plast_pktl) +static int add_to_pktbuf(AVPacketList **packet_buffer, AVPacket *pkt, + AVPacketList **plast_pktl, int ref) { AVPacketList *pktl = av_mallocz(sizeof(AVPacketList)); +int ret; + if (!pktl) -return NULL; +return AVERROR(ENOMEM); + +if (ref) { +if ((ret = av_packet_ref(&pktl->pkt, pkt)) < 0) { +av_free(pktl); +return ret; +} +} else { +pktl->pkt = *pkt; +} if (*packet_buffer) (*plast_pktl)->next = pktl; @@ -223,23 +234,21 @@ static AVPacket *add_to_pktbuf(AVPacketList **packet_buffer, AVPacket *pkt, /* Add the packet in the buffered packet list. */ *plast_pktl = pktl; -pktl->pkt = *pkt; -return &pktl->pkt; +return 0; } static int queue_attached_pictures(AVFormatContext *s) { -int i; +int i, ret; for (i = 0; i < s->nb_streams; i++) if (s->streams[i]->disposition & AV_DISPOSITION_ATTACHED_PIC && s->streams[i]->discard < AVDISCARD_ALL) { -AVPacket copy = s->streams[i]->attached_pic; -copy.buf = av_buffer_ref(copy.buf); -if (!copy.buf) -return AVERROR(ENOMEM); -add_to_pktbuf(&s->internal->raw_packet_buffer, ©, - &s->internal->raw_packet_buffer_end); +ret = add_to_pktbuf(&s->internal->raw_packet_buffer, +&s->streams[i]->attached_pic, +&s->internal->raw_packet_buffer_end, 1); +if (ret < 0) +return ret; } return 0; } @@ -451,8 +460,10 @@ int ff_read_packet(AVFormatContext *s, AVPacket *pkt) !st->probe_packets)) return ret; -add_to_pktbuf(&s->internal->raw_packet_buffer, pkt, - &s->internal->raw_packet_buffer_end); +err = add_to_pktbuf(&s->internal->raw_packet_buffer, pkt, +&s->internal->raw_packet_buffer_end, 0); +if (err) +return err; s->internal->raw_packet_buffer_remaining_size -= pkt->size; if ((err = probe_codec(s, st, pkt)) < 0) @@ -837,16 +848,10 @@ static int parse_packet(AVFormatContext *s, AVPacket *pkt, int stream_index) 0, 0, AVINDEX_KEYFRAME); } -if (out_pkt.data == pkt->data && out_pkt.size == pkt->size) { -out_pkt.buf = pkt->buf; -pkt->buf= NULL; -} -if ((ret = av_dup_packet(&out_pkt)) < 0) -goto fail; - -if (!add_to_pktbuf(&s->internal->parse_queue, &out_pkt, &s->internal->parse_queue_end)) { +if ((ret = add_to_pktbuf(&s->internal->parse_queue, &out_pkt, + &s->internal->parse_queue_end, + 1))) { av_packet_unref(&out_pkt); -ret = AVERROR(ENOMEM); goto fail; } } @@ -1022,9 +1027,10 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt) return ret; } -if (av_dup_packet(add_to_pktbuf(&s->internal->packet_buffer, pkt, -&s->internal->packet_buffer_end)) < 0) -return AVERROR(ENOMEM); +ret = add_to_pktbuf(&s->internal->packet_buffer, pkt, +&s->internal->packet_buffer_end, 1); +if (ret < 0) +return ret; } } @@ -2181,12 +2187,12 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) break; } -if (ic->flags & AVFMT_FLAG_NOBUFFER) { -pkt = &pkt1; -} else { -pkt = add_to_pktbuf(&ic->internal->packet_buffer, &pkt1, -&ic->internal->packet_buffer_end); -if ((ret = av_dup_packet(pkt)) < 0) +pkt = &pkt1; + +if (!(ic->flags & AVFMT_FLAG_NOBUFFER)) { +ret = add_to_pktbuf(&ic->int
[FFmpeg-cvslog] Merge commit 'd584533cf38141172e20bae5436629ee17c8ce50'
ffmpeg | branch: master | Hendrik Leppkes | Thu Oct 29 14:06:11 2015 +0100| [54de179caa39e1c2f3cbea61dd05f818bb78a3b6] | committer: Hendrik Leppkes Merge commit 'd584533cf38141172e20bae5436629ee17c8ce50' * commit 'd584533cf38141172e20bae5436629ee17c8ce50': avformat: Rework add_to_pktbuf Merged-by: Hendrik Leppkes > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=54de179caa39e1c2f3cbea61dd05f818bb78a3b6 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avpacket: Deprecate av_dup_packet
ffmpeg | branch: master | Luca Barbato | Fri Oct 23 11:11:33 2015 +0200| [9b56d5c11488656254e9aed8d964ef2b7c2ff5e6] | committer: Luca Barbato avpacket: Deprecate av_dup_packet As documented, `av_dup_packet` is broken by design, `av_packet_ref` matches the AVFrame ref-counted API and can be safely used instead. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9b56d5c11488656254e9aed8d964ef2b7c2ff5e6 --- doc/APIchanges|8 +--- libavcodec/avcodec.h |5 - libavcodec/avpacket.c |4 libavformat/matroskaenc.c |7 +-- libavformat/mux.c | 10 -- 5 files changed, 18 insertions(+), 16 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index 590f192..0c5d141 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -13,9 +13,11 @@ libavutil: 2015-08-28 API changes, most recent first: -2015-xx-xx - xxx - lavc 57.7.0 - avcodec.h - Deprecate av_free_packet(). Use av_packet_unref() as replacement, - it resets the packet in a more consistent way. +2015-xx-xx - lavc 57.7.0 - avcodec.h + xx - Deprecate av_free_packet(). Use av_packet_unref() as replacement, + it resets the packet in a more consistent way. + xx - Deprecate av_dup_packet(), it is a no-op for most cases. + Use av_packet_ref() to make a non-refcounted AVPacket refcounted. 2015-xx-xx - xxx - lavc 57.5.0 - avcodec.h Add data and linesize array to AVSubtitleRect, to be used instead of diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index dfd18ba..9eaa2c6 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -3476,12 +3476,15 @@ int av_grow_packet(AVPacket *pkt, int grow_by); */ int av_packet_from_data(AVPacket *pkt, uint8_t *data, int size); +#if FF_API_AVPACKET_OLD_API /** * @warning This is a hack - the packet memory allocation stuff is broken. The * packet is allocated if it was not really allocated. + * + * @deprecated Use av_packet_ref */ +attribute_deprecated int av_dup_packet(AVPacket *pkt); -#if FF_API_AVPACKET_OLD_API /** * Free a packet. * diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c index eaea061..cec5bf8 100644 --- a/libavcodec/avpacket.c +++ b/libavcodec/avpacket.c @@ -128,6 +128,8 @@ int av_packet_from_data(AVPacket *pkt, uint8_t *data, int size) return 0; } +#if FF_API_AVPACKET_OLD_API +FF_DISABLE_DEPRECATION_WARNINGS #define ALLOC_MALLOC(data, size) data = av_malloc(size) #define ALLOC_BUF(data, size)\ do { \ @@ -187,6 +189,8 @@ failed_alloc: av_packet_unref(pkt); return AVERROR(ENOMEM); } +FF_ENABLE_DEPRECATION_WARNINGS +#endif void av_packet_free_side_data(AVPacket *pkt) { diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index f1bd272..baffd54 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -1608,12 +1608,7 @@ static int mkv_write_packet(AVFormatContext *s, AVPacket *pkt) // buffer an audio packet to ensure the packet containing the video // keyframe's timecode is contained in the same cluster for WebM if (codec_type == AVMEDIA_TYPE_AUDIO) { -mkv->cur_audio_pkt = *pkt; -if (pkt->buf) { -mkv->cur_audio_pkt.buf = av_buffer_ref(pkt->buf); -ret = mkv->cur_audio_pkt.buf ? 0 : AVERROR(ENOMEM); -} else -ret = av_dup_packet(&mkv->cur_audio_pkt); +ret = av_packet_ref(&mkv->cur_audio_pkt, pkt); } else ret = mkv_write_packet_internal(s, pkt); return ret; diff --git a/libavformat/mux.c b/libavformat/mux.c index e86d202..4a81e36 100644 --- a/libavformat/mux.c +++ b/libavformat/mux.c @@ -416,12 +416,8 @@ int ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt, this_pktl = av_mallocz(sizeof(AVPacketList)); if (!this_pktl) return AVERROR(ENOMEM); -this_pktl->pkt = *pkt; -pkt->buf = NULL; -pkt->side_data = NULL; -pkt->side_data_elems = 0; -// Duplicate the packet if it uses non-allocated memory -if ((ret = av_dup_packet(&this_pktl->pkt)) < 0) { + +if ((ret = av_packet_ref(&this_pktl->pkt, pkt)) < 0) { av_free(this_pktl); return ret; } @@ -450,6 +446,8 @@ next_non_null: s->streams[pkt->stream_index]->last_in_packet_buffer = *next_point = this_pktl; +av_packet_unref(pkt); + return 0; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avconv: support infinite loop for the loop option
ffmpeg | branch: master | Alexandra Hájková | Wed Oct 21 12:03:58 2015 +0200| [cd0e08813a0484002b5defbf557c859f123953ae] | committer: Luca Barbato avconv: support infinite loop for the loop option Signed-off-by: Luca Barbato > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cd0e08813a0484002b5defbf557c859f123953ae --- avconv.c|5 +++-- doc/avconv.texi |3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/avconv.c b/avconv.c index ed0a3dd..493f9d2 100644 --- a/avconv.c +++ b/avconv.c @@ -2329,7 +2329,8 @@ static int seek_to_start(InputFile *ifile, AVFormatContext *is) ifile->time_base); } -ifile->loop--; +if (ifile->loop > 0) +ifile->loop--; return ret; } @@ -2375,7 +2376,7 @@ static int process_input(void) ifile->eagain = 1; return ret; } -if ((ret < 0) && (ifile->loop > 1)) { +if (ret < 0 && ifile->loop) { if ((ret = seek_to_start(ifile, is)) < 0) return ret; ret = get_input_packet(ifile, &pkt); diff --git a/doc/avconv.texi b/doc/avconv.texi index bee2039..6aaf445 100644 --- a/doc/avconv.texi +++ b/doc/avconv.texi @@ -254,7 +254,8 @@ Overwrite output files without asking. Immediately exit when output files already exist. @item -loop @var{number} (@emph{input}) -Set number of times input stream shall be looped. +Set number of times input stream shall be looped. Loop 0 means no loop, +loop -1 means infinite loop. @item -c[:@var{stream_specifier}] @var{codec} (@emph{input/output,per-stream}) @itemx -codec[:@var{stream_specifier}] @var{codec} (@emph{input/output,per-stream}) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avpacket: Provide an alloc and a free function for the struct
ffmpeg | branch: master | Luca Barbato | Fri Oct 23 11:11:34 2015 +0200| [a9a60106370f862e191dea58e748626da6a8fe97] | committer: Luca Barbato avpacket: Provide an alloc and a free function for the struct Pave the way for having the size of the AVPacket struct not part of the ABI. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a9a60106370f862e191dea58e748626da6a8fe97 --- doc/APIchanges|3 +++ libavcodec/avcodec.h | 34 ++ libavcodec/avpacket.c | 33 + 3 files changed, 70 insertions(+) diff --git a/doc/APIchanges b/doc/APIchanges index 0c5d141..d301bd5 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -12,12 +12,15 @@ libavutil: 2015-08-28 API changes, most recent first: +2015-xx-xx - xxx - lavc 57.6.0 - avcodec.h 2015-xx-xx - lavc 57.7.0 - avcodec.h xx - Deprecate av_free_packet(). Use av_packet_unref() as replacement, it resets the packet in a more consistent way. xx - Deprecate av_dup_packet(), it is a no-op for most cases. Use av_packet_ref() to make a non-refcounted AVPacket refcounted. + xx - Add av_packet_alloc(), av_packet_clone(), av_packet_free(). + They match the AVFrame functions with the same name. 2015-xx-xx - xxx - lavc 57.5.0 - avcodec.h Add data and linesize array to AVSubtitleRect, to be used instead of diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 9eaa2c6..b47aafa 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -3426,6 +3426,40 @@ void avsubtitle_free(AVSubtitle *sub); */ /** + * Allocate an AVPacket and set its fields to default values. The resulting + * struct must be freed using av_packet_free(). + * + * @return An AVPacket filled with default values or NULL on failure. + * + * @note this only allocates the AVPacket itself, not the data buffers. Those + * must be allocated through other means such as av_new_packet. + * + * @see av_new_packet + */ +AVPacket *av_packet_alloc(void); + +/** + * Create a new packet that references the same data as src. + * + * This is a shortcut for av_packet_alloc()+av_packet_ref(). + * + * @return newly created AVPacket on success, NULL on error. + * + * @see av_packet_alloc + * @see av_packet_ref + */ +AVPacket *av_packet_clone(AVPacket *src); + +/** + * Free the packet, if the packet is reference counted, it will be + * unreferenced first. + * + * @param packet packet to be freed. The pointer will be set to NULL. + * @note passing NULL is a no-op. + */ +void av_packet_free(AVPacket **pkt); + +/** * Initialize optional fields of a packet with default values. * * Note, this does not touch the data and size members, which have to be diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c index cec5bf8..a6eb241 100644 --- a/libavcodec/avpacket.c +++ b/libavcodec/avpacket.c @@ -46,6 +46,26 @@ FF_ENABLE_DEPRECATION_WARNINGS pkt->side_data_elems = 0; } +AVPacket *av_packet_alloc(void) +{ +AVPacket *pkt = av_mallocz(sizeof(AVPacket)); +if (!pkt) +return pkt; + +av_packet_unref(pkt); + +return pkt; +} + +void av_packet_free(AVPacket **pkt) +{ +if (!pkt || !*pkt) +return; + +av_packet_unref(*pkt); +av_freep(pkt); +} + static int packet_alloc(AVBufferRef **buf, int size) { int ret; @@ -343,6 +363,19 @@ fail: return ret; } +AVPacket *av_packet_clone(AVPacket *src) +{ +AVPacket *ret = av_packet_alloc(); + +if (!ret) +return ret; + +if (av_packet_ref(ret, src)) +av_packet_free(&ret); + +return ret; +} + void av_packet_move_ref(AVPacket *dst, AVPacket *src) { *dst = *src; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'a9a60106370f862e191dea58e748626da6a8fe97'
ffmpeg | branch: master | Hendrik Leppkes | Thu Oct 29 14:18:03 2015 +0100| [3ec049b85dacdb5e3f598e4ddab87b1d5a877783] | committer: Hendrik Leppkes Merge commit 'a9a60106370f862e191dea58e748626da6a8fe97' * commit 'a9a60106370f862e191dea58e748626da6a8fe97': avpacket: Provide an alloc and a free function for the struct Merged-by: Hendrik Leppkes > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3ec049b85dacdb5e3f598e4ddab87b1d5a877783 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'cd0e08813a0484002b5defbf557c859f123953ae'
ffmpeg | branch: master | Hendrik Leppkes | Thu Oct 29 14:21:41 2015 +0100| [9f7de9951790ca86321dccd9705e463f5310958b] | committer: Hendrik Leppkes Merge commit 'cd0e08813a0484002b5defbf557c859f123953ae' * commit 'cd0e08813a0484002b5defbf557c859f123953ae': avconv: support infinite loop for the loop option Merged-by: Hendrik Leppkes > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9f7de9951790ca86321dccd9705e463f5310958b --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '9b56d5c11488656254e9aed8d964ef2b7c2ff5e6'
ffmpeg | branch: master | Hendrik Leppkes | Thu Oct 29 14:16:44 2015 +0100| [87a6f532b46fb16eea07943325f5d322d08e13ed] | committer: Hendrik Leppkes Merge commit '9b56d5c11488656254e9aed8d964ef2b7c2ff5e6' * commit '9b56d5c11488656254e9aed8d964ef2b7c2ff5e6': avpacket: Deprecate av_dup_packet Merged-by: Hendrik Leppkes > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=87a6f532b46fb16eea07943325f5d322d08e13ed --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'f3aff31e5f66a4f1c4e34ce4944f4a402aca61ed'
ffmpeg | branch: master | Hendrik Leppkes | Thu Oct 29 14:23:24 2015 +0100| [7c99384f3c41ef2cc3b232db3878a03eed5c6bb9] | committer: Hendrik Leppkes Merge commit 'f3aff31e5f66a4f1c4e34ce4944f4a402aca61ed' * commit 'f3aff31e5f66a4f1c4e34ce4944f4a402aca61ed': avpicture: Deprecate the single fields Merged-by: Hendrik Leppkes > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7c99384f3c41ef2cc3b232db3878a03eed5c6bb9 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avpicture: Deprecate the single fields
ffmpeg | branch: master | Luca Barbato | Tue Oct 27 21:53:26 2015 +0100| [f3aff31e5f66a4f1c4e34ce4944f4a402aca61ed] | committer: Luca Barbato avpicture: Deprecate the single fields Silence pointless warnings from gcc. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f3aff31e5f66a4f1c4e34ce4944f4a402aca61ed --- libavcodec/avcodec.h |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index b47aafa..e368d6b 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -3181,10 +3181,12 @@ typedef struct AVHWAccel { /** * four components are given, that's all. * the last component is alpha + * @deprecated Use the imgutils functions */ -attribute_deprecated typedef struct AVPicture { +attribute_deprecated uint8_t *data[AV_NUM_DATA_POINTERS]; +attribute_deprecated int linesize[AV_NUM_DATA_POINTERS]; ///< number of bytes per line } AVPicture; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] opus: Buffer the samples from the correct offset
ffmpeg | branch: master | Michael Niedermayer | Tue Oct 27 13:47:12 2015 +0100| [6dcd82290438eb810936de4febd0558b38a08ec5] | committer: Luca Barbato opus: Buffer the samples from the correct offset When not all the opus stream have the same amount of decoded samples process the least amount and store what is left from the other streams. Bug-Id: 909 CC: libav-sta...@libav.org Signed-off-by: Michael Niedermayer Signed-off-by: Luca Barbato > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6dcd82290438eb810936de4febd0558b38a08ec5 --- libavcodec/opusdec.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/opusdec.c b/libavcodec/opusdec.c index acae6e1..919e5e3 100644 --- a/libavcodec/opusdec.c +++ b/libavcodec/opusdec.c @@ -567,8 +567,8 @@ static int opus_decode_packet(AVCodecContext *avctx, void *data, if (buffer_samples) { float *buf[2] = { c->out[2 * i + 0] ? c->out[2 * i + 0] : (float*)frame->extended_data[0], c->out[2 * i + 1] ? c->out[2 * i + 1] : (float*)frame->extended_data[0] }; -buf[0] += buffer_samples; -buf[1] += buffer_samples; +buf[0] += decoded_samples; +buf[1] += decoded_samples; ret = av_audio_fifo_write(c->sync_buffers[i], (void**)buf, buffer_samples); if (ret < 0) return ret; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] opus: Do not call vector_fmul_scalar on zero samples
ffmpeg | branch: master | Kieran Kunhya | Wed Oct 28 17:01:56 2015 +0100| [b8deb7c34f755d5e3eee0b5930c3a6ad2dda96bc] | committer: Luca Barbato opus: Do not call vector_fmul_scalar on zero samples The x86 variant of this function crashes in that specific case. CC: libav-de...@libav.org > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b8deb7c34f755d5e3eee0b5930c3a6ad2dda96bc --- libavcodec/opusdec.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/opusdec.c b/libavcodec/opusdec.c index 919e5e3..92e651c 100644 --- a/libavcodec/opusdec.c +++ b/libavcodec/opusdec.c @@ -587,7 +587,7 @@ static int opus_decode_packet(AVCodecContext *avctx, void *data, memset(frame->extended_data[i], 0, frame->linesize[0]); } -if (c->gain_i) { +if (c->gain_i && decoded_samples > 0) { c->fdsp.vector_fmul_scalar((float*)frame->extended_data[i], (float*)frame->extended_data[i], c->gain, FFALIGN(decoded_samples, 8)); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'b8deb7c34f755d5e3eee0b5930c3a6ad2dda96bc'
ffmpeg | branch: master | Hendrik Leppkes | Thu Oct 29 14:25:19 2015 +0100| [313f53824ef4d868a61f7f1886dde7b61cde5388] | committer: Hendrik Leppkes Merge commit 'b8deb7c34f755d5e3eee0b5930c3a6ad2dda96bc' * commit 'b8deb7c34f755d5e3eee0b5930c3a6ad2dda96bc': opus: Do not call vector_fmul_scalar on zero samples Merged-by: Hendrik Leppkes > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=313f53824ef4d868a61f7f1886dde7b61cde5388 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '6dcd82290438eb810936de4febd0558b38a08ec5'
ffmpeg | branch: master | Hendrik Leppkes | Thu Oct 29 14:24:53 2015 +0100| [f2dc68e2e2dd56d87075551267a877912e73f6a2] | committer: Hendrik Leppkes Merge commit '6dcd82290438eb810936de4febd0558b38a08ec5' * commit '6dcd82290438eb810936de4febd0558b38a08ec5': opus: Buffer the samples from the correct offset Merged-by: Hendrik Leppkes > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f2dc68e2e2dd56d87075551267a877912e73f6a2 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '9e14a992409348630ea96521411127418a92e8a3'
ffmpeg | branch: master | Hendrik Leppkes | Thu Oct 29 14:26:07 2015 +0100| [f79bb118f58988059768140e517b67a6fb2c07c7] | committer: Hendrik Leppkes Merge commit '9e14a992409348630ea96521411127418a92e8a3' * commit '9e14a992409348630ea96521411127418a92e8a3': libopenh264enc: Add an option for controlling the frame skipping Merged-by: Hendrik Leppkes > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f79bb118f58988059768140e517b67a6fb2c07c7 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] libopenh264enc: Add an option for controlling the frame skipping
ffmpeg | branch: master | Martin Storsjö | Wed Oct 28 11:06:36 2015 +0200| [9e14a992409348630ea96521411127418a92e8a3] | committer: Martin Storsjö libopenh264enc: Add an option for controlling the frame skipping This allows enabling the frame skipping, which is required for the encoder to properly hit the target bitrate. Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9e14a992409348630ea96521411127418a92e8a3 --- libavcodec/libopenh264enc.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c index 1553b6d..0502bc1 100644 --- a/libavcodec/libopenh264enc.c +++ b/libavcodec/libopenh264enc.c @@ -38,6 +38,7 @@ typedef struct SVCContext { int loopfilter; char *profile; int max_nal_size; +int skip_frames; } SVCContext; #define OPENH264_VER_AT_LEAST(maj, min) \ @@ -55,6 +56,7 @@ static const AVOption options[] = { { "loopfilter", "Enable loop filter", OFFSET(loopfilter), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, VE }, { "profile", "Set profile restrictions", OFFSET(profile), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE }, { "max_nal_size", "Set maximum NAL size in bytes", OFFSET(max_nal_size), AV_OPT_TYPE_INT, { 0 }, 0, INT_MAX, VE }, +{ "allow_skip_frames", "Allow skipping frames to hit the target bitrate", OFFSET(skip_frames), AV_OPT_TYPE_INT, { 0 }, 0, 1, VE }, { NULL } }; @@ -144,7 +146,7 @@ static av_cold int svc_encode_init(AVCodecContext *avctx) param.bEnableDenoise = 0; param.bEnableBackgroundDetection = 1; param.bEnableAdaptiveQuant = 1; -param.bEnableFrameSkip = 0; +param.bEnableFrameSkip = s->skip_frames; param.bEnableLongTermReference = 0; param.iLtrMarkPeriod = 30; param.uiIntraPeriod = avctx->gop_size; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '8edaf625f3c38c695c33745822182e94e17d6e1b'
ffmpeg | branch: master | Hendrik Leppkes | Thu Oct 29 14:26:17 2015 +0100| [7968b1f85339694e05ea9f904d20a7233e652c43] | committer: Hendrik Leppkes Merge commit '8edaf625f3c38c695c33745822182e94e17d6e1b' * commit '8edaf625f3c38c695c33745822182e94e17d6e1b': libopenh264enc: Count and warn about the number of skipped frames Merged-by: Hendrik Leppkes > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7968b1f85339694e05ea9f904d20a7233e652c43 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] libopenh264enc: Count and warn about the number of skipped frames
ffmpeg | branch: master | Martin Storsjö | Wed Oct 28 11:12:42 2015 +0200| [8edaf625f3c38c695c33745822182e94e17d6e1b] | committer: Martin Storsjö libopenh264enc: Count and warn about the number of skipped frames Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8edaf625f3c38c695c33745822182e94e17d6e1b --- libavcodec/libopenh264enc.c |4 1 file changed, 4 insertions(+) diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c index 0502bc1..c10409b 100644 --- a/libavcodec/libopenh264enc.c +++ b/libavcodec/libopenh264enc.c @@ -39,6 +39,7 @@ typedef struct SVCContext { char *profile; int max_nal_size; int skip_frames; +int skipped; } SVCContext; #define OPENH264_VER_AT_LEAST(maj, min) \ @@ -95,6 +96,8 @@ static av_cold int svc_encode_close(AVCodecContext *avctx) if (s->encoder) WelsDestroySVCEncoder(s->encoder); +if (s->skipped > 0) +av_log(avctx, AV_LOG_WARNING, "%d frames skipped\n", s->skipped); return 0; } @@ -252,6 +255,7 @@ static int svc_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, return AVERROR_UNKNOWN; } if (fbi.eFrameType == videoFrameTypeSkip) { +s->skipped++; av_log(avctx, AV_LOG_DEBUG, "frame skipped\n"); return 0; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/asrc_sine: fix options typos
ffmpeg | branch: master | Kyle Swanson | Wed Oct 28 13:03:43 2015 -0500| [e5451f25d3c2728943d31da2cf7975f33f5c9831] | committer: Michael Niedermayer avfilter/asrc_sine: fix options typos Signed-off-by: Kyle Swanson Reviewed-by: Nicolas George Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e5451f25d3c2728943d31da2cf7975f33f5c9831 --- libavfilter/asrc_sine.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/asrc_sine.c b/libavfilter/asrc_sine.c index f361faa..2a2f3c3 100644 --- a/libavfilter/asrc_sine.c +++ b/libavfilter/asrc_sine.c @@ -69,8 +69,8 @@ typedef struct { static const AVOption sine_options[] = { OPT_DBL("frequency", frequency,440, 0, DBL_MAX, "set the sine frequency",), OPT_DBL("f", frequency,440, 0, DBL_MAX, "set the sine frequency",), -OPT_DBL("beep_factor", beep_factor,0, 0, DBL_MAX, "set the beep fequency factor",), -OPT_DBL("b", beep_factor,0, 0, DBL_MAX, "set the beep fequency factor",), +OPT_DBL("beep_factor", beep_factor,0, 0, DBL_MAX, "set the beep frequency factor",), +OPT_DBL("b", beep_factor,0, 0, DBL_MAX, "set the beep frequency factor",), OPT_INT("sample_rate", sample_rate,44100, 1, INT_MAX, "set the sample rate",), OPT_INT("r", sample_rate,44100, 1, INT_MAX, "set the sample rate",), OPT_DUR("duration", duration, 0, 0, INT64_MAX, "set the audio duration",), ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/tremolo: fix wavetable buffer size
ffmpeg | branch: master | Kyle Swanson | Wed Oct 28 21:29:59 2015 -0500| [3b1939bb6679e4e2e91eb41e7f09830ac418de16] | committer: Michael Niedermayer avfilter/tremolo: fix wavetable buffer size Signed-off-by: Kyle Swanson Reviewed-by: Paul B Mahol Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3b1939bb6679e4e2e91eb41e7f09830ac418de16 --- libavfilter/af_tremolo.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavfilter/af_tremolo.c b/libavfilter/af_tremolo.c index 50df2e4..572e9e3 100644 --- a/libavfilter/af_tremolo.c +++ b/libavfilter/af_tremolo.c @@ -72,7 +72,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) dst += channels; src += channels; s->index++; -if (s->index >= inlink->sample_rate) +if (s->index >= inlink->sample_rate / s->freq) s->index = 0; } @@ -125,11 +125,11 @@ static int config_input(AVFilterLink *inlink) const double offset = 1. - s->depth / 2.; int i; -s->table = av_malloc_array(inlink->sample_rate, sizeof(*s->table)); +s->table = av_malloc_array(inlink->sample_rate / s->freq, sizeof(*s->table)); if (!s->table) return AVERROR(ENOMEM); -for (i = 0; i < inlink->sample_rate; i++) { +for (i = 0; i < inlink->sample_rate / s->freq; i++) { double env = s->freq * i / inlink->sample_rate; env = sin(2 * M_PI * fmod(env + 0.25, 1.0)); s->table[i] = env * (1 - fabs(offset)) + offset; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec: add ADPCM AICA decoder
ffmpeg | branch: master | Paul B Mahol | Wed Oct 28 14:51:27 2015 +0100| [af3f793f6048de558d7474167e27e7caf6bf] | committer: Paul B Mahol avcodec: add ADPCM AICA decoder Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=af3f793f6048de558d7474167e27e7caf6bf --- Changelog |1 + doc/general.texi|1 + libavcodec/Makefile |1 + libavcodec/adpcm.c | 18 ++ libavcodec/allcodecs.c |1 + libavcodec/avcodec.h|1 + libavcodec/codec_desc.c |7 +++ libavcodec/utils.c |1 + libavcodec/version.h|2 +- libavformat/genh.c |1 + 10 files changed, 33 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index 04082a9..d320317 100644 --- a/Changelog +++ b/Changelog @@ -28,6 +28,7 @@ version : - SDX2 DPCM decoder - vibrato filter - innoHeim/Rsupport Screen Capture Codec decoder +- ADPCM AICA decoder version 2.8: diff --git a/doc/general.texi b/doc/general.texi index 37929c9..0a2c577 100644 --- a/doc/general.texi +++ b/doc/general.texi @@ -887,6 +887,7 @@ following image formats are supported: @tab encoding supported through external library libfaac and libvo-aacenc @item AC-3 @tab IX @tab IX @item ADPCM 4X Movie @tab @tab X +@item APDCM Yamaha AICA @tab @tab X @item ADPCM CDROM XA @tab @tab X @item ADPCM Creative Technology @tab @tab X @tab 16 -> 4, 8 -> 4, 8 -> 3, 8 -> 2 diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 5f38ebb..8162447 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -662,6 +662,7 @@ OBJS-$(CONFIG_ADPCM_4XM_DECODER) += adpcm.o adpcm_data.o OBJS-$(CONFIG_ADPCM_ADX_DECODER) += adxdec.o adx.o OBJS-$(CONFIG_ADPCM_ADX_ENCODER) += adxenc.o adx.o OBJS-$(CONFIG_ADPCM_AFC_DECODER) += adpcm.o adpcm_data.o +OBJS-$(CONFIG_ADPCM_AICA_DECODER) += adpcm.o adpcm_data.o OBJS-$(CONFIG_ADPCM_CT_DECODER) += adpcm.o adpcm_data.o OBJS-$(CONFIG_ADPCM_DTK_DECODER) += adpcm.o adpcm_data.o OBJS-$(CONFIG_ADPCM_EA_DECODER) += adpcm.o adpcm_data.o diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index 98af171..c4a0a18 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -143,6 +143,7 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx) } switch(avctx->codec->id) { +case AV_CODEC_ID_ADPCM_AICA: case AV_CODEC_ID_ADPCM_IMA_QT: case AV_CODEC_ID_ADPCM_IMA_WAV: case AV_CODEC_ID_ADPCM_4XM: @@ -521,6 +522,7 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb, case AV_CODEC_ID_ADPCM_IMA_OKI: case AV_CODEC_ID_ADPCM_IMA_WS: case AV_CODEC_ID_ADPCM_YAMAHA: +case AV_CODEC_ID_ADPCM_AICA: nb_samples = buf_size * 2 / ch; break; } @@ -1380,6 +1382,21 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data, *samples++ = adpcm_yamaha_expand_nibble(&c->status[st], v >> 4 ); } break; +case AV_CODEC_ID_ADPCM_AICA: +if (!c->has_status) { +for (channel = 0; channel < avctx->channels; channel++) +c->status[channel].step = 0; +c->has_status = 1; +} +for (channel = 0; channel < avctx->channels; channel++) { +samples = samples_p[channel]; +for (n = nb_samples >> 1; n > 0; n--) { +int v = bytestream2_get_byteu(&gb); +*samples++ = adpcm_yamaha_expand_nibble(&c->status[channel], v & 0x0F); +*samples++ = adpcm_yamaha_expand_nibble(&c->status[channel], v >> 4 ); +} +} +break; case AV_CODEC_ID_ADPCM_AFC: { int samples_per_block; @@ -1642,6 +1659,7 @@ AVCodec ff_ ## name_ ## _decoder = { \ /* Note: Do not forget to add new entries to the Makefile as well. */ ADPCM_DECODER(AV_CODEC_ID_ADPCM_4XM, sample_fmts_s16p, adpcm_4xm, "ADPCM 4X Movie"); ADPCM_DECODER(AV_CODEC_ID_ADPCM_AFC, sample_fmts_s16p, adpcm_afc, "ADPCM Nintendo Gamecube AFC"); +ADPCM_DECODER(AV_CODEC_ID_ADPCM_AICA,sample_fmts_s16p, adpcm_aica, "ADPCM Yamaha AICA"); ADPCM_DECODER(AV_CODEC_ID_ADPCM_CT, sample_fmts_s16, adpcm_ct, "ADPCM Creative Technology"); ADPCM_DECODER(AV_CODEC_ID_ADPCM_DTK, sample_fmts_s16p, adpcm_dtk, "ADPCM Nintendo Gamecube DTK"); ADPCM_DECODER(AV_CODEC_ID_ADPCM_EA, sample_fmts_s16, adpcm_ea, "ADPCM Electronic Arts"); diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index 4b54615..49478a1 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -488,6 +488,7 @@ void avcodec_register_all(void) REGISTER_DECODER(ADPCM_4XM, adpcm_4xm); REGISTER_ENCDEC (ADPCM_ADX, adpcm_adx); REGISTER_DECODER(ADP
[FFmpeg-cvslog] avformat: add 3dostr demuxer
ffmpeg | branch: master | Paul B Mahol | Tue Oct 27 20:58:23 2015 +0100| [e99321a3b6e117169603051c7db6245778525411] | committer: Paul B Mahol avformat: add 3dostr demuxer Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e99321a3b6e117169603051c7db6245778525411 --- Changelog|2 +- doc/general.texi |1 + libavformat/3dostr.c | 168 ++ libavformat/Makefile |1 + libavformat/allformats.c |1 + libavformat/version.h|2 +- 6 files changed, 173 insertions(+), 2 deletions(-) diff --git a/Changelog b/Changelog index 2f71a6f..04082a9 100644 --- a/Changelog +++ b/Changelog @@ -20,7 +20,7 @@ version : - selectivecolor filter - extensive native AAC encoder improvements - ADPCM PSX decoder -- genh, vag, xvag, ads, msf & svag demuxer +- 3dostr, genh, vag, xvag, ads, msf & svag demuxer - zscale filter - wve demuxer - zero-copy Intel QSV transcoding in ffmpeg diff --git a/doc/general.texi b/doc/general.texi index 942ae63..37929c9 100644 --- a/doc/general.texi +++ b/doc/general.texi @@ -223,6 +223,7 @@ library: @multitable @columnfractions .4 .1 .1 .4 @item Name @tab Encoding @tab Decoding @tab Comments +@item 3dostr@tab @tab X @item 4xm @tab @tab X @tab 4X Technologies format, used in some games. @item 8088flex TMV @tab @tab X diff --git a/libavformat/3dostr.c b/libavformat/3dostr.c new file mode 100644 index 000..ac58a6c --- /dev/null +++ b/libavformat/3dostr.c @@ -0,0 +1,168 @@ +/* + * 3DO STR demuxer + * Copyright (c) 2015 Paul B Mahol + * + * 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 "avformat.h" +#include "internal.h" + +static int threedostr_probe(AVProbeData *p) +{ +if (memcmp(p->buf, "CTRL", 4) && +memcmp(p->buf, "SHDR", 4) && +memcmp(p->buf, "SNDS", 4)) +return 0; + +return AVPROBE_SCORE_MAX / 3 * 2; +} + +static int threedostr_read_header(AVFormatContext *s) +{ +unsigned chunk, codec = 0, size, ctrl_size = -1, found_shdr = 0; +AVStream *st; + +while (!avio_feof(s->pb) && !found_shdr) { +chunk = avio_rl32(s->pb); +size = avio_rb32(s->pb); + +if (size < 8) +return AVERROR_INVALIDDATA; +size -= 8; + +switch (chunk) { +case MKTAG('C','T','R','L'): +ctrl_size = size; +break; +case MKTAG('S','N','D','S'): +if (size < 56) +return AVERROR_INVALIDDATA; +avio_skip(s->pb, 8); +if (avio_rl32(s->pb) != MKTAG('S','H','D','R')) +return AVERROR_INVALIDDATA; +avio_skip(s->pb, 24); + +st = avformat_new_stream(s, NULL); +if (!st) +return AVERROR(ENOMEM); + +st->codec->codec_type = AVMEDIA_TYPE_AUDIO; +st->codec->sample_rate = avio_rb32(s->pb); +st->codec->channels= avio_rb32(s->pb); +if (st->codec->channels <= 0) +return AVERROR_INVALIDDATA; +codec = avio_rl32(s->pb); +avio_skip(s->pb, 4); +if (ctrl_size == 20 || ctrl_size == 3 || ctrl_size == -1) +st->duration = (avio_rb32(s->pb) - 1) / st->codec->channels; +else +st->duration = avio_rb32(s->pb) * 16 / st->codec->channels; +size -= 56; +found_shdr = 1; +break; +case MKTAG('S','H','D','R'): +if (size > 0x78) { +avio_skip(s->pb, 0x74); +size -= 0x78; +if (avio_rl32(s->pb) == MKTAG('C','T','R','L') && size > 4) { +ctrl_size = avio_rb32(s->pb); +size -= 4;; +} +} +break; +default: +av_log(s, AV_LOG_DEBUG, "skipping unknown chunk: %X\n", chunk); +break; +} + +avio_skip(s->pb, size); +} + +switch (codec) { +case MKTAG('S','D','X','2'): +st->codec->codec_id= AV_CODEC_ID_SDX2_DPCM; +st->codec->block_align = 1 * st->codec->channels; +break
[FFmpeg-cvslog] avformat: add DC STR demuxer
ffmpeg | branch: master | Paul B Mahol | Wed Oct 28 14:10:01 2015 +0100| [48f0d3accc303e8f173e45d3c6204f050daa8b60] | committer: Paul B Mahol avformat: add DC STR demuxer Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=48f0d3accc303e8f173e45d3c6204f050daa8b60 --- Changelog|2 +- doc/general.texi |1 + libavformat/Makefile |1 + libavformat/allformats.c |1 + libavformat/dcstr.c | 81 ++ libavformat/version.h|2 +- 6 files changed, 86 insertions(+), 2 deletions(-) diff --git a/Changelog b/Changelog index d320317..c49e383 100644 --- a/Changelog +++ b/Changelog @@ -20,7 +20,7 @@ version : - selectivecolor filter - extensive native AAC encoder improvements - ADPCM PSX decoder -- 3dostr, genh, vag, xvag, ads, msf & svag demuxer +- 3dostr, dcstr, genh, vag, xvag, ads, msf & svag demuxer - zscale filter - wve demuxer - zero-copy Intel QSV transcoding in ffmpeg diff --git a/doc/general.texi b/doc/general.texi index 0a2c577..34b2011 100644 --- a/doc/general.texi +++ b/doc/general.texi @@ -299,6 +299,7 @@ library: @tab Audio format used in some games by CRYO Interactive Entertainment. @item D-Cinema audio@tab X @tab X @item Deluxe Paint Animation@tab @tab X +@item DCSTR @tab @tab X @item DFA @tab @tab X @tab This format is used in Chronomaster game @item DirectDraw Surface@tab @tab X diff --git a/libavformat/Makefile b/libavformat/Makefile index c3d9e18..27aefcb 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -127,6 +127,7 @@ OBJS-$(CONFIG_DATA_MUXER)+= rawdec.o OBJS-$(CONFIG_DASH_MUXER)+= dashenc.o isom.o OBJS-$(CONFIG_DAUD_DEMUXER) += dauddec.o OBJS-$(CONFIG_DAUD_MUXER)+= daudenc.o +OBJS-$(CONFIG_DCSTR_DEMUXER) += dcstr.o OBJS-$(CONFIG_DFA_DEMUXER) += dfa.o OBJS-$(CONFIG_DIRAC_DEMUXER) += diracdec.o rawdec.o OBJS-$(CONFIG_DIRAC_MUXER) += rawenc.o diff --git a/libavformat/allformats.c b/libavformat/allformats.c index a67a226..fc42cb7 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -109,6 +109,7 @@ void av_register_all(void) REGISTER_MUXER (DASH, dash); REGISTER_MUXDEMUX(DATA, data); REGISTER_MUXDEMUX(DAUD, daud); +REGISTER_DEMUXER (DCSTR,dcstr); REGISTER_DEMUXER (DFA, dfa); REGISTER_MUXDEMUX(DIRAC,dirac); REGISTER_MUXDEMUX(DNXHD,dnxhd); diff --git a/libavformat/dcstr.c b/libavformat/dcstr.c new file mode 100644 index 000..2ae61de --- /dev/null +++ b/libavformat/dcstr.c @@ -0,0 +1,81 @@ +/* + * DC STR demuxer + * Copyright (c) 2015 Paul B Mahol + * + * 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 "avformat.h" +#include "internal.h" + +static int dcstr_probe(AVProbeData *p) +{ +if (p->buf_size < 224 || memcmp(p->buf + 213, "Sega Stream", 11)) +return 0; + +return AVPROBE_SCORE_MAX; +} + +static int dcstr_read_header(AVFormatContext *s) +{ +unsigned codec, align; +AVStream *st; + +st = avformat_new_stream(s, NULL); +if (!st) +return AVERROR(ENOMEM); + +st->codec->codec_type = AVMEDIA_TYPE_AUDIO; +st->codec->channels= avio_rl32(s->pb); +st->codec->sample_rate = avio_rl32(s->pb); +codec = avio_rl32(s->pb); +align = avio_rl32(s->pb); +avio_skip(s->pb, 4); +st->duration = avio_rl32(s->pb); +st->codec->channels *= avio_rl32(s->pb); +if (!align || align > INT_MAX / st->codec->channels) +return AVERROR_INVALIDDATA; +st->codec->block_align = align * st->codec->channels; + +switch (codec) { +case 4: st->codec->codec_id = AV_CODEC_ID_ADPCM_AICA; break; +case 16: st->codec->codec_id = AV_CODEC_ID_PCM_S16LE_PLANAR; break; +default: avpriv_request_sample(s, "codec %X", codec); + return AVERROR_PATCHWELCOME; +} + +avio_skip(s->pb, 0x800 - avio_tell(s->pb)); +avpriv_set_pts_info(st, 64, 1, st->codec->sampl
[FFmpeg-cvslog] doc/general.texi: move Screenpresso to right section
ffmpeg | branch: master | Paul B Mahol | Thu Oct 29 21:20:09 2015 +0100| [09ef1f5923afde497bff5120bd7a2ef477425fc0] | committer: Paul B Mahol doc/general.texi: move Screenpresso to right section Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=09ef1f5923afde497bff5120bd7a2ef477425fc0 --- doc/general.texi |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/general.texi b/doc/general.texi index 34b2011..b08d64f 100644 --- a/doc/general.texi +++ b/doc/general.texi @@ -483,7 +483,6 @@ library: @item RTSP @tab X @tab X @item SAP @tab X @tab X @item SBG @tab @tab X -@item Screenpresso @tab @tab X @item SDP @tab @tab X @item Sega FILM/CPK @tab @tab X @tab Used in many Sega Saturn console games. @@ -816,6 +815,7 @@ following image formats are supported: @tab Texture dictionaries used by the Renderware Engine. @item RL2 video @tab @tab X @tab used in some games by Entertainment Software Partners +@item Screenpresso @tab @tab X @item Sierra VMD video @tab @tab X @tab Used in Sierra VMD files. @item Silicon Graphics Motion Video Compressor 1 (MVC1) @tab @tab X ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] doc/general.texi: fix SDX2 description
ffmpeg | branch: master | Paul B Mahol | Thu Oct 29 21:29:47 2015 +0100| [863c9189eeede608a75cf2875bdd684a19a7b0c2] | committer: Paul B Mahol doc/general.texi: fix SDX2 description Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=863c9189eeede608a75cf2875bdd684a19a7b0c2 --- doc/general.texi |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/general.texi b/doc/general.texi index b08d64f..e51771a 100644 --- a/doc/general.texi +++ b/doc/general.texi @@ -963,7 +963,7 @@ following image formats are supported: @tab Used in Quake III, Jedi Knight 2 and other computer games. @item DPCM Interplay @tab @tab X @tab Used in various Interplay computer games. -@item DPCM Squareroot-Delta-Exact +@item DPCM Squareroot-Delta-Exact @tab @tab X @tab Used in various games. @item DPCM Sierra Online @tab @tab X @tab Used in Sierra Online game audio files. ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/nellymoserenc: use log2 instead of log()/M_LN2
ffmpeg | branch: master | Ganesh Ajjanagadde | Thu Oct 29 00:06:00 2015 -0400| [68ba63ebd5fa4e42423def1d8b0d38b5b8593e7f] | committer: Ganesh Ajjanagadde avcodec/nellymoserenc: use log2 instead of log()/M_LN2 This is likely more precise and conveys the intent better. Reviewed-by: Michael Niedermayer Signed-off-by: Ganesh Ajjanagadde > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=68ba63ebd5fa4e42423def1d8b0d38b5b8593e7f --- libavcodec/nellymoserenc.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/nellymoserenc.c b/libavcodec/nellymoserenc.c index d7368d0..d998dba 100644 --- a/libavcodec/nellymoserenc.c +++ b/libavcodec/nellymoserenc.c @@ -318,7 +318,7 @@ static void encode_block(NellyMoserEncodeContext *s, unsigned char *output, int + s->mdct_out[i + NELLY_BUF_LEN] * s->mdct_out[i + NELLY_BUF_LEN]; } cand[band] = -log(FFMAX(1.0, coeff_sum / (ff_nelly_band_sizes_table[band] << 7))) * 1024.0 / M_LN2; +log2(FFMAX(1.0, coeff_sum / (ff_nelly_band_sizes_table[band] << 7))) * 1024.0; } if (s->avctx->trellis) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/snowenc: use log2 instead of log() / log(2...)
ffmpeg | branch: master | Ganesh Ajjanagadde | Thu Oct 29 00:08:32 2015 -0400| [4870d8518a9270639983da216797d02fc6c445b5] | committer: Ganesh Ajjanagadde avcodec/snowenc: use log2 instead of log() / log(2...) This is likely more precise and conveys the intent better. The expression has also been accordingly simplified. Reviewed-by: Michael Niedermayer Signed-off-by: Ganesh Ajjanagadde > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4870d8518a9270639983da216797d02fc6c445b5 --- libavcodec/snowenc.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c index 7e8269c..fb0cd3f 100644 --- a/libavcodec/snowenc.c +++ b/libavcodec/snowenc.c @@ -1547,7 +1547,7 @@ static void calculate_visual_weight(SnowContext *s, Plane *p){ } } -b->qlog= (int)(log(352256.0/sqrt(error)) / log(pow(2.0, 1.0/QROOT))+0.5); +b->qlog= (int)(QROOT * log2(352256.0/sqrt(error)) + 0.5); } } } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/zmbvenc: use log2 instead of log()/M_LN2
ffmpeg | branch: master | Ganesh Ajjanagadde | Thu Oct 29 00:10:45 2015 -0400| [603d62745710220f9ecd97f4d0cc6831394ebcd3] | committer: Ganesh Ajjanagadde avcodec/zmbvenc: use log2 instead of log()/M_LN2 This is likely more precise and conveys the intent better. Reviewed-by: Michael Niedermayer Signed-off-by: Ganesh Ajjanagadde > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=603d62745710220f9ecd97f4d0cc6831394ebcd3 --- libavcodec/zmbvenc.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/zmbvenc.c b/libavcodec/zmbvenc.c index df06e37..e832bed 100644 --- a/libavcodec/zmbvenc.c +++ b/libavcodec/zmbvenc.c @@ -277,7 +277,7 @@ static av_cold int encode_init(AVCodecContext *avctx) int lvl = 9; for(i=1; i<256; i++) -score_tab[i]= -i * log(i/(double)(ZMBV_BLOCK*ZMBV_BLOCK)) * (256/M_LN2); +score_tab[i]= -i * log2(i/(double)(ZMBV_BLOCK*ZMBV_BLOCK)) * 256; c->avctx = avctx; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/af_volume: use log10 instead of log()/M_LN10
ffmpeg | branch: master | Ganesh Ajjanagadde | Thu Oct 29 00:11:44 2015 -0400| [4d0d85c94ad9fe943e12b8db5fe4ed9df170c12c] | committer: Ganesh Ajjanagadde avfilter/af_volume: use log10 instead of log()/M_LN10 This is likely more precise and conveys the intent better. Reviewed-by: Michael Niedermayer Signed-off-by: Ganesh Ajjanagadde > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4d0d85c94ad9fe943e12b8db5fe4ed9df170c12c --- libavfilter/af_volume.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/af_volume.c b/libavfilter/af_volume.c index 16e994c..3ba356a 100644 --- a/libavfilter/af_volume.c +++ b/libavfilter/af_volume.c @@ -279,7 +279,7 @@ static int set_volume(AVFilterContext *ctx) av_log(ctx, AV_LOG_VERBOSE, "volume_i:%d/255 ", vol->volume_i); } av_log(ctx, AV_LOG_VERBOSE, "volume:%f volume_dB:%f\n", - vol->volume, 20.0*log(vol->volume)/M_LN10); + vol->volume, 20.0*log10(vol->volume)); volume_init(vol); return 0; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat: stop exporting ffurl_read_complete, ffurl_seek and ffurl_size
ffmpeg | branch: master | Andreas Cadhalpun | Tue Oct 27 21:29:47 2015 +0100| [41455dca60c4ad2b99c43482bc4bd26ed8493bac] | committer: Andreas Cadhalpun avformat: stop exporting ffurl_read_complete, ffurl_seek and ffurl_size They are not in public headers and not used outside of libavformat. Reviewed-by: Hendrik Leppkes Signed-off-by: Andreas Cadhalpun > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=41455dca60c4ad2b99c43482bc4bd26ed8493bac --- libavformat/libavformat.v |3 --- 1 file changed, 3 deletions(-) diff --git a/libavformat/libavformat.v b/libavformat/libavformat.v index e90aef7..a00a309 100644 --- a/libavformat/libavformat.v +++ b/libavformat/libavformat.v @@ -10,9 +10,6 @@ LIBAVFORMAT_$MAJOR { ffio_set_buf_size; ffurl_close; ffurl_open; -ffurl_read_complete; -ffurl_seek; -ffurl_size; ffurl_write; #those are deprecated, remove on next bump url_feof; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] swscale: rename sws_context_class to ff_sws_context_class
ffmpeg | branch: master | Andreas Cadhalpun | Tue Oct 27 22:56:53 2015 +0100| [8bfbc8c5e504ef3ae914499646d450987b419385] | committer: Andreas Cadhalpun swscale: rename sws_context_class to ff_sws_context_class It is an internal swscale symbol and thus should not be exported. Reviewed-by: Michael Niedermayer Signed-off-by: Andreas Cadhalpun > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8bfbc8c5e504ef3ae914499646d450987b419385 --- libswscale/options.c |4 ++-- libswscale/swscale_internal.h |2 +- libswscale/utils.c|2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libswscale/options.c b/libswscale/options.c index cf793ef..e666e5a 100644 --- a/libswscale/options.c +++ b/libswscale/options.c @@ -84,7 +84,7 @@ static const AVOption swscale_options[] = { { NULL } }; -const AVClass sws_context_class = { +const AVClass ff_sws_context_class = { .class_name = "SWScaler", .item_name = sws_context_to_name, .option = swscale_options, @@ -94,5 +94,5 @@ const AVClass sws_context_class = { const AVClass *sws_get_class(void) { -return &sws_context_class; +return &ff_sws_context_class; } diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index 27a40af..a53fdc4 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -866,7 +866,7 @@ extern const uint8_t ff_dither_8x8_220[9][8]; extern const int32_t ff_yuv2rgb_coeffs[8][4]; -extern const AVClass sws_context_class; +extern const AVClass ff_sws_context_class; /** * Set c->swscale to an unscaled converter if one exists for the specific diff --git a/libswscale/utils.c b/libswscale/utils.c index 651b07a..037683c 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -1030,7 +1030,7 @@ SwsContext *sws_alloc_context(void) av_assert0(offsetof(SwsContext, redDither) + DITHER32_INT == offsetof(SwsContext, dither32)); if (c) { -c->av_class = &sws_context_class; +c->av_class = &ff_sws_context_class; av_opt_set_defaults(c); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] swscale: rename sws_rgb2rgb_init to ff_sws_rgb2rgb_init
ffmpeg | branch: master | Andreas Cadhalpun | Tue Oct 27 22:56:56 2015 +0100| [e8c37160640952ab036e643156add9638c062536] | committer: Andreas Cadhalpun swscale: rename sws_rgb2rgb_init to ff_sws_rgb2rgb_init It is an internal swscale function and thus should not be exported. Reviewed-by: Michael Niedermayer Signed-off-by: Andreas Cadhalpun > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e8c37160640952ab036e643156add9638c062536 --- libswscale/colorspace-test.c |2 +- libswscale/rgb2rgb.c |2 +- libswscale/rgb2rgb.h |2 +- libswscale/utils.c |2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libswscale/colorspace-test.c b/libswscale/colorspace-test.c index 42a915b..f6e0c92 100644 --- a/libswscale/colorspace-test.c +++ b/libswscale/colorspace-test.c @@ -45,7 +45,7 @@ int main(int argc, char **argv) return -1; av_log(NULL, AV_LOG_INFO, "memory corruption test ...\n"); -sws_rgb2rgb_init(); +ff_sws_rgb2rgb_init(); for (funcNum = 0; ; funcNum++) { struct func_info_s { diff --git a/libswscale/rgb2rgb.c b/libswscale/rgb2rgb.c index 340174f..f7f8188 100644 --- a/libswscale/rgb2rgb.c +++ b/libswscale/rgb2rgb.c @@ -130,7 +130,7 @@ void (*yuyvtoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, * 32-bit C version, and and&add trick by Michael Niedermayer */ -av_cold void sws_rgb2rgb_init(void) +av_cold void ff_sws_rgb2rgb_init(void) { rgb2rgb_init_c(); if (ARCH_X86) diff --git a/libswscale/rgb2rgb.h b/libswscale/rgb2rgb.h index 8faebe6..0645404 100644 --- a/libswscale/rgb2rgb.h +++ b/libswscale/rgb2rgb.h @@ -164,7 +164,7 @@ extern void (*yuyvtoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const u int width, int height, int lumStride, int chromStride, int srcStride); -void sws_rgb2rgb_init(void); +void ff_sws_rgb2rgb_init(void); void rgb2rgb_init_x86(void); diff --git a/libswscale/utils.c b/libswscale/utils.c index 037683c..a3fa25a 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -1127,7 +1127,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, flags = c->flags; emms_c(); if (!rgb15to16) -sws_rgb2rgb_init(); +ff_sws_rgb2rgb_init(); unscaled = (srcW == dstW && srcH == dstH); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/vf_psnr: use log10 instead of log()/log(10)
ffmpeg | branch: master | Ganesh Ajjanagadde | Thu Oct 29 00:16:34 2015 -0400| [59d37f5a4e7014ee0e44af051f092fff9917399b] | committer: Ganesh Ajjanagadde avfilter/vf_psnr: use log10 instead of log()/log(10) This is likely more precise and conveys the intent better. Reviewed-by: Michael Niedermayer Signed-off-by: Ganesh Ajjanagadde > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=59d37f5a4e7014ee0e44af051f092fff9917399b --- libavfilter/vf_psnr.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/vf_psnr.c b/libavfilter/vf_psnr.c index 36bbab2..bce5c51 100644 --- a/libavfilter/vf_psnr.c +++ b/libavfilter/vf_psnr.c @@ -72,7 +72,7 @@ static inline unsigned pow2(unsigned base) static inline double get_psnr(double mse, uint64_t nb_frames, int max) { -return 10.0 * log(pow2(max) / (mse / nb_frames)) / log(10.0); +return 10.0 * log10(pow2(max) / (mse / nb_frames)); } static uint64_t sse_line_8bit(const uint8_t *main_line, const uint8_t *ref_line, int outw) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/avf_showspectrum: use log10 instead of log()/...
ffmpeg | branch: master | Ganesh Ajjanagadde | Thu Oct 29 00:14:39 2015 -0400| [ec66bcc0e75ca839e82f3c87ebfa7cd90bc1c089] | committer: Ganesh Ajjanagadde avfilter/avf_showspectrum: use log10 instead of log()/... This is likely more precise and conveys the intent better. Reviewed-by: Michael Niedermayer Signed-off-by: Ganesh Ajjanagadde > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ec66bcc0e75ca839e82f3c87ebfa7cd90bc1c089 --- libavfilter/avf_showspectrum.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/avf_showspectrum.c b/libavfilter/avf_showspectrum.c index 936db60..7d5c438 100644 --- a/libavfilter/avf_showspectrum.c +++ b/libavfilter/avf_showspectrum.c @@ -386,7 +386,7 @@ static int plot_spectrum_column(AVFilterLink *inlink, AVFrame *insamples) a = cbrt(a); break; case LOG: -a = 1 - log(FFMAX(FFMIN(1, a), 1e-6)) / log(1e-6); // zero = -120dBFS +a = 1 + log10(FFMAX(FFMIN(1, a), 1e-6)) / 6; // zero = -120dBFS break; default: av_assert0(0); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/vf_ssim: use log10 instead of log()/log(10)
ffmpeg | branch: master | Ganesh Ajjanagadde | Thu Oct 29 00:17:19 2015 -0400| [b8e19808071c87c271896685d3c5038a6c469f5b] | committer: Ganesh Ajjanagadde avfilter/vf_ssim: use log10 instead of log()/log(10) This is likely more precise and conveys the intent better. Reviewed-by: Michael Niedermayer Signed-off-by: Ganesh Ajjanagadde > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b8e19808071c87c271896685d3c5038a6c469f5b --- libavfilter/vf_ssim.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/vf_ssim.c b/libavfilter/vf_ssim.c index ce1e3db..7c43e98 100644 --- a/libavfilter/vf_ssim.c +++ b/libavfilter/vf_ssim.c @@ -176,7 +176,7 @@ static float ssim_plane(SSIMDSPContext *dsp, static double ssim_db(double ssim, double weight) { -return 10 * (log(weight) / log(10) - log(weight - ssim) / log(10)); +return 10 * log10(weight / (weight - ssim)); } static AVFrame *do_ssim(AVFilterContext *ctx, AVFrame *main, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] ffmpeg: use log10 instead of log()/log(10)
ffmpeg | branch: master | Ganesh Ajjanagadde | Thu Oct 29 00:01:43 2015 -0400| [b45daad2aa34d17e225e6449fd8cdaeba02ec2be] | committer: Ganesh Ajjanagadde ffmpeg: use log10 instead of log()/log(10) This is more concise and conveys the intent better. Furthermore, it is likely more precise as well due to lack of floating point division. Reviewed-by: Michael Niedermayer Signed-off-by: Ganesh Ajjanagadde > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b45daad2aa34d17e225e6449fd8cdaeba02ec2be --- ffmpeg.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ffmpeg.c b/ffmpeg.c index afe1cb7..f8b071a 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -1244,7 +1244,7 @@ static void do_video_out(AVFormatContext *s, static double psnr(double d) { -return -10.0 * log(d) / log(10.0); +return -10.0 * log10(d); } static void do_video_stats(OutputStream *ost, int frame_size) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/avf_showvolume: use log10 instead of log()/M_LN10
ffmpeg | branch: master | Ganesh Ajjanagadde | Thu Oct 29 00:15:25 2015 -0400| [0fe5dcd66041183c2ada3847b968c425f104b0c5] | committer: Ganesh Ajjanagadde avfilter/avf_showvolume: use log10 instead of log()/M_LN10 This is likely more precise and conveys the intent better. Reviewed-by: Paul B Mahol Signed-off-by: Ganesh Ajjanagadde > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0fe5dcd66041183c2ada3847b968c425f104b0c5 --- libavfilter/avf_showvolume.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/avf_showvolume.c b/libavfilter/avf_showvolume.c index 95b5388..395375a 100644 --- a/libavfilter/avf_showvolume.c +++ b/libavfilter/avf_showvolume.c @@ -197,7 +197,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples) max = FFMAX(max, src[i]); max = av_clipf(max, 0, 1); -values[VAR_VOLUME] = 20.0 * log(max) / M_LN10; +values[VAR_VOLUME] = 20.0 * log10(max); values[VAR_CHANNEL] = c; color = av_expr_eval(s->c_expr, values, NULL); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avutil/mathematics: make av_gcd more robust
ffmpeg | branch: master | Ganesh Ajjanagadde | Wed Oct 28 22:02:25 2015 -0400| [b7fb7c4542af63fea433a5417e4efe2d8c4422f6] | committer: Ganesh Ajjanagadde avutil/mathematics: make av_gcd more robust This ensures that no undefined behavior is invoked, while retaining identical return values in all cases and at no loss of performance (identical asm on clang and gcc). Essentially, this patch exchanges undefined behavior with implementation defined behavior, a strict improvement. Rationale: 1. The ideal solution is to have the return type a uint64_t. This unfortunately requires an API change. 2. The only pathological behavior happens if both arguments are INT64_MIN, to the best of my knowledge. In such a case, the implementation defined behavior is invoked in the sense that UINT64_MAX is interpreted as INT64_MIN, which any reasonable implementation will do. In any case, any usage where both arguments are INT64_MIN is a fuzzer anyway. 3. Alternatives of checking, etc require branching and lose performance for no concrete gain - no client cares about av_gcd's actual value when both args are INT64_MIN. Even if it did, on sane platforms (e.g all the ones FFmpeg cares about), it produces a correct gcd, namely INT64_MIN. Reviewed-by: Michael Niedermayer Signed-off-by: Ganesh Ajjanagadde > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b7fb7c4542af63fea433a5417e4efe2d8c4422f6 --- libavutil/mathematics.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/mathematics.c b/libavutil/mathematics.c index 16e4eba..fde460c 100644 --- a/libavutil/mathematics.c +++ b/libavutil/mathematics.c @@ -52,7 +52,7 @@ int64_t av_gcd(int64_t a, int64_t b) { v -= u; v >>= ff_ctzll(v); } -return u << k; +return (uint64_t)u << k; } int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding rnd) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavc/cdg: Add transparency support.
ffmpeg | branch: master | Carl Eugen Hoyos | Fri Oct 30 01:24:50 2015 +0100| [2f1d6d45af42fc8bfa4d13afef08ad9465d216cc] | committer: Carl Eugen Hoyos lavc/cdg: Add transparency support. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2f1d6d45af42fc8bfa4d13afef08ad9465d216cc --- libavcodec/cdgraphics.c |8 + libavcodec/version.h |2 +- tests/fate/video.mak |2 +- tests/ref/fate/cdgraphics | 424 ++--- 4 files changed, 222 insertions(+), 214 deletions(-) diff --git a/libavcodec/cdgraphics.c b/libavcodec/cdgraphics.c index aca7cb0..87ad5e7 100644 --- a/libavcodec/cdgraphics.c +++ b/libavcodec/cdgraphics.c @@ -49,6 +49,7 @@ #define CDG_INST_TILE_BLOCK6 #define CDG_INST_SCROLL_PRESET20 #define CDG_INST_SCROLL_COPY 24 +#define CDG_INST_TRANSPARENT_COL 28 #define CDG_INST_LOAD_PAL_LO 30 #define CDG_INST_LOAD_PAL_HIGH31 #define CDG_INST_TILE_BLOCK_XOR 38 @@ -67,6 +68,7 @@ typedef struct CDGraphicsContext { AVFrame *frame; int hscroll; int vscroll; +int transparency; } CDGraphicsContext; static av_cold int cdg_decode_init(AVCodecContext *avctx) @@ -76,6 +78,7 @@ static av_cold int cdg_decode_init(AVCodecContext *avctx) cc->frame = av_frame_alloc(); if (!cc->frame) return AVERROR(ENOMEM); +cc->transparency = -1; avctx->width = CDG_FULL_WIDTH; avctx->height = CDG_FULL_HEIGHT; @@ -120,6 +123,8 @@ static void cdg_load_palette(CDGraphicsContext *cc, uint8_t *data, int low) g = ((color >> 4) & 0x000F) * 17; b = ((color ) & 0x000F) * 17; palette[i + array_offset] = 0xFFU << 24 | r << 16 | g << 8 | b; +if (cc->transparency >= 0) +palette[cc->transparency] &= 0xFF; } cc->frame->palette_has_changed = 1; } @@ -341,6 +346,9 @@ static int cdg_decode_frame(AVCodecContext *avctx, if (ret < 0) return ret; break; +case CDG_INST_TRANSPARENT_COL: +cc->transparency = cdg_data[0] & 0xF; +break; default: break; } diff --git a/libavcodec/version.h b/libavcodec/version.h index f7e2857..71e0703 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -30,7 +30,7 @@ #define LIBAVCODEC_VERSION_MAJOR 57 #define LIBAVCODEC_VERSION_MINOR 13 -#define LIBAVCODEC_VERSION_MICRO 100 +#define LIBAVCODEC_VERSION_MICRO 101 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ diff --git a/tests/fate/video.mak b/tests/fate/video.mak index d128c75..8b70b08 100644 --- a/tests/fate/video.mak +++ b/tests/fate/video.mak @@ -85,7 +85,7 @@ FATE_VIDEO-$(call DEMDEC, MPEGPS, CAVS) += fate-cavs fate-cavs: CMD = framecrc -i $(TARGET_SAMPLES)/cavs/cavs.mpg -an FATE_VIDEO-$(call DEMDEC, CDG, CDGRAPHICS) += fate-cdgraphics -fate-cdgraphics: CMD = framecrc -i $(TARGET_SAMPLES)/cdgraphics/BrotherJohn.cdg -pix_fmt rgb24 -t 1 +fate-cdgraphics: CMD = framecrc -i $(TARGET_SAMPLES)/cdgraphics/BrotherJohn.cdg -pix_fmt rgba -t 1 FATE_VIDEO-$(call DEMDEC, AVI, CLJR) += fate-cljr fate-cljr: CMD = framecrc -i $(TARGET_SAMPLES)/cljr/testcljr-partial.avi diff --git a/tests/ref/fate/cdgraphics b/tests/ref/fate/cdgraphics index a782059..ee02f5d 100644 --- a/tests/ref/fate/cdgraphics +++ b/tests/ref/fate/cdgraphics @@ -1,213 +1,213 @@ #tb 0: 1/300 -0, 0, 0,1, 194400, 0x46ad80da -0, 1, 1,1, 194400, 0x46ad80da -0, 2, 2,1, 194400, 0x9392c3b9 -0, 3, 3,1, 194400, 0x9392c3b9 -0, 4, 4,1, 194400, 0x9392c3b9 -0, 5, 5,1, 194400, 0x9392c3b9 -0, 6, 6,1, 194400, 0x9392c3b9 -0, 7, 7,1, 194400, 0x9392c3b9 -0, 8, 8,1, 194400, 0x9392c3b9 -0, 9, 9,1, 194400, 0x9392c3b9 -0, 10, 10,1, 194400, 0x9392c3b9 -0, 11, 11,1, 194400, 0x9392c3b9 -0, 12, 12,1, 194400, 0x9392c3b9 -0, 13, 13,1, 194400, 0x9392c3b9 -0, 14, 14,1, 194400, 0x9392c3b9 -0, 15, 15,1, 194400, 0x9392c3b9 -0, 16, 16,1, 194400, 0x46ad80da -0, 17, 17,1, 194400, 0x46ad80da -0, 18, 18,1, 194400, 0x46ad80da -0, 19, 19,1, 194400, 0x46ad80da -0, 20, 20,1, 194400, 0x46ad80da -0, 21, 21,1, 194400, 0x46ad80da -0, 22, 22,1, 194400, 0x46ad80da -0, 23, 23,1, 194400, 0x46ad80da -0, 24, 24,1, 194400, 0x46ad80da -0, 25,
[FFmpeg-cvslog] lavc/proresdec2: Fix slice_count for very high resolutions.
ffmpeg | branch: master | Carl Eugen Hoyos | Fri Oct 30 01:32:39 2015 +0100| [bd1d67efe830efcdb21af751e9bfd7ef8da42590] | committer: Carl Eugen Hoyos lavc/proresdec2: Fix slice_count for very high resolutions. QT ignores the value written in the frame header. Issue reported by forum user Koracas. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bd1d67efe830efcdb21af751e9bfd7ef8da42590 --- libavcodec/proresdec2.c |5 - libavcodec/version.h|2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libavcodec/proresdec2.c b/libavcodec/proresdec2.c index 932f85f..2d47a13 100644 --- a/libavcodec/proresdec2.c +++ b/libavcodec/proresdec2.c @@ -180,7 +180,10 @@ static int decode_picture_header(AVCodecContext *avctx, const uint8_t *buf, cons else ctx->mb_height = (avctx->height + 15) >> 4; -slice_count = AV_RB16(buf + 5); +// QT ignores the written value +// slice_count = AV_RB16(buf + 5); +slice_count = ctx->mb_height * ((ctx->mb_width >> log2_slice_mb_width) + +av_popcount(ctx->mb_width & (1 << log2_slice_mb_width) - 1)); if (ctx->slice_count != slice_count || !ctx->slices) { av_freep(&ctx->slices); diff --git a/libavcodec/version.h b/libavcodec/version.h index 71e0703..02c2a08 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -30,7 +30,7 @@ #define LIBAVCODEC_VERSION_MAJOR 57 #define LIBAVCODEC_VERSION_MINOR 13 -#define LIBAVCODEC_VERSION_MICRO 101 +#define LIBAVCODEC_VERSION_MICRO 102 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/oggparseogm: Enable parser for mpeg4
ffmpeg | branch: master | Michael Niedermayer | Fri Oct 30 00:31:13 2015 +0100| [a7af002b5f4c71590ce2536132b40e8cdc0cac7e] | committer: Michael Niedermayer avformat/oggparseogm: Enable parser for mpeg4 Fixes regression with iJi.ogv Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a7af002b5f4c71590ce2536132b40e8cdc0cac7e --- libavformat/oggparseogm.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/oggparseogm.c b/libavformat/oggparseogm.c index ae8c3c8..d63c83b 100644 --- a/libavformat/oggparseogm.c +++ b/libavformat/oggparseogm.c @@ -57,6 +57,8 @@ ogm_header(AVFormatContext *s, int idx) tag = bytestream2_get_le32(&p); st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, tag); st->codec->codec_tag = tag; +if (st->codec->codec_id == AV_CODEC_ID_MPEG4) +st->need_parsing = AVSTREAM_PARSE_HEADERS; } else if (bytestream2_peek_byte(&p) == 't') { st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE; st->codec->codec_id = AV_CODEC_ID_TEXT; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] vf_lut: Add support for RGB48 and RGBA64.
ffmpeg | branch: master | Steven Robertson | Sat Oct 10 18:27:17 2015 -0700| [b38e685c053786bc20743cc6b3e54e6ae1fe957b] | committer: Michael Niedermayer vf_lut: Add support for RGB48 and RGBA64. Signed-off-by: Steven Robertson Reviewed-by: Paul B Mahol Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b38e685c053786bc20743cc6b3e54e6ae1fe957b --- libavfilter/vf_lut.c | 50 +++-- tests/ref/fate/filter-pixfmts-lut |2 ++ 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/libavfilter/vf_lut.c b/libavfilter/vf_lut.c index f0a2aba..38a25fe 100644 --- a/libavfilter/vf_lut.c +++ b/libavfilter/vf_lut.c @@ -125,7 +125,8 @@ static av_cold void uninit(AVFilterContext *ctx) #define RGB_FORMATS \ AV_PIX_FMT_ARGB, AV_PIX_FMT_RGBA, \ AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA, \ -AV_PIX_FMT_RGB24,AV_PIX_FMT_BGR24 +AV_PIX_FMT_RGB24,AV_PIX_FMT_BGR24,\ +AV_PIX_FMT_RGB48LE, AV_PIX_FMT_RGBA64LE static const enum AVPixelFormat yuv_pix_fmts[] = { YUV_FORMATS, AV_PIX_FMT_NONE }; static const enum AVPixelFormat rgb_pix_fmts[] = { RGB_FORMATS, AV_PIX_FMT_NONE }; @@ -260,6 +261,11 @@ static int config_props(AVFilterLink *inlink) max[V] = 240 * (1 << (desc->comp[2].depth - 8)); max[A] = (1 << desc->comp[3].depth) - 1; break; +case AV_PIX_FMT_RGB48LE: +case AV_PIX_FMT_RGBA64LE: +min[0] = min[1] = min[2] = min[3] = 0; +max[0] = max[1] = max[2] = max[3] = 65535; +break; default: min[0] = min[1] = min[2] = min[3] = 0; max[0] = max[1] = max[2] = max[3] = 255; @@ -272,6 +278,9 @@ static int config_props(AVFilterLink *inlink) if (s->is_rgb) { ff_fill_rgba_map(rgba_map, inlink->format); s->step = av_get_bits_per_pixel(desc) >> 3; +if (s->is_16bit) { +s->step = s->step >> 1; +} } for (color = 0; color < desc->nb_components; color++) { @@ -336,7 +345,44 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) av_frame_copy_props(out, in); } -if (s->is_rgb) { +if (s->is_rgb && s->is_16bit) { +/* packed, 16-bit */ +uint16_t *inrow, *outrow, *inrow0, *outrow0; +const int w = inlink->w; +const int h = in->height; +const uint16_t (*tab)[256*256] = (const uint16_t (*)[256*256])s->lut; +const int in_linesize = in->linesize[0] / 2; +const int out_linesize = out->linesize[0] / 2; +const int step = s->step; + +inrow0 = (uint16_t*) in ->data[0]; +outrow0 = (uint16_t*) out->data[0]; + +for (i = 0; i < h; i ++) { +inrow = inrow0; +outrow = outrow0; +for (j = 0; j < w; j++) { + +switch (step) { +#if HAVE_BIGENDIAN +case 4: outrow[3] = av_bswap16(tab[3][av_bswap16(inrow[3])]); // Fall-through +case 3: outrow[2] = av_bswap16(tab[2][av_bswap16(inrow[2])]); // Fall-through +case 2: outrow[1] = av_bswap16(tab[1][av_bswap16(inrow[1])]); // Fall-through +default: outrow[0] = av_bswap16(tab[0][av_bswap16(inrow[0])]); +#else +case 4: outrow[3] = tab[3][inrow[3]]; // Fall-through +case 3: outrow[2] = tab[2][inrow[2]]; // Fall-through +case 2: outrow[1] = tab[1][inrow[1]]; // Fall-through +default: outrow[0] = tab[0][inrow[0]]; +#endif +} +outrow += step; +inrow += step; +} +inrow0 += in_linesize; +outrow0 += out_linesize; +} +} else if (s->is_rgb) { /* packed */ uint8_t *inrow, *outrow, *inrow0, *outrow0; const int w = inlink->w; diff --git a/tests/ref/fate/filter-pixfmts-lut b/tests/ref/fate/filter-pixfmts-lut index 150157c..8d50f3e 100644 --- a/tests/ref/fate/filter-pixfmts-lut +++ b/tests/ref/fate/filter-pixfmts-lut @@ -3,7 +3,9 @@ argb4f575be3cd02799389f581df99c4de38 bgr24 fa43e3b2abfde8d9e60e157a9acc553d bgra4e2e689897ee7a8e42b16234597bab35 rgb24 a356171207723a580e7d277078072005 +rgb48le 5c7dd8575836d18c91e09f1915cf9aa9 rgba7bc854c2698b78af3e9159a19c2d9d21 +rgba64le3a087ecab583d1930220592731f282b4 yuv410p 51b39a0e33f108e652457a26667319ea yuv411p 9204c5af92aef4922a05f58c1f6c095e yuv420p 7c43bb0cae8dee633375c89295598508 ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/3dostr: Remove redundant ;
ffmpeg | branch: master | Michael Niedermayer | Fri Oct 30 03:02:41 2015 +0100| [203dc14693c6400a9c24bf4cc4c8a15560f8ba12] | committer: Michael Niedermayer avformat/3dostr: Remove redundant ; Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=203dc14693c6400a9c24bf4cc4c8a15560f8ba12 --- libavformat/3dostr.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/3dostr.c b/libavformat/3dostr.c index ac58a6c..5325a03 100644 --- a/libavformat/3dostr.c +++ b/libavformat/3dostr.c @@ -81,7 +81,7 @@ static int threedostr_read_header(AVFormatContext *s) size -= 0x78; if (avio_rl32(s->pb) == MKTAG('C','T','R','L') && size > 4) { ctrl_size = avio_rb32(s->pb); -size -= 4;; +size -= 4; } } break; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog