[FFmpeg-cvslog] vf_colorspace: Interpret unspecified color range as limited range
ffmpeg | branch: master | Vittorio Giovara | Mon Sep 19 08:26:39 2016 -0400| [cb78d14cf9b5ab59b4a9177f390f5e1abff58644] | committer: Ronald S. Bultje vf_colorspace: Interpret unspecified color range as limited range This is the assumption that is made in pixel format conversion do throughout the code (in particular swscale), and BT-specifications mandate. Add a warning to inform the user that an automatic selection is being made. Signed-off-by: Vittorio Giovara Signed-off-by: Ronald S. Bultje > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cb78d14cf9b5ab59b4a9177f390f5e1abff58644 --- libavfilter/vf_colorspace.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libavfilter/vf_colorspace.c b/libavfilter/vf_colorspace.c index e69be50..c74fe00 100644 --- a/libavfilter/vf_colorspace.c +++ b/libavfilter/vf_colorspace.c @@ -518,10 +518,14 @@ static int convert(AVFilterContext *ctx, void *data, int job_nr, int n_jobs) return 0; } -static int get_range_off(int *off, int *y_rng, int *uv_rng, +static int get_range_off(AVFilterContext *ctx, int *off, + int *y_rng, int *uv_rng, enum AVColorRange rng, int depth) { switch (rng) { +case AVCOL_RANGE_UNSPECIFIED: +av_log(ctx, AV_LOG_WARNING, "Input range not set, assuming tv/mpeg\n"); +// fall-through case AVCOL_RANGE_MPEG: *off = 16 << (depth - 8); *y_rng = 219 << (depth - 8); @@ -740,7 +744,7 @@ static int create_filtergraph(AVFilterContext *ctx, double rgb2yuv[3][3], (*yuv2rgb)[3] = s->yuv2rgb_dbl_coeffs; int off, bits, in_rng; -res = get_range_off(&off, &s->in_y_rng, &s->in_uv_rng, +res = get_range_off(ctx, &off, &s->in_y_rng, &s->in_uv_rng, s->in_rng, in_desc->comp[0].depth); if (res < 0) { av_log(ctx, AV_LOG_ERROR, @@ -773,7 +777,7 @@ static int create_filtergraph(AVFilterContext *ctx, double (*rgb2yuv)[3] = s->rgb2yuv_dbl_coeffs; int off, out_rng, bits; -res = get_range_off(&off, &s->out_y_rng, &s->out_uv_rng, +res = get_range_off(ctx, &off, &s->out_y_rng, &s->out_uv_rng, s->out_rng, out_desc->comp[0].depth); if (res < 0) { av_log(ctx, AV_LOG_ERROR, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] MAINTAINERS: add myself for mlp/truehd
ffmpeg | branch: master | Jai Luthra | Sun Sep 18 11:40:27 2016 +0530| [dfa489be019943aa1f8e43e58a7416561fa11f4d] | committer: Michael Niedermayer MAINTAINERS: add myself for mlp/truehd Signed-off-by: Jai Luthra Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dfa489be019943aa1f8e43e58a7416561fa11f4d --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index f7e8298..f1f991d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -196,7 +196,7 @@ Codecs: mdec.cMichael Niedermayer mimic.c Ramiro Polla mjpeg*.c Michael Niedermayer - mlp* Ramiro Polla + mlp* Ramiro Polla, Jai Luthra mmvideo.c Peter Ross mpeg12.c, mpeg12data.hMichael Niedermayer mpegvideo.c, mpegvideo.h Michael Niedermayer ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/rscc: add support for gray8 format
ffmpeg | branch: master | Paul B Mahol | Mon Sep 19 18:30:31 2016 +0200| [590f025b3dc078a6be58b36c67d87499f62b521c] | committer: Paul B Mahol avcodec/rscc: add support for gray8 format Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=590f025b3dc078a6be58b36c67d87499f62b521c --- libavcodec/rscc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/rscc.c b/libavcodec/rscc.c index d60d946..3b3703c 100644 --- a/libavcodec/rscc.c +++ b/libavcodec/rscc.c @@ -31,7 +31,7 @@ * and it can be deflated or not. Similarly, pixel data comes after the header * and a variable size value, and it can be deflated or just raw. * - * Supports: BGRA, BGR24, RGB555, RGB8 + * Supports: GRAY8, BGRA, BGR24, RGB555, RGB8 */ #include @@ -89,8 +89,8 @@ static av_cold int rscc_init(AVCodecContext *avctx) ctx->component_size = avctx->bits_per_coded_sample / 8; switch (avctx->bits_per_coded_sample) { case 8: -avpriv_report_missing_feature(avctx, "8 bits per pixel"); -return AVERROR_PATCHWELCOME; +avctx->pix_fmt = AV_PIX_FMT_GRAY8; +break; case 16: avctx->pix_fmt = AV_PIX_FMT_RGB555LE; break; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/utils: If using discard frame flag, ignore skip_samples set by the decoder
ffmpeg | branch: master | Sasi Inguva | Sun Sep 18 22:09:03 2016 -0700| [a53201879ca36af6fcc8a0d4bcc1fa6d759b67ec] | committer: Michael Niedermayer avcodec/utils: If using discard frame flag, ignore skip_samples set by the decoder Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a53201879ca36af6fcc8a0d4bcc1fa6d759b67ec --- libavcodec/utils.c | 4 1 file changed, 4 insertions(+) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 4734a70..b0345b6 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -2320,6 +2320,7 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx, uint32_t discard_padding = 0; uint8_t skip_reason = 0; uint8_t discard_reason = 0; +int demuxer_skip_samples = 0; // copy to ensure we do not change avpkt AVPacket tmp = *avpkt; int did_split = av_packet_split_side_data(&tmp); @@ -2327,6 +2328,7 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx, if (ret < 0) goto fail; +demuxer_skip_samples = avctx->internal->skip_samples; avctx->internal->pkt = &tmp; if (HAVE_THREADS && avctx->active_thread_type & FF_THREAD_FRAME) ret = ff_thread_decode_frame(avctx, frame, got_frame_ptr, &tmp); @@ -2353,6 +2355,8 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx, if (frame->flags & AV_FRAME_FLAG_DISCARD) { +// If using discard frame flag, ignore skip_samples set by the decoder. +avctx->internal->skip_samples = demuxer_skip_samples; *got_frame_ptr = 0; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavc: Add a flag in AVPacket to discard packet after decoding. Discard frames after decoding based on the flag.
ffmpeg | branch: master | Sasi Inguva | Thu Sep 15 13:36:16 2016 -0700| [2dbedc20ce2f92e8c76e4284441d881906fabe5d] | committer: Michael Niedermayer lavc: Add a flag in AVPacket to discard packet after decoding. Discard frames after decoding based on the flag. Signed-off-by: Sasi Inguva Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2dbedc20ce2f92e8c76e4284441d881906fabe5d --- libavcodec/avcodec.h | 6 ++ libavcodec/utils.c | 15 ++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 01f9b29..db1061d 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -1621,6 +1621,12 @@ typedef struct AVPacket { } AVPacket; #define AV_PKT_FLAG_KEY 0x0001 ///< The packet contains a keyframe #define AV_PKT_FLAG_CORRUPT 0x0002 ///< The packet content is corrupted +/** + * Flag is used to discard packets which are required to maintain valid + * decoder state but are not required for output and should be dropped + * after decoding. + **/ +#define AV_PKT_FLAG_DISCARD 0x0004 enum AVSideDataParamChangeFlags { AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = 0x0001, diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 0f6d0e7..4734a70 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -784,6 +784,12 @@ int ff_init_buffer_info(AVCodecContext *avctx, AVFrame *frame) } } add_metadata_from_side_data(pkt, frame); + +if (pkt->flags & AV_PKT_FLAG_DISCARD) { +frame->flags |= AV_FRAME_FLAG_DISCARD; +} else { +frame->flags = (frame->flags & ~AV_FRAME_FLAG_DISCARD); +} } else { frame->pkt_pts = AV_NOPTS_VALUE; av_frame_set_pkt_pos (frame, -1); @@ -2247,7 +2253,9 @@ fail: if(ret == tmp.size) ret = avpkt->size; } - +if (picture->flags & AV_FRAME_FLAG_DISCARD) { +*got_picture_ptr = 0; +} if (*got_picture_ptr) { if (!avctx->refcounted_frames) { int err = unrefcount_frame(avci, picture); @@ -2343,6 +2351,11 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx, frame->sample_rate = avctx->sample_rate; } + +if (frame->flags & AV_FRAME_FLAG_DISCARD) { +*got_frame_ptr = 0; +} + side= av_packet_get_side_data(avctx->internal->pkt, AV_PKT_DATA_SKIP_SAMPLES, &side_size); if(side && side_size>=10) { avctx->internal->skip_samples = AV_RL32(side); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avutil/frame: Add a flag to discard frame after decode.
ffmpeg | branch: master | Sasi Inguva | Thu Sep 15 13:36:14 2016 -0700| [3cb400c11a75e6f645e5267831e6398bdb0b084e] | committer: Michael Niedermayer avutil/frame: Add a flag to discard frame after decode. Signed-off-by: Sasi Inguva Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3cb400c11a75e6f645e5267831e6398bdb0b084e --- libavutil/frame.c | 1 + libavutil/frame.h | 4 libavutil/version.h | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libavutil/frame.c b/libavutil/frame.c index 662c20d..3c74931 100644 --- a/libavutil/frame.c +++ b/libavutil/frame.c @@ -114,6 +114,7 @@ static void get_frame_defaults(AVFrame *frame) frame->colorspace = AVCOL_SPC_UNSPECIFIED; frame->color_range = AVCOL_RANGE_UNSPECIFIED; frame->chroma_location = AVCHROMA_LOC_UNSPECIFIED; +frame->flags = 0; } static void free_side_data(AVFrameSideData **ptr_sd) diff --git a/libavutil/frame.h b/libavutil/frame.h index 8a41a86..1e2691e 100644 --- a/libavutil/frame.h +++ b/libavutil/frame.h @@ -396,6 +396,10 @@ typedef struct AVFrame { */ #define AV_FRAME_FLAG_CORRUPT (1 << 0) /** + * A flag to mark the frames which need to be decoded, but shouldn't be output. + */ +#define AV_FRAME_FLAG_DISCARD (1 << 2) +/** * @} */ diff --git a/libavutil/version.h b/libavutil/version.h index 7d32c7b..60b58eb 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -79,7 +79,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 55 -#define LIBAVUTIL_VERSION_MINOR 29 +#define LIBAVUTIL_VERSION_MINOR 30 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/avframe.h: Add a flag in AVIndexEntry to discard frame after decoding.
ffmpeg | branch: master | Sasi Inguva | Thu Sep 15 13:36:15 2016 -0700| [778af68c708ed0807889d40d3e3d514cb6bec702] | committer: Michael Niedermayer avformat/avframe.h: Add a flag in AVIndexEntry to discard frame after decoding. Signed-off-by: Sasi Inguva Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=778af68c708ed0807889d40d3e3d514cb6bec702 --- libavformat/avformat.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 21e505d..ae70cc8 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -814,6 +814,9 @@ typedef struct AVIndexEntry { * is known */ #define AVINDEX_KEYFRAME 0x0001 +#define AVINDEX_DISCARD_FRAME 0x0002/** + * Flag is used to indicate which frame should be discarded after decoding. + */ int flags:2; int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment). int min_distance; /**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. */ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavf/utils: Support av_index_search_timestamp in case of AVIndexEntry with discarded packets.
ffmpeg | branch: master | Sasi Inguva | Thu Sep 15 13:36:18 2016 -0700| [b518d809f16359945eded03c2504641a7f497532] | committer: Michael Niedermayer lavf/utils: Support av_index_search_timestamp in case of AVIndexEntry with discarded packets. Signed-off-by: Sasi Inguva Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b518d809f16359945eded03c2504641a7f497532 --- libavformat/utils.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/libavformat/utils.c b/libavformat/utils.c index d605a96..f043bae 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1937,6 +1937,16 @@ int ff_index_search_timestamp(const AVIndexEntry *entries, int nb_entries, while (b - a > 1) { m = (a + b) >> 1; + +// Search for the next non-discarded packet. +while ((entries[m].flags & AVINDEX_DISCARD_FRAME) && m < b) { +m++; +if (m == b && entries[m].timestamp >= wanted_timestamp) { +m = b - 1; +break; +} +} + timestamp = entries[m].timestamp; if (timestamp >= wanted_timestamp) b = m; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] doc/encoders: minor aac encoder formatting improvements
ffmpeg | branch: master | Moritz Barsnick | Sun Sep 18 23:51:48 2016 +0200| [2c48014ab2bb6613b79e3c0b6f45daa5333018ae] | committer: Rostislav Pehlivanov doc/encoders: minor aac encoder formatting improvements Also corrected a line's level. Signed-off-by: Moritz Barsnick > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2c48014ab2bb6613b79e3c0b6f45daa5333018ae --- doc/encoders.texi | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/doc/encoders.texi b/doc/encoders.texi index 321eb2f..73ebd9c 100644 --- a/doc/encoders.texi +++ b/doc/encoders.texi @@ -61,8 +61,9 @@ Two loop searching (TLS) method. This method first sets quantizers depending on band thresholds and then tries to find an optimal combination by adding or subtracting a specific value from -all quantizers and adjusting some individual quantizer a little. -Will tune itself based on whether aac_is/aac_ms/aac_pns are enabled. +all quantizers and adjusting some individual quantizer a little. Will tune +itself based on whether @option{aac_is}, @option{aac_ms} and @option{aac_pns} +are enabled. This is the default choice for a coder. @item anmr @@ -84,7 +85,7 @@ Not recommended. @end table @item aac_ms -Sets mid/side coding mode. The default value of auto will automatically use +Sets mid/side coding mode. The default value of "auto" will automatically use M/S with bands which will benefit from such coding. Can be forced for all bands using the value "enable", which is mainly useful for debugging or disabled using "disable". @@ -130,19 +131,19 @@ The default, AAC "Low-complexity" profile. Is the most compatible and produces decent quality. @item mpeg2_aac_low -Equivalent to -profile:a aac_low -aac_pns 0. PNS was introduced with the MPEG4 -specifications. +Equivalent to @code{-profile:a aac_low -aac_pns 0}. PNS was introduced with the +MPEG4 specifications. @item aac_ltp -Long term prediction profile, is enabled by and will enable the aac_ltp option. -Introduced in MPEG4. +Long term prediction profile, is enabled by and will enable the @option{aac_ltp} +option. Introduced in MPEG4. @item aac_main -Main-type prediction profile, is enabled by and will enable the aac_pred option. -Introduced in MPEG2. +Main-type prediction profile, is enabled by and will enable the @option{aac_pred} +option. Introduced in MPEG2. -If this option is unspecified it is set to @samp{aac_low}. @end table +If this option is unspecified it is set to @samp{aac_low}. @end table @section ac3 and ac3_fixed ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavc/rscc: Support pal8 in rscc.
ffmpeg | branch: master | Carl Eugen Hoyos | Mon Sep 19 23:26:06 2016 +0200| [11777eb8142117864bff0c8060f17b4089434143] | committer: Carl Eugen Hoyos lavc/rscc: Support pal8 in rscc. Fixes the colours of the sample for ticket #5611. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=11777eb8142117864bff0c8060f17b4089434143 --- libavcodec/rscc.c| 15 +-- libavcodec/version.h | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/libavcodec/rscc.c b/libavcodec/rscc.c index 3b3703c..7f280a9 100644 --- a/libavcodec/rscc.c +++ b/libavcodec/rscc.c @@ -31,7 +31,7 @@ * and it can be deflated or not. Similarly, pixel data comes after the header * and a variable size value, and it can be deflated or just raw. * - * Supports: GRAY8, BGRA, BGR24, RGB555, RGB8 + * Supports: BGRA, BGR24, RGB555, PAL8 */ #include @@ -58,6 +58,7 @@ typedef struct RsccContext { Tile *tiles; unsigned int tiles_size; int component_size; +uint32_t pal[AVPALETTE_COUNT]; /* zlib interaction */ uint8_t *inflated_buf; @@ -89,7 +90,7 @@ static av_cold int rscc_init(AVCodecContext *avctx) ctx->component_size = avctx->bits_per_coded_sample / 8; switch (avctx->bits_per_coded_sample) { case 8: -avctx->pix_fmt = AV_PIX_FMT_GRAY8; +avctx->pix_fmt = AV_PIX_FMT_PAL8; break; case 16: avctx->pix_fmt = AV_PIX_FMT_RGB555LE; @@ -308,6 +309,16 @@ static int rscc_decode_frame(AVCodecContext *avctx, void *data, } else { frame->pict_type = AV_PICTURE_TYPE_P; } +if (avctx->pix_fmt == AV_PIX_FMT_PAL8) { +const uint8_t *pal = av_packet_get_side_data(avpkt, + AV_PKT_DATA_PALETTE, + NULL); +if (pal) { +frame->palette_has_changed = 1; +memcpy(ctx->pal, pal, AVPALETTE_SIZE); +} +memcpy (frame->data[1], ctx->pal, AVPALETTE_SIZE); +} *got_frame = 1; end: diff --git a/libavcodec/version.h b/libavcodec/version.h index ccb2890..9acf081 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -29,7 +29,7 @@ #define LIBAVCODEC_VERSION_MAJOR 57 #define LIBAVCODEC_VERSION_MINOR 57 -#define LIBAVCODEC_VERSION_MICRO 100 +#define LIBAVCODEC_VERSION_MICRO 101 #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