[FFmpeg-cvslog] lavc: add AVS2/IEEE 1857.4 parser
ffmpeg | branch: master | hwren | Fri Jul 27 11:44:59 2018 +0800| [d645e0d6c1f26b5c063093dd9ce0f02b3369cdc2] | committer: Steven Liu lavc: add AVS2/IEEE 1857.4 parser Tested-by: Steven Liu Signed-off-by: hwren Signed-off-by: Steven Liu > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d645e0d6c1f26b5c063093dd9ce0f02b3369cdc2 --- libavcodec/Makefile | 1 + libavcodec/avcodec.h| 1 + libavcodec/codec_desc.c | 7 +++ libavcodec/parsers.c| 1 + libavcodec/version.h| 4 ++-- 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/libavcodec/Makefile b/libavcodec/Makefile index e62603f0dd..c1a7d2f292 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -996,6 +996,7 @@ OBJS-$(CONFIG_AAC_PARSER) += aac_parser.o aac_ac3_parser.o \ mpeg4audio.o OBJS-$(CONFIG_AC3_PARSER) += ac3tab.o aac_ac3_parser.o OBJS-$(CONFIG_ADX_PARSER) += adx_parser.o adx.o +OBJS-$(CONFIG_AVS2_PARSER) += avs2_parser.o OBJS-$(CONFIG_BMP_PARSER) += bmp_parser.o OBJS-$(CONFIG_CAVSVIDEO_PARSER)+= cavs_parser.o OBJS-$(CONFIG_COOK_PARSER) += cook_parser.o diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index f85af3f15d..1266879206 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -409,6 +409,7 @@ enum AVCodecID { AV_CODEC_ID_DXV, AV_CODEC_ID_SCREENPRESSO, AV_CODEC_ID_RSCC, +AV_CODEC_ID_AVS2, AV_CODEC_ID_Y41P = 0x8000, AV_CODEC_ID_AVRP, diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c index a126c974e1..2fe47b 100644 --- a/libavcodec/codec_desc.c +++ b/libavcodec/codec_desc.c @@ -1395,6 +1395,13 @@ static const AVCodecDescriptor codec_descriptors[] = { .props = AV_CODEC_PROP_LOSSLESS, }, { +.id= AV_CODEC_ID_AVS2, +.type = AVMEDIA_TYPE_VIDEO, +.name = "avs2", +.long_name = NULL_IF_CONFIG_SMALL("AVS2/IEEE 1857.4"), +.props = AV_CODEC_PROP_LOSSY, +}, +{ .id= AV_CODEC_ID_Y41P, .type = AVMEDIA_TYPE_VIDEO, .name = "y41p", diff --git a/libavcodec/parsers.c b/libavcodec/parsers.c index f2886ff45f..cb86cceecc 100644 --- a/libavcodec/parsers.c +++ b/libavcodec/parsers.c @@ -26,6 +26,7 @@ extern AVCodecParser ff_aac_parser; extern AVCodecParser ff_aac_latm_parser; extern AVCodecParser ff_ac3_parser; extern AVCodecParser ff_adx_parser; +extern AVCodecParser ff_avs2_parser; extern AVCodecParser ff_bmp_parser; extern AVCodecParser ff_cavsvideo_parser; extern AVCodecParser ff_cook_parser; diff --git a/libavcodec/version.h b/libavcodec/version.h index 72e70945f7..3f0d98efdf 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -28,8 +28,8 @@ #include "libavutil/version.h" #define LIBAVCODEC_VERSION_MAJOR 58 -#define LIBAVCODEC_VERSION_MINOR 21 -#define LIBAVCODEC_VERSION_MICRO 106 +#define LIBAVCODEC_VERSION_MINOR 22 +#define LIBAVCODEC_VERSION_MICRO 100 #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] lavf: add avs2 fourcc
ffmpeg | branch: master | hwren | Fri Jul 27 11:48:50 2018 +0800| [b7b7b8e8a1ab02c09093a5bb9ff4cd207ef2b77f] | committer: Steven Liu lavf: add avs2 fourcc Signed-off-by: hwren Signed-off-by: Steven Liu > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b7b7b8e8a1ab02c09093a5bb9ff4cd207ef2b77f --- libavformat/riff.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/riff.c b/libavformat/riff.c index 0950415c26..111e408912 100644 --- a/libavformat/riff.c +++ b/libavformat/riff.c @@ -369,6 +369,7 @@ const AVCodecTag ff_codec_bmp_tags[] = { { AV_CODEC_ID_ZMBV, MKTAG('Z', 'M', 'B', 'V') }, { AV_CODEC_ID_KMVC, MKTAG('K', 'M', 'V', 'C') }, { AV_CODEC_ID_CAVS, MKTAG('C', 'A', 'V', 'S') }, +{ AV_CODEC_ID_AVS2, MKTAG('A', 'V', 'S', '2') }, { AV_CODEC_ID_JPEG2000, MKTAG('m', 'j', 'p', '2') }, { AV_CODEC_ID_JPEG2000, MKTAG('M', 'J', '2', 'C') }, { AV_CODEC_ID_JPEG2000, MKTAG('L', 'J', '2', 'C') }, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavc, doc, configure: add avs2 video decoder wrapper
ffmpeg | branch: master | hwren | Fri Jul 27 11:50:19 2018 +0800| [5985a1bf72332e10d251ec643e100b5592285819] | committer: Steven Liu lavc, doc, configure: add avs2 video decoder wrapper Tested-by: Steven Liu Signed-off-by: hwren Signed-off-by: Steven Liu > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5985a1bf72332e10d251ec643e100b5592285819 --- Changelog | 1 + configure | 4 doc/decoders.texi | 6 ++ doc/general.texi | 14 ++ libavcodec/Makefile| 1 + libavcodec/allcodecs.c | 1 + 6 files changed, 27 insertions(+) diff --git a/Changelog b/Changelog index 807a05dec9..9f6ce505ed 100644 --- a/Changelog +++ b/Changelog @@ -16,6 +16,7 @@ version : - ATRAC9 decoder - lensfun wrapper filter - colorconstancy filter +- AVS2 video decoder via libdavs2 version 4.0: diff --git a/configure b/configure index d509f74e1a..f57ef1844b 100755 --- a/configure +++ b/configure @@ -226,6 +226,7 @@ External library support: --enable-libcelt enable CELT decoding via libcelt [no] --enable-libcdio enable audio CD grabbing with libcdio [no] --enable-libcodec2 enable codec2 en/decoding using libcodec2 [no] + --enable-libdavs2enable AVS2 decoding via libdavs2 [no] --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394 and libraw1394 [no] --enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no] @@ -1639,6 +1640,7 @@ EXTERNAL_LIBRARY_GPL_LIST=" avisynth frei0r libcdio +libdavs2 librubberband libvidstab libx264 @@ -3052,6 +3054,7 @@ libaom_av1_encoder_select="extract_extradata_bsf" libcelt_decoder_deps="libcelt" libcodec2_decoder_deps="libcodec2" libcodec2_encoder_deps="libcodec2" +libdavs2_decoder_deps="libdavs2" libfdk_aac_decoder_deps="libfdk_aac" libfdk_aac_encoder_deps="libfdk_aac" libfdk_aac_encoder_select="audio_frame_queue" @@ -6011,6 +6014,7 @@ enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 && die "ERROR: libcelt must be installed and version must be >= 0.11.0."; } enabled libcaca && require_pkg_config libcaca caca caca.h caca_create_canvas enabled libcodec2 && require libcodec2 codec2/codec2.h codec2_create -lcodec2 +enabled libdavs2 && require_pkg_config libdavs2 "davs2 >= 1.5.115" davs2.h davs2_decoder_open enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new enabled libdrm&& require_pkg_config libdrm libdrm xf86drm.h drmGetVersion enabled libfdk_aac&& { check_pkg_config libfdk_aac fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen || diff --git a/doc/decoders.texi b/doc/decoders.texi index 8f07bc1afb..9439b7b96a 100644 --- a/doc/decoders.texi +++ b/doc/decoders.texi @@ -47,6 +47,12 @@ top-field-first is assumed @end table +@section libdavs2 + +AVS2/IEEE 1857.4 video decoder wrapper. + +This decoder allows libavcodec to decode AVS2 streams with davs2 library. + @c man end VIDEO DECODERS @chapter Audio Decoders diff --git a/doc/general.texi b/doc/general.texi index 8c3a04b078..cd725bb51d 100644 --- a/doc/general.texi +++ b/doc/general.texi @@ -17,6 +17,20 @@ for more formats. None of them are used by default, their use has to be explicitly requested by passing the appropriate flags to @command{./configure}. +@section libdavs2 + +FFmpeg can make use of the davs2 library for AVS2/IEEE 1857.4 video decoding. + +Go to @url{https://github.com/pkuvcl/davs2} and follow the instructions for +installing the library. Then pass @code{--enable-libdavs2} to configure to +enable it. + +@float NOTE +libdavs2 is under the GNU Public License Version 2 or later +(see @url{http://www.gnu.org/licenses/old-licenses/gpl-2.0.html} for +details), you must upgrade FFmpeg's license to GPL in order to use it. +@end float + @section Alliance for Open Media libaom FFmpeg can make use of the libaom library for AV1 decoding. diff --git a/libavcodec/Makefile b/libavcodec/Makefile index c1a7d2f292..6e40702947 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -946,6 +946,7 @@ OBJS-$(CONFIG_LIBAOM_AV1_ENCODER) += libaomenc.o OBJS-$(CONFIG_LIBCELT_DECODER)+= libcelt_dec.o OBJS-$(CONFIG_LIBCODEC2_DECODER) += libcodec2.o codec2utils.o OBJS-$(CONFIG_LIBCODEC2_ENCODER) += libcodec2.o codec2utils.o +OBJS-$(CONFIG_LIBDAVS2_DECODER) += libdavs2.o OBJS-$(CONFIG_LIBFDK_AAC_DECODER) += libfdk-aacdec.o OBJS-$(CONFIG_LIBFDK_AAC_ENCODER) += libfdk-aacenc.o OBJS-$(CONFIG_LIBGSM_DECODER) += libgsmdec.o diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index 505a
[FFmpeg-cvslog] avs2: correct avs2 description
ffmpeg | branch: master | hwren | Tue Aug 7 18:39:34 2018 +0800| [f563e7868fb9540e1c8a589558fba2beaaba01e0] | committer: Gyan Doshi avs2: correct avs2 description Signed-off-by: hwren Signed-off-by: Gyan Doshi > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f563e7868fb9540e1c8a589558fba2beaaba01e0 --- doc/decoders.texi| 2 +- doc/general.texi | 2 +- libavcodec/avs2_parser.c | 2 +- libavcodec/codec_desc.c | 2 +- libavcodec/libdavs2.c| 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/decoders.texi b/doc/decoders.texi index 9439b7b96a..31e96fbc8d 100644 --- a/doc/decoders.texi +++ b/doc/decoders.texi @@ -49,7 +49,7 @@ top-field-first is assumed @section libdavs2 -AVS2/IEEE 1857.4 video decoder wrapper. +AVS2-P2/IEEE1857.4 video decoder wrapper. This decoder allows libavcodec to decode AVS2 streams with davs2 library. diff --git a/doc/general.texi b/doc/general.texi index cd725bb51d..3d1584097e 100644 --- a/doc/general.texi +++ b/doc/general.texi @@ -19,7 +19,7 @@ explicitly requested by passing the appropriate flags to @section libdavs2 -FFmpeg can make use of the davs2 library for AVS2/IEEE 1857.4 video decoding. +FFmpeg can make use of the davs2 library for AVS2-P2/IEEE1857.4 video decoding. Go to @url{https://github.com/pkuvcl/davs2} and follow the instructions for installing the library. Then pass @code{--enable-libdavs2} to configure to diff --git a/libavcodec/avs2_parser.c b/libavcodec/avs2_parser.c index 520e98a9b4..1c9b3423ff 100644 --- a/libavcodec/avs2_parser.c +++ b/libavcodec/avs2_parser.c @@ -1,5 +1,5 @@ /* - * AVS2/IEEE 1857.4 video parser. + * AVS2-P2/IEEE1857.4 video parser. * Copyright (c) 2018 Huiwen Ren * * This file is part of FFmpeg. diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c index 2fe47b..1cbb241389 100644 --- a/libavcodec/codec_desc.c +++ b/libavcodec/codec_desc.c @@ -1398,7 +1398,7 @@ static const AVCodecDescriptor codec_descriptors[] = { .id= AV_CODEC_ID_AVS2, .type = AVMEDIA_TYPE_VIDEO, .name = "avs2", -.long_name = NULL_IF_CONFIG_SMALL("AVS2/IEEE 1857.4"), +.long_name = NULL_IF_CONFIG_SMALL("AVS2-P2/IEEE1857.4"), .props = AV_CODEC_PROP_LOSSY, }, { diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c index 12db1f9da7..70aae3e5eb 100644 --- a/libavcodec/libdavs2.c +++ b/libavcodec/libdavs2.c @@ -163,7 +163,7 @@ static int davs2_decode_frame(AVCodecContext *avctx, void *data, AVCodec ff_libdavs2_decoder = { .name = "libdavs2", -.long_name = NULL_IF_CONFIG_SMALL("Decoder for AVS2/IEEE 1857.4"), +.long_name = NULL_IF_CONFIG_SMALL("libdavs2 AVS2-P2/IEEE1857.4"), .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_AVS2, .priv_data_size = sizeof(DAVS2Context), ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavc/extract_extradata_bsf.c: add AVS2
ffmpeg | branch: master | hwren | Mon Aug 6 21:42:51 2018 +0800| [b8da7ba5ac99e434fe99e12c105cc52cab147059] | committer: Michael Niedermayer lavc/extract_extradata_bsf.c: add AVS2 Signed-off-by: hwren Reviewed-by: James Almer Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b8da7ba5ac99e434fe99e12c105cc52cab147059 --- libavcodec/extract_extradata_bsf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/extract_extradata_bsf.c b/libavcodec/extract_extradata_bsf.c index 6deb6634f3..f37427c7e1 100644 --- a/libavcodec/extract_extradata_bsf.c +++ b/libavcodec/extract_extradata_bsf.c @@ -331,6 +331,7 @@ static const struct { uint8_t **data, int *size); } extract_tab[] = { { AV_CODEC_ID_AV1,extract_extradata_av1 }, +{ AV_CODEC_ID_AVS2, extract_extradata_mpeg4 }, { AV_CODEC_ID_CAVS, extract_extradata_mpeg4 }, { AV_CODEC_ID_H264, extract_extradata_h2645 }, { AV_CODEC_ID_HEVC, extract_extradata_h2645 }, @@ -397,6 +398,7 @@ static void extract_extradata_close(AVBSFContext *ctx) static const enum AVCodecID codec_ids[] = { AV_CODEC_ID_AV1, +AV_CODEC_ID_AVS2, AV_CODEC_ID_CAVS, AV_CODEC_ID_H264, AV_CODEC_ID_HEVC, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavf: add raw avs2 muxer
ffmpeg | branch: master | hwren | Mon Sep 10 11:59:03 2018 +0800| [ed0bd0a71b5e861a68410ad4543e4a1b611bd7c8] | committer: Mark Thompson lavf: add raw avs2 muxer Signed-off-by: hwren > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ed0bd0a71b5e861a68410ad4543e4a1b611bd7c8 --- libavformat/allformats.c | 1 + libavformat/rawenc.c | 13 + 2 files changed, 14 insertions(+) diff --git a/libavformat/allformats.c b/libavformat/allformats.c index adcc8d90a7..c17cdc276c 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -76,6 +76,7 @@ extern AVInputFormat ff_avisynth_demuxer; extern AVOutputFormat ff_avm2_muxer; extern AVInputFormat ff_avr_demuxer; extern AVInputFormat ff_avs_demuxer; +extern AVOutputFormat ff_avs2_muxer; extern AVInputFormat ff_bethsoftvid_demuxer; extern AVInputFormat ff_bfi_demuxer; extern AVInputFormat ff_bintext_demuxer; diff --git a/libavformat/rawenc.c b/libavformat/rawenc.c index 809ca23b1a..993d232b70 100644 --- a/libavformat/rawenc.c +++ b/libavformat/rawenc.c @@ -117,6 +117,19 @@ AVOutputFormat ff_aptx_hd_muxer = { }; #endif +#if CONFIG_AVS2_MUXER +AVOutputFormat ff_avs2_muxer = { +.name = "avs2", +.long_name = NULL_IF_CONFIG_SMALL("raw AVS2-P2/IEEE1857.4 video"), +.extensions= "avs,avs2", +.audio_codec = AV_CODEC_ID_NONE, +.video_codec = AV_CODEC_ID_AVS2, +.write_header = force_one_stream, +.write_packet = ff_raw_write_packet, +.flags = AVFMT_NOTIMESTAMPS, +}; +#endif + #if CONFIG_CAVSVIDEO_MUXER AVOutputFormat ff_cavsvideo_muxer = { .name = "cavsvideo", ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavc, doc, configure: add libxavs2 video encoder wrapper
ffmpeg | branch: master | hwren | Mon Sep 10 11:59:02 2018 +0800| [85a921f46184dace4b4f3d968830991eff218e3f] | committer: Mark Thompson lavc, doc, configure: add libxavs2 video encoder wrapper Signed-off-by: hwren > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=85a921f46184dace4b4f3d968830991eff218e3f --- Changelog | 1 + configure | 4 + doc/encoders.texi | 49 doc/general.texi | 14 +++ libavcodec/Makefile| 1 + libavcodec/allcodecs.c | 1 + libavcodec/libxavs2.c | 297 + libavcodec/version.h | 2 +- 8 files changed, 368 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index a117ad4d2e..59ea36d08b 100644 --- a/Changelog +++ b/Changelog @@ -26,6 +26,7 @@ version : - cue and acue filters - support for AV1 in MP4 - transpose_npp filter +- AVS2 video encoder via libxavs2 version 4.0: diff --git a/configure b/configure index ef97c6b500..14aa311ffd 100755 --- a/configure +++ b/configure @@ -281,6 +281,7 @@ External library support: --enable-libx264 enable H.264 encoding via x264 [no] --enable-libx265 enable HEVC encoding via x265 [no] --enable-libxavs enable AVS encoding via xavs [no] + --enable-libxavs2enable AVS2 encoding via xavs2 [no] --enable-libxcb enable X11 grabbing using XCB [autodetect] --enable-libxcb-shm enable X11 grabbing shm communication [autodetect] --enable-libxcb-xfixes enable X11 grabbing mouse rendering [autodetect] @@ -1667,6 +1668,7 @@ EXTERNAL_LIBRARY_GPL_LIST=" libx264 libx265 libxavs +libxavs2 libxvid " @@ -3135,6 +3137,7 @@ libx264rgb_encoder_deps="libx264 x264_csp_bgr" libx264rgb_encoder_select="libx264_encoder" libx265_encoder_deps="libx265" libxavs_encoder_deps="libxavs" +libxavs2_encoder_deps="libxavs2" libxvid_encoder_deps="libxvid" libzvbi_teletext_decoder_deps="libzvbi" vapoursynth_demuxer_deps="vapoursynth" @@ -6171,6 +6174,7 @@ enabled libx264 && { check_pkg_config libx264 x264 "stdint.h x264.h" x enabled libx265 && require_pkg_config libx265 x265 x265.h x265_api_get && require_cpp_condition libx265 x265.h "X265_BUILD >= 68" enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs" +enabled libxavs2 && require_pkg_config libxavs2 "xavs2 >= 1.2.77" "stdint.h xavs2.h" xavs2_api_get enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore enabled libzimg && require_pkg_config libzimg "zimg >= 2.7.0" zimg.h zimg_get_api_version enabled libzmq&& require_pkg_config libzmq libzmq zmq.h zmq_ctx_new diff --git a/doc/encoders.texi b/doc/encoders.texi index 7b095754d1..4623f38969 100644 --- a/doc/encoders.texi +++ b/doc/encoders.texi @@ -2726,6 +2726,55 @@ Reduces detail but attempts to preserve color at extremely low bitrates. @end table +@section libxavs2 + +xavs2 AVS2-P2/IEEE1857.4 encoder wrapper. + +This encoder requires the presence of the libxavs2 headers and library +during configuration. You need to explicitly configure the build with +@option{--enable-libxavs2}. + +@subsection Options + +@table @option +@item lcu_row_threads +Set the number of parallel threads for rows from 1 to 8 (default 5). + +@item initial_qp +Set the xavs2 quantization parameter from 1 to 63 (default 34). This is +used to set the initial qp for the first frame. + +@item qp +Set the xavs2 quantization parameter from 1 to 63 (default 34). This is +used to set the qp value under constant-QP mode. + +@item max_qp +Set the max qp for rate control from 1 to 63 (default 55). + +@item min_qp +Set the min qp for rate control from 1 to 63 (default 20). + +@item speed_level +Set the Speed level from 0 to 9 (default 0). Higher is better but slower. + +@item log_level +Set the log level from -1 to 3 (default 0). -1: none, 0: error, +1: warning, 2: info, 3: debug. + +@item hierarchical_ref +Set the hierarchical reference or not (default true). + +@item xavs2-params +Set xavs2 options using a list of @var{key}=@var{value} couples separated +by ":". + +For example to specify libxavs2 encoding options with @option{-xavs2-params}: + +@example +ffmpeg -i input -c:v libxavs2 -xavs2-params preset_level=5 output.avs2 +@end example +@end table + @c man end VIDEO ENCODERS @chapter Subtitles Encoders diff --git a/doc/general.texi b/doc/general.texi index 06f7a78d8a..05f7bcd9fc 100644 --- a/doc/general.texi +++ b/doc/general.texi @@ -17,6 +17,20 @@ for more formats. None of them are used by default, their use has to be explicitly reques
[FFmpeg-cvslog] lavf: add raw AVS2 demuxer
ffmpeg | branch: master | hwren | Wed Sep 12 12:13:53 2018 +0800| [0caa33c60b69e2d7e2db432786673689eafb7900] | committer: Steven Liu lavf: add raw AVS2 demuxer Signed-off-by: hwren Signed-off-by: Steven Liu > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0caa33c60b69e2d7e2db432786673689eafb7900 --- libavformat/Makefile | 1 + libavformat/allformats.c | 1 + libavformat/davs2.c | 71 3 files changed, 73 insertions(+) diff --git a/libavformat/Makefile b/libavformat/Makefile index 6eac6a225b..ccb39b5469 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -115,6 +115,7 @@ OBJS-$(CONFIG_AVI_MUXER) += avienc.o mpegtsenc.o avlanguage.o ra OBJS-$(CONFIG_AVM2_MUXER)+= swfenc.o swf.o OBJS-$(CONFIG_AVR_DEMUXER) += avr.o pcm.o OBJS-$(CONFIG_AVS_DEMUXER) += avs.o voc_packet.o vocdec.o voc.o +OBJS-$(CONFIG_AVS2_DEMUXER) += davs2.o rawdec.o OBJS-$(CONFIG_AVS2_MUXER)+= rawenc.o OBJS-$(CONFIG_BETHSOFTVID_DEMUXER) += bethsoftvid.o OBJS-$(CONFIG_BFI_DEMUXER) += bfi.o diff --git a/libavformat/allformats.c b/libavformat/allformats.c index c17cdc276c..5c32ee6dff 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -76,6 +76,7 @@ extern AVInputFormat ff_avisynth_demuxer; extern AVOutputFormat ff_avm2_muxer; extern AVInputFormat ff_avr_demuxer; extern AVInputFormat ff_avs_demuxer; +extern AVInputFormat ff_avs2_demuxer; extern AVOutputFormat ff_avs2_muxer; extern AVInputFormat ff_bethsoftvid_demuxer; extern AVInputFormat ff_bfi_demuxer; diff --git a/libavformat/davs2.c b/libavformat/davs2.c new file mode 100644 index 00..bca59a3c3f --- /dev/null +++ b/libavformat/davs2.c @@ -0,0 +1,71 @@ +/* + * AVS2 video stream probe. + * + * Copyright (C) 2018 Huiwen Ren, + * + * 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 "rawdec.h" +#include "libavcodec/internal.h" +#include "libavutil/intreadwrite.h" + +#define ISSQH(x) ((x) == 0xB0 ) +#define ISEND(x) ((x) == 0xB1 ) +#define ISPIC(x) ((x) == 0xB3 || (x) == 0xB6) +#define ISUNIT(x) ( ISSQH(x) || ISEND(x) || (x) == 0xB2 || ISPIC(x) || (x) == 0xB5 || (x) == 0xB7 ) +#define ISAVS2(x) ((x) == 0x20 || (x) == 0x22 || (x) == 0x30 || (x) == 0x32 ) + +static int avs2_probe(AVProbeData *p) +{ +if (AV_RB32(p->buf) != 0x1B0){ +return 0; +} +uint32_t code= -1, hds=0, pic=0, seq=0; +uint8_t state=0; +const uint8_t *ptr = p->buf, *end = p->buf + p->buf_size, *sqb=0; + +while (ptr < end) { +ptr = avpriv_find_start_code(ptr, end, &code); +state = code & 0xFF; +if ((code & 0xff00) == 0x100) { +if (ISUNIT(state)) { +if (sqb && !hds) { +hds = ptr - sqb; +} +if (ISSQH(state)) { +if (!ISAVS2(*ptr)) +return 0; +sqb = ptr; +seq++; +} else if (ISPIC(state)) { +pic++; +} else if (ISEND(state)) { +break; +} +} +} +} +if (seq && hds >= 21 && pic){ +return AVPROBE_SCORE_EXTENSION + 2; // more than cavs +} + +return 0; +} + +FF_DEF_RAWVIDEO_DEMUXER(avs2, "raw AVS2-P2/IEEE1857.4", avs2_probe, "avs,avs2", AV_CODEC_ID_AVS2) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavc/libdavs2: remove unused header files
ffmpeg | branch: master | hwren | Wed Sep 12 13:53:07 2018 +0800| [6f23c327c5a0efe61a466d2c62e404f6b935d400] | committer: Mark Thompson lavc/libdavs2: remove unused header files Signed-off-by: hwren > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6f23c327c5a0efe61a466d2c62e404f6b935d400 --- libavcodec/libdavs2.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c index 70aae3e5eb..ab9e5116c3 100644 --- a/libavcodec/libdavs2.c +++ b/libavcodec/libdavs2.c @@ -22,13 +22,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "libavutil/avassert.h" -#include "libavutil/common.h" -#include "libavutil/avutil.h" #include "avcodec.h" -#include "libavutil/imgutils.h" -#include "internal.h" - #include "davs2.h" typedef struct DAVS2Context { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavc/libdavs2: fix error return codes
ffmpeg | branch: master | hwren | Wed Sep 12 13:53:08 2018 +0800| [c0e9824c0f250aa993f1f189dbd75e2a89924325] | committer: Mark Thompson lavc/libdavs2: fix error return codes Signed-off-by: hwren > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c0e9824c0f250aa993f1f189dbd75e2a89924325 --- libavcodec/libdavs2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c index ab9e5116c3..aa1478290a 100644 --- a/libavcodec/libdavs2.c +++ b/libavcodec/libdavs2.c @@ -50,7 +50,7 @@ static av_cold int davs2_init(AVCodecContext *avctx) if (!cad->decoder) { av_log(avctx, AV_LOG_ERROR, "decoder created error."); -return AVERROR(EINVAL); +return AVERROR_EXTERNAL; } av_log(avctx, AV_LOG_VERBOSE, "decoder created. %p\n", cad->decoder); @@ -84,7 +84,7 @@ static int davs2_dump_frames(AVCodecContext *avctx, davs2_picture_t *pic, if (!frame->buf[plane]){ av_log(avctx, AV_LOG_ERROR, "dump error: alloc failed.\n"); -return AVERROR(EINVAL); +return AVERROR(ENOMEM); } frame->data[plane] = frame->buf[plane]->data; @@ -142,7 +142,7 @@ static int davs2_decode_frame(AVCodecContext *avctx, void *data, if (ret == DAVS2_ERROR) { av_log(avctx, AV_LOG_ERROR, "Decoder error: can't read packet\n"); -return AVERROR(EINVAL); +return AVERROR_EXTERNAL; } ret = davs2_decoder_recv_frame(cad->decoder, &cad->headerset, &cad->out_frame); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavc/libxavs2: remove nonexistent parameters
ffmpeg | branch: master | hwren | Wed Sep 12 15:54:51 2018 +0800| [bc1097a2bf4f595c6e391457ec6a44519b5330ae] | committer: Mark Thompson lavc/libxavs2: remove nonexistent parameters Signed-off-by: hwren > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bc1097a2bf4f595c6e391457ec6a44519b5330ae --- doc/encoders.texi | 3 --- libavcodec/libxavs2.c | 4 2 files changed, 7 deletions(-) diff --git a/doc/encoders.texi b/doc/encoders.texi index 4623f38969..0696a7acd2 100644 --- a/doc/encoders.texi +++ b/doc/encoders.texi @@ -2761,9 +2761,6 @@ Set the Speed level from 0 to 9 (default 0). Higher is better but slower. Set the log level from -1 to 3 (default 0). -1: none, 0: error, 1: warning, 2: info, 3: debug. -@item hierarchical_ref -Set the hierarchical reference or not (default true). - @item xavs2-params Set xavs2 options using a list of @var{key}=@var{value} couples separated by ":". diff --git a/libavcodec/libxavs2.c b/libavcodec/libxavs2.c index e26c90a8c6..2b47d0c5d2 100644 --- a/libavcodec/libxavs2.c +++ b/libavcodec/libxavs2.c @@ -78,8 +78,6 @@ static av_cold int xavs2_init(AVCodecContext *avctx) return AVERROR(ENOMEM); } -xavs2_opt_set2("rec", "%d", 0); - xavs2_opt_set2("width", "%d", avctx->width); xavs2_opt_set2("height","%d", avctx->height); xavs2_opt_set2("bframes", "%d", avctx->max_b_frames); @@ -92,7 +90,6 @@ static av_cold int xavs2_init(AVCodecContext *avctx) xavs2_opt_set2("thread_frames", "%d", avctx->thread_count); xavs2_opt_set2("thread_rows", "%d", cae->lcu_row_threads); -xavs2_opt_set2("hierarchical_ref", "%d", cae->hierarchical_reference); xavs2_opt_set2("OpenGOP", "%d", 1); @@ -261,7 +258,6 @@ static const AVOption options[] = { { "min_qp" , "min qp for rate control" , OFFSET(min_qp) , AV_OPT_TYPE_INT, {.i64 = 20 }, 0, 63, VE }, { "speed_level" , "Speed level, higher is better but slower", OFFSET(preset_level), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 9, VE }, { "log_level" , "log level: -1: none, 0: error, 1: warning, 2: info, 3: debug", OFFSET(log_level), AV_OPT_TYPE_INT, {.i64 = 0 }, -1, 3, VE }, -{ "hierarchical_ref", "hierarchical reference" , OFFSET(hierarchical_reference), AV_OPT_TYPE_BOOL,{.i64 = 1 }, 0, 1, VE }, { "xavs2-params", "set the xavs2 configuration using a :-separated list of key=value parameters", OFFSET(xavs2_opts), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE }, { NULL }, }; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavc/libxavs2: enable OpenGop
ffmpeg | branch: master | hwren | Thu Oct 18 23:02:10 2018 +0800| [c00ed8d0e7bd5917dc096245e6a37ae0149d8b54] | committer: Jun Zhao lavc/libxavs2: enable OpenGop Signed-off-by: hwren > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c00ed8d0e7bd5917dc096245e6a37ae0149d8b54 --- libavcodec/libxavs2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/libxavs2.c b/libavcodec/libxavs2.c index f07fc635af..822af3fddc 100644 --- a/libavcodec/libxavs2.c +++ b/libavcodec/libxavs2.c @@ -91,7 +91,7 @@ static av_cold int xavs2_init(AVCodecContext *avctx) xavs2_opt_set2("ThreadFrames", "%d", avctx->thread_count); xavs2_opt_set2("ThreadRows","%d", cae->lcu_row_threads); -xavs2_opt_set2("OpenGOP", "%d", 1); +xavs2_opt_set2("OpenGOP", "%d", !(avctx->flags & AV_CODEC_FLAG_CLOSED_GOP)); if (cae->xavs2_opts) { AVDictionary *dict= NULL; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavc/libxavs2: unified naming style
ffmpeg | branch: master | hwren | Thu Oct 18 23:02:08 2018 +0800| [9c190ad39481452a7424e65c3692c7cbf9533d84] | committer: Jun Zhao lavc/libxavs2: unified naming style Signed-off-by: hwren > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9c190ad39481452a7424e65c3692c7cbf9533d84 --- libavcodec/libxavs2.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/libavcodec/libxavs2.c b/libavcodec/libxavs2.c index 2b47d0c5d2..1152c634e8 100644 --- a/libavcodec/libxavs2.c +++ b/libavcodec/libxavs2.c @@ -78,18 +78,18 @@ static av_cold int xavs2_init(AVCodecContext *avctx) return AVERROR(ENOMEM); } -xavs2_opt_set2("width", "%d", avctx->width); -xavs2_opt_set2("height","%d", avctx->height); -xavs2_opt_set2("bframes", "%d", avctx->max_b_frames); -xavs2_opt_set2("bitdepth", "%d", bit_depth); -xavs2_opt_set2("log", "%d", cae->log_level); -xavs2_opt_set2("preset","%d", cae->preset_level); +xavs2_opt_set2("Width", "%d", avctx->width); +xavs2_opt_set2("Height","%d", avctx->height); +xavs2_opt_set2("BFrames", "%d", avctx->max_b_frames); +xavs2_opt_set2("BitDepth", "%d", bit_depth); +xavs2_opt_set2("Log", "%d", cae->log_level); +xavs2_opt_set2("Preset","%d", cae->preset_level); /* not the same parameter as the IntraPeriod in xavs2 log */ -xavs2_opt_set2("intraperiod", "%d", avctx->gop_size); +xavs2_opt_set2("IntraPeriod", "%d", avctx->gop_size); -xavs2_opt_set2("thread_frames", "%d", avctx->thread_count); -xavs2_opt_set2("thread_rows", "%d", cae->lcu_row_threads); +xavs2_opt_set2("ThreadFrames", "%d", avctx->thread_count); +xavs2_opt_set2("ThreadRows","%d", cae->lcu_row_threads); xavs2_opt_set2("OpenGOP", "%d", 1); @@ -109,11 +109,11 @@ static av_cold int xavs2_init(AVCodecContext *avctx) if (avctx->bit_rate > 0) { xavs2_opt_set2("RateControl", "%d", 1); xavs2_opt_set2("TargetBitRate", "%"PRId64"", avctx->bit_rate); -xavs2_opt_set2("initial_qp","%d", cae->initial_qp); -xavs2_opt_set2("max_qp","%d", cae->max_qp); -xavs2_opt_set2("min_qp","%d", cae->min_qp); +xavs2_opt_set2("InitialQP", "%d", cae->initial_qp); +xavs2_opt_set2("MaxQP", "%d", cae->max_qp); +xavs2_opt_set2("MinQP", "%d", cae->min_qp); } else { -xavs2_opt_set2("initial_qp","%d", cae->qp); +xavs2_opt_set2("InitialQP", "%d", cae->qp); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavc/libxavs2: fix intra period meaning conflict
ffmpeg | branch: master | hwren | Thu Oct 18 23:02:09 2018 +0800| [4c23262811068439b359071c959c1fe77d116ff1] | committer: Jun Zhao lavc/libxavs2: fix intra period meaning conflict Signed-off-by: hwren > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4c23262811068439b359071c959c1fe77d116ff1 --- libavcodec/libxavs2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/libxavs2.c b/libavcodec/libxavs2.c index 1152c634e8..f07fc635af 100644 --- a/libavcodec/libxavs2.c +++ b/libavcodec/libxavs2.c @@ -85,8 +85,8 @@ static av_cold int xavs2_init(AVCodecContext *avctx) xavs2_opt_set2("Log", "%d", cae->log_level); xavs2_opt_set2("Preset","%d", cae->preset_level); -/* not the same parameter as the IntraPeriod in xavs2 log */ -xavs2_opt_set2("IntraPeriod", "%d", avctx->gop_size); +xavs2_opt_set2("IntraPeriodMax","%d", avctx->gop_size); +xavs2_opt_set2("IntraPeriodMin","%d", avctx->gop_size); xavs2_opt_set2("ThreadFrames", "%d", avctx->thread_count); xavs2_opt_set2("ThreadRows","%d", cae->lcu_row_threads); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavc/libdavs2: correct frame type setting
ffmpeg | branch: master | hwren | Fri Nov 2 21:30:10 2018 +0800| [31b79e0210c4184627b5971ce1e909e6de7df976] | committer: Mark Thompson lavc/libdavs2: correct frame type setting Signed-off-by: hwren > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=31b79e0210c4184627b5971ce1e909e6de7df976 --- libavcodec/libdavs2.c | 21 - 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c index 3b9efe05b1..874f2f084d 100644 --- a/libavcodec/libdavs2.c +++ b/libavcodec/libdavs2.c @@ -76,6 +76,26 @@ static int davs2_dump_frames(AVCodecContext *avctx, davs2_picture_t *pic, return 0; } +switch (pic->type) { +case DAVS2_PIC_I: +case DAVS2_PIC_G: +frame->pict_type = AV_PICTURE_TYPE_I; +break; +case DAVS2_PIC_P: +case DAVS2_PIC_S: +frame->pict_type = AV_PICTURE_TYPE_P; +break; +case DAVS2_PIC_B: +frame->pict_type = AV_PICTURE_TYPE_B; +break; +case DAVS2_PIC_F: +frame->pict_type = AV_PICTURE_TYPE_S; +break; +default: +av_log(avctx, AV_LOG_ERROR, "Decoder error: unknown frame type\n"); +return AVERROR_EXTERNAL; +} + for (plane = 0; plane < 3; ++plane) { int size_line = pic->widths[plane] * bytes_per_sample; frame->buf[plane] = av_buffer_alloc(size_line * pic->lines[plane]); @@ -97,7 +117,6 @@ static int davs2_dump_frames(AVCodecContext *avctx, davs2_picture_t *pic, frame->width = cad->headerset.width; frame->height= cad->headerset.height; frame->pts = cad->out_frame.pts; -frame->pict_type = pic->type; frame->format= avctx->pix_fmt; return 1; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavc/libdavs2: remove unused frame counter
ffmpeg | branch: master | hwren | Fri Nov 2 21:30:09 2018 +0800| [b75afd25ba9d1a3321341dad2e9bea4273e82536] | committer: Mark Thompson lavc/libdavs2: remove unused frame counter Signed-off-by: hwren > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b75afd25ba9d1a3321341dad2e9bea4273e82536 --- libavcodec/libdavs2.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c index cadf995444..3b9efe05b1 100644 --- a/libavcodec/libdavs2.c +++ b/libavcodec/libdavs2.c @@ -32,8 +32,6 @@ typedef struct DAVS2Context { davs2_param_tparam; // decoding parameters davs2_packet_t packet; // input bitstream -int decoded_frames; - davs2_picture_t out_frame; // output data, frame data davs2_seq_info_t headerset; // output data, sequence header @@ -102,7 +100,6 @@ static int davs2_dump_frames(AVCodecContext *avctx, davs2_picture_t *pic, frame->pict_type = pic->type; frame->format= avctx->pix_fmt; -cad->decoded_frames++; return 1; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavc/libxavs2: fix parameter setting result determination
ffmpeg | branch: master | hwren | Mon Oct 14 21:22:42 2019 +0800| [e71c241beaaa8f52cf99938c6de2f09fef9aef22] | committer: Michael Niedermayer lavc/libxavs2: fix parameter setting result determination Signed-off-by: hwren Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e71c241beaaa8f52cf99938c6de2f09fef9aef22 --- libavcodec/libxavs2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/libxavs2.c b/libavcodec/libxavs2.c index d5c455797d..0179a1eb15 100644 --- a/libavcodec/libxavs2.c +++ b/libavcodec/libxavs2.c @@ -31,7 +31,7 @@ int err; \ av_strlcatf(opt_str, sizeof(opt_str), format, __VA_ARGS__); \ err = cae->api->opt_set2(cae->param, name, opt_str); \ -if (err) {\ +if (err < 0) {\ av_log(avctx, AV_LOG_WARNING, "Invalid value for %s: %s\n", name, opt_str);\ }\ } while(0); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] lavc/libxavs2.c: use more descriptive variable names in xavs2_copy_frame* functions
ffmpeg | branch: master | hwren | Tue Dec 3 10:41:22 2019 +0800| [3003917a8fe070817bb6a68d27be666456f2cf13] | committer: Michael Niedermayer lavc/libxavs2.c: use more descriptive variable names in xavs2_copy_frame* functions Signed-off-by: hwren Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3003917a8fe070817bb6a68d27be666456f2cf13 --- libavcodec/libxavs2.c | 29 ++--- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/libavcodec/libxavs2.c b/libavcodec/libxavs2.c index 0179a1eb15..3896f3b20d 100644 --- a/libavcodec/libxavs2.c +++ b/libavcodec/libxavs2.c @@ -132,16 +132,15 @@ static av_cold int xavs2_init(AVCodecContext *avctx) static void xavs2_copy_frame_with_shift(xavs2_picture_t *pic, const AVFrame *frame, const int shift_in) { -int j, k; -for (k = 0; k < 3; k++) { -int i_stride = pic->img.i_stride[k]; -for (j = 0; j < pic->img.i_lines[k]; j++) { -uint16_t *p_plane = (uint16_t *)&pic->img.img_planes[k][j * i_stride]; -int i; -uint8_t *p_buffer = frame->data[k] + frame->linesize[k] * j; +int plane, hIdx, wIdx; +for (plane = 0; plane < 3; plane++) { +int i_stride = pic->img.i_stride[plane]; +for (hIdx = 0; hIdx < pic->img.i_lines[plane]; hIdx++) { +uint16_t *p_plane = (uint16_t *)&pic->img.img_planes[plane][hIdx * i_stride]; +uint8_t *p_buffer = frame->data[plane] + frame->linesize[plane] * hIdx; memset(p_plane, 0, i_stride); -for (i = 0; i < pic->img.i_width[k]; i++) { -p_plane[i] = p_buffer[i] << shift_in; +for (wIdx = 0; wIdx < pic->img.i_width[plane]; wIdx++) { +p_plane[wIdx] = p_buffer[wIdx] << shift_in; } } } @@ -149,12 +148,12 @@ static void xavs2_copy_frame_with_shift(xavs2_picture_t *pic, const AVFrame *fra static void xavs2_copy_frame(xavs2_picture_t *pic, const AVFrame *frame) { -int j, k; -for (k = 0; k < 3; k++) { -for (j = 0; j < pic->img.i_lines[k]; j++) { -memcpy( pic->img.img_planes[k] + pic->img.i_stride[k] * j, -frame->data[k]+frame->linesize[k] * j, -pic->img.i_width[k] * pic->img.in_sample_size); +int plane, hIdx; +for (plane = 0; plane < 3; plane++) { +for (hIdx = 0; hIdx < pic->img.i_lines[plane]; hIdx++) { +memcpy( pic->img.img_planes[plane] + pic->img.i_stride[plane] * hIdx, +frame->data[plane]+frame->linesize[plane] * hIdx, +pic->img.i_width[plane] * pic->img.in_sample_size); } } } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] lavc/libxavs2.c: optimize error descriptions
ffmpeg | branch: master | hwren | Tue Dec 3 10:41:26 2019 +0800| [0bafcc987458e5a243a8748499a19799cb46b254] | committer: Michael Niedermayer lavc/libxavs2.c: optimize error descriptions Signed-off-by: hwren Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0bafcc987458e5a243a8748499a19799cb46b254 --- libavcodec/libxavs2.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libavcodec/libxavs2.c b/libavcodec/libxavs2.c index 0aa4d31326..2f8460ab8e 100644 --- a/libavcodec/libxavs2.c +++ b/libavcodec/libxavs2.c @@ -67,13 +67,13 @@ static av_cold int xavs2_init(AVCodecContext *avctx) /* get API handler */ cae->api = xavs2_api_get(bit_depth); if (!cae->api) { -av_log(avctx, AV_LOG_ERROR, "api get failed\n"); +av_log(avctx, AV_LOG_ERROR, "Failed to get xavs2 api context\n"); return AVERROR_EXTERNAL; } cae->param = cae->api->opt_alloc(); if (!cae->param) { -av_log(avctx, AV_LOG_ERROR, "param alloc failed\n"); +av_log(avctx, AV_LOG_ERROR, "Failed to alloc xavs2 parameters\n"); return AVERROR(ENOMEM); } @@ -121,7 +121,7 @@ static av_cold int xavs2_init(AVCodecContext *avctx) cae->encoder = cae->api->encoder_create(cae->param); if (!cae->encoder) { -av_log(avctx, AV_LOG_ERROR, "Can not create encoder. Null pointer returned\n"); +av_log(avctx, AV_LOG_ERROR, "Failed to create xavs2 encoder instance.\n"); return AVERROR(EINVAL); } @@ -180,7 +180,7 @@ static int xavs2_encode_frame(AVCodecContext *avctx, AVPacket *pkt, /* create the XAVS2 video encoder */ /* read frame data and send to the XAVS2 video encoder */ if (cae->api->encoder_get_buffer(cae->encoder, &pic) < 0) { -av_log(avctx, AV_LOG_ERROR, "failed to get frame buffer\n"); +av_log(avctx, AV_LOG_ERROR, "Failed to get xavs2 frame buffer\n"); return AVERROR_EXTERNAL; } if (frame) { @@ -211,7 +211,7 @@ static int xavs2_encode_frame(AVCodecContext *avctx, AVPacket *pkt, ret = cae->api->encoder_encode(cae->encoder, &pic, &cae->packet); if (ret) { -av_log(avctx, AV_LOG_ERROR, "encode failed\n"); +av_log(avctx, AV_LOG_ERROR, "Encoding error occured.\n"); return AVERROR_EXTERNAL; } @@ -221,7 +221,7 @@ static int xavs2_encode_frame(AVCodecContext *avctx, AVPacket *pkt, if ((cae->packet.len) && (cae->packet.state != XAVS2_STATE_FLUSH_END)) { if (av_new_packet(pkt, cae->packet.len) < 0) { -av_log(avctx, AV_LOG_ERROR, "packet alloc failed\n"); +av_log(avctx, AV_LOG_ERROR, "Failed to alloc xavs2 packet.\n"); cae->api->encoder_packet_unref(cae->encoder, &cae->packet); return AVERROR(ENOMEM); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] lavc/libxavs2.c: fix code style - spaces
ffmpeg | branch: master | hwren | Tue Dec 3 10:41:24 2019 +0800| [191203aa1fe12245926c98b252df18f75497a31f] | committer: Michael Niedermayer lavc/libxavs2.c: fix code style - spaces Signed-off-by: hwren Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=191203aa1fe12245926c98b252df18f75497a31f --- libavcodec/libxavs2.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/libavcodec/libxavs2.c b/libavcodec/libxavs2.c index 0e525ee7e8..0aa4d31326 100644 --- a/libavcodec/libxavs2.c +++ b/libavcodec/libxavs2.c @@ -59,7 +59,7 @@ typedef struct XAVS2EContext { static av_cold int xavs2_init(AVCodecContext *avctx) { -XAVS2EContext *cae= avctx->priv_data; +XAVS2EContext *cae = avctx->priv_data; int bit_depth, code; bit_depth = avctx->pix_fmt == AV_PIX_FMT_YUV420P ? 8 : 10; @@ -115,15 +115,13 @@ static av_cold int xavs2_init(AVCodecContext *avctx) xavs2_opt_set2("InitialQP", "%d", cae->qp); } - ff_mpeg12_find_best_frame_rate(avctx->framerate, &code, NULL, NULL, 0); - xavs2_opt_set2("FrameRate", "%d", code); cae->encoder = cae->api->encoder_create(cae->param); if (!cae->encoder) { -av_log(avctx,AV_LOG_ERROR, "Can not create encoder. Null pointer returned\n"); +av_log(avctx, AV_LOG_ERROR, "Can not create encoder. Null pointer returned\n"); return AVERROR(EINVAL); } @@ -182,7 +180,7 @@ static int xavs2_encode_frame(AVCodecContext *avctx, AVPacket *pkt, /* create the XAVS2 video encoder */ /* read frame data and send to the XAVS2 video encoder */ if (cae->api->encoder_get_buffer(cae->encoder, &pic) < 0) { -av_log(avctx,AV_LOG_ERROR, "failed to get frame buffer\n"); +av_log(avctx, AV_LOG_ERROR, "failed to get frame buffer\n"); return AVERROR_EXTERNAL; } if (frame) { @@ -221,9 +219,8 @@ static int xavs2_encode_frame(AVCodecContext *avctx, AVPacket *pkt, cae->api->encoder_encode(cae->encoder, NULL, &cae->packet); } -if ((cae->packet.len) && (cae->packet.state != XAVS2_STATE_FLUSH_END)){ - -if (av_new_packet(pkt, cae->packet.len) < 0){ +if ((cae->packet.len) && (cae->packet.state != XAVS2_STATE_FLUSH_END)) { +if (av_new_packet(pkt, cae->packet.len) < 0) { av_log(avctx, AV_LOG_ERROR, "packet alloc failed\n"); cae->api->encoder_packet_unref(cae->encoder, &cae->packet); return AVERROR(ENOMEM); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] lavc/libxavs2.c: avoid recomputations of pointers in xavs2_copy_frame* functions
ffmpeg | branch: master | hwren | Tue Dec 3 10:41:23 2019 +0800| [6721cd942ad642f373e0f7ed1e191008bfeafdb7] | committer: Michael Niedermayer lavc/libxavs2.c: avoid recomputations of pointers in xavs2_copy_frame* functions Signed-off-by: hwren Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6721cd942ad642f373e0f7ed1e191008bfeafdb7 --- libavcodec/libxavs2.c | 32 +++- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/libavcodec/libxavs2.c b/libavcodec/libxavs2.c index 3896f3b20d..0e525ee7e8 100644 --- a/libavcodec/libxavs2.c +++ b/libavcodec/libxavs2.c @@ -132,28 +132,42 @@ static av_cold int xavs2_init(AVCodecContext *avctx) static void xavs2_copy_frame_with_shift(xavs2_picture_t *pic, const AVFrame *frame, const int shift_in) { -int plane, hIdx, wIdx; +uint16_t *p_plane; +uint8_t *p_buffer; +int plane; +int hIdx; +int wIdx; + for (plane = 0; plane < 3; plane++) { -int i_stride = pic->img.i_stride[plane]; +p_plane = (uint16_t *)pic->img.img_planes[plane]; +p_buffer = frame->data[plane]; for (hIdx = 0; hIdx < pic->img.i_lines[plane]; hIdx++) { -uint16_t *p_plane = (uint16_t *)&pic->img.img_planes[plane][hIdx * i_stride]; -uint8_t *p_buffer = frame->data[plane] + frame->linesize[plane] * hIdx; -memset(p_plane, 0, i_stride); +memset(p_plane, 0, pic->img.i_stride[plane]); for (wIdx = 0; wIdx < pic->img.i_width[plane]; wIdx++) { p_plane[wIdx] = p_buffer[wIdx] << shift_in; } +p_plane += pic->img.i_stride[plane]; +p_buffer += frame->linesize[plane]; } } } static void xavs2_copy_frame(xavs2_picture_t *pic, const AVFrame *frame) { -int plane, hIdx; +uint8_t *p_plane; +uint8_t *p_buffer; +int plane; +int hIdx; +int stride; + for (plane = 0; plane < 3; plane++) { +p_plane = pic->img.img_planes[plane]; +p_buffer = frame->data[plane]; +stride = pic->img.i_width[plane] * pic->img.in_sample_size; for (hIdx = 0; hIdx < pic->img.i_lines[plane]; hIdx++) { -memcpy( pic->img.img_planes[plane] + pic->img.i_stride[plane] * hIdx, -frame->data[plane]+frame->linesize[plane] * hIdx, -pic->img.i_width[plane] * pic->img.in_sample_size); +memcpy(p_plane, p_buffer, stride); +p_plane += pic->img.i_stride[plane]; +p_buffer += frame->linesize[plane]; } } } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] lavc/libxavs2.c: mark key-frame packets
ffmpeg | branch: master | hwren | Mon Jul 27 14:21:35 2020 +0800| [5f8555d156c96d6aa3d42762923311a73b4d469c] | committer: Michael Niedermayer lavc/libxavs2.c: mark key-frame packets Signed-off-by: hwren Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5f8555d156c96d6aa3d42762923311a73b4d469c --- libavcodec/libxavs2.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/libavcodec/libxavs2.c b/libavcodec/libxavs2.c index 76b57e731e..8519f6925a 100644 --- a/libavcodec/libxavs2.c +++ b/libavcodec/libxavs2.c @@ -223,6 +223,12 @@ static int xavs2_encode_frame(AVCodecContext *avctx, AVPacket *pkt, pkt->pts = cae->packet.pts; pkt->dts = cae->packet.dts; +if (cae->packet.type == XAVS2_TYPE_IDR || +cae->packet.type == XAVS2_TYPE_I || +cae->packet.type == XAVS2_TYPE_KEYFRAME) { +pkt->flags |= AV_PKT_FLAG_KEY; +} + memcpy(pkt->data, cae->packet.stream, cae->packet.len); pkt->size = cae->packet.len; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] lavf/avs3dec: add raw avs3 demuxer
ffmpeg | branch: master | hwren | Mon Oct 5 20:10:45 2020 +0800| [ff74ad2a4b51bda9f6ec92fffa09228c408eaa0b] | committer: hwren lavf/avs3dec: add raw avs3 demuxer Signed-off-by: hbj Signed-off-by: hwren > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ff74ad2a4b51bda9f6ec92fffa09228c408eaa0b --- Changelog| 1 + libavformat/Makefile | 1 + libavformat/allformats.c | 1 + libavformat/avs3dec.c| 68 libavformat/version.h| 2 +- 5 files changed, 72 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index 89c235e7fe..49064becb4 100644 --- a/Changelog +++ b/Changelog @@ -32,6 +32,7 @@ version : - Argonaut Games Video decoder - libwavpack encoder removed - ACE demuxer +- AVS3 demuxer version 4.3: diff --git a/libavformat/Makefile b/libavformat/Makefile index e82af409b7..7b1fca0bab 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -125,6 +125,7 @@ OBJS-$(CONFIG_AVR_DEMUXER) += avr.o pcm.o OBJS-$(CONFIG_AVS_DEMUXER) += avs.o voc_packet.o vocdec.o voc.o OBJS-$(CONFIG_AVS2_DEMUXER) += davs2.o rawdec.o OBJS-$(CONFIG_AVS2_MUXER)+= rawenc.o +OBJS-$(CONFIG_AVS3_DEMUXER) += avs3dec.o rawdec.o OBJS-$(CONFIG_BETHSOFTVID_DEMUXER) += bethsoftvid.o OBJS-$(CONFIG_BFI_DEMUXER) += bfi.o OBJS-$(CONFIG_BINK_DEMUXER) += bink.o diff --git a/libavformat/allformats.c b/libavformat/allformats.c index 9d85b8ccc3..3912b60ec3 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -87,6 +87,7 @@ extern AVInputFormat ff_avr_demuxer; extern AVInputFormat ff_avs_demuxer; extern AVInputFormat ff_avs2_demuxer; extern AVOutputFormat ff_avs2_muxer; +extern AVInputFormat ff_avs3_demuxer; extern AVInputFormat ff_bethsoftvid_demuxer; extern AVInputFormat ff_bfi_demuxer; extern AVInputFormat ff_bintext_demuxer; diff --git a/libavformat/avs3dec.c b/libavformat/avs3dec.c new file mode 100644 index 00..253caa7c1d --- /dev/null +++ b/libavformat/avs3dec.c @@ -0,0 +1,68 @@ +/* + * RAW AVS3-P2/IEEE1857.10 video demuxer + * Copyright (c) 2020 Zhenyu Wang + *Bingjie Han + *Huiwen Ren + * + * 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 "libavcodec/avs3.h" +#include "libavcodec/internal.h" +#include "avformat.h" +#include "rawdec.h" + +static int avs3video_probe(const AVProbeData *p) +{ +const uint8_t *ptr = p->buf, *end = p->buf + p->buf_size; +uint32_t code = -1; +uint8_t state = 0; +int pic = 0, seq = 0, slice_pos = 0; +int ret = 0; + +while (ptr < end) { +ptr = avpriv_find_start_code(ptr, end, &code); +state = code & 0xFF; +if ((code & 0xFF00) == 0x100) { +if (state < AVS3_SEQ_START_CODE) { +if (code < slice_pos) +return 0; +slice_pos = code; +} else { +slice_pos = 0; +} +if (state == AVS3_SEQ_START_CODE) { +seq++; +if (*ptr != AVS3_PROFILE_BASELINE_MAIN && *ptr != AVS3_PROFILE_BASELINE_MAIN10) +return 0; +} else if (AVS3_ISPIC(state)) { +pic++; +} else if ((state == AVS3_UNDEF_START_CODE) || + (state > AVS3_VIDEO_EDIT_CODE)) { +return 0; +} +} +} + +if (seq && pic && av_match_ext(p->filename, "avs3")) { +ret = AVPROBE_SCORE_MAX; +} + +return ret; +} + +FF_DEF_RAWVIDEO_DEMUXER(avs3, "raw AVS3-P2/IEEE1857.10", avs3video_probe, "avs3", AV_CODEC_ID_AVS3) diff --git a/libavformat/version.h b/libavformat/version.h index 9bde0c37f9..6a601f0c92 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -32,7 +32,7 @@ // Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium) // Also please add any ticket numbers that you believe might be affected here #define LIBAVFORMAT_VERSION_MAJOR 58 -#define LIBAVFORM
[FFmpeg-cvslog] lavc/avs3.h: add AVS3 related definitions
ffmpeg | branch: master | hwren | Mon Oct 5 20:08:06 2020 +0800| [38fd8044e67e88fb11c80e0b7f5f36787ed64f59] | committer: hwren lavc/avs3.h: add AVS3 related definitions Signed-off-by: hwren > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=38fd8044e67e88fb11c80e0b7f5f36787ed64f59 --- libavcodec/avs3.h | 118 ++ 1 file changed, 118 insertions(+) diff --git a/libavcodec/avs3.h b/libavcodec/avs3.h new file mode 100644 index 00..4189d9b583 --- /dev/null +++ b/libavcodec/avs3.h @@ -0,0 +1,118 @@ +/* + * AVS3 related definitions + * + * Copyright (C) 2020 Huiwen Ren, + * + * 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 + */ + +#ifndef AVCODEC_AVS3_H +#define AVCODEC_AVS3_H + +#define AVS3_NAL_START_CODE 0x01 +#define AVS3_SEQ_START_CODE 0xB0 +#define AVS3_SEQ_END_CODE0xB1 +#define AVS3_USER_DATA_START_CODE0xB2 +#define AVS3_INTRA_PIC_START_CODE0xB3 +#define AVS3_UNDEF_START_CODE0xB4 +#define AVS3_EXTENSION_START_CODE0xB5 +#define AVS3_INTER_PIC_START_CODE0xB6 +#define AVS3_VIDEO_EDIT_CODE 0xB7 +#define AVS3_FIRST_SLICE_START_CODE 0x00 +#define AVS3_PROFILE_BASELINE_MAIN 0x20 +#define AVS3_PROFILE_BASELINE_MAIN10 0x22 + +#define AVS3_ISPIC(x) ((x) == AVS3_INTRA_PIC_START_CODE || (x) == AVS3_INTER_PIC_START_CODE) +#define AVS3_ISUNIT(x) ((x) == AVS3_SEQ_START_CODE || AVS3_ISPIC(x)) + +#include "libavutil/avutil.h" +#include "libavutil/pixfmt.h" +#include "libavutil/rational.h" + +static const AVRational ff_avs3_frame_rate_tab[16] = { +{ 0, 0 }, // forbid +{ 24000, 1001}, +{ 24 , 1 }, +{ 25 , 1 }, +{ 3, 1001}, +{ 30 , 1 }, +{ 50 , 1 }, +{ 6, 1001}, +{ 60 , 1 }, +{ 100 , 1 }, +{ 120 , 1 }, +{ 200 , 1 }, +{ 240 , 1 }, +{ 300 , 1 }, +{ 0, 0 }, // reserved +{ 0, 0 } // reserved +}; + +static const int ff_avs3_color_primaries_tab[10] = { +AVCOL_PRI_RESERVED0 ,// 0 +AVCOL_PRI_BT709 ,// 1 +AVCOL_PRI_UNSPECIFIED ,// 2 +AVCOL_PRI_RESERVED,// 3 +AVCOL_PRI_BT470M ,// 4 +AVCOL_PRI_BT470BG ,// 5 +AVCOL_PRI_SMPTE170M ,// 6 +AVCOL_PRI_SMPTE240M ,// 7 +AVCOL_PRI_FILM,// 8 +AVCOL_PRI_BT2020 // 9 +}; + +static const int ff_avs3_color_transfer_tab[15] = { +AVCOL_TRC_RESERVED0, // 0 +AVCOL_TRC_BT709, // 1 +AVCOL_TRC_UNSPECIFIED , // 2 +AVCOL_TRC_RESERVED , // 3 +AVCOL_TRC_GAMMA22 , // 4 +AVCOL_TRC_GAMMA28 , // 5 +AVCOL_TRC_SMPTE170M, // 6 +AVCOL_TRC_SMPTE240M, // 7 +AVCOL_TRC_LINEAR , // 8 +AVCOL_TRC_LOG , // 9 +AVCOL_TRC_LOG_SQRT , // 10 +AVCOL_TRC_BT2020_12, // 11 +AVCOL_TRC_SMPTE2084, // 12 +AVCOL_TRC_UNSPECIFIED , // 13 +AVCOL_TRC_ARIB_STD_B67 // 14 +}; + +static const int ff_avs3_color_matrix_tab[12] = { +AVCOL_SPC_RESERVED , // 0 +AVCOL_SPC_BT709, // 1 +AVCOL_SPC_UNSPECIFIED , // 2 +AVCOL_SPC_RESERVED , // 3 +AVCOL_SPC_FCC , // 4 +AVCOL_SPC_BT470BG , // 5 +AVCOL_SPC_SMPTE170M, // 6 +AVCOL_SPC_SMPTE240M, // 7 +AVCOL_SPC_BT2020_NCL , // 8 +AVCOL_SPC_BT2020_CL, // 9 +AVCOL_SPC_UNSPECIFIED , // 10 +AVCOL_SPC_UNSPECIFIED// 11 +}; + +static const enum AVPictureType ff_avs3_image_type[4] = { +AV_PICTURE_TYPE_NONE, +AV_PICTURE_TYPE_I, +AV_PICTURE_TYPE_P, +AV_PICTURE_TYPE_B +}; + +#endif /* AVCODEC_AVS3_H */ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] lavc: add AVS3 codec id and desc
ffmpeg | branch: master | hwren | Mon Oct 5 20:07:01 2020 +0800| [8e74d98a29a31c47836248d35cdb198e75a6fc37] | committer: hwren lavc: add AVS3 codec id and desc Signed-off-by: hbj Signed-off-by: hwren > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8e74d98a29a31c47836248d35cdb198e75a6fc37 --- libavcodec/codec_desc.c | 7 +++ libavcodec/codec_id.h | 1 + 2 files changed, 8 insertions(+) diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c index 1246dc2b96..4c81cb8982 100644 --- a/libavcodec/codec_desc.c +++ b/libavcodec/codec_desc.c @@ -1412,6 +1412,13 @@ static const AVCodecDescriptor codec_descriptors[] = { .long_name = NULL_IF_CONFIG_SMALL("PGX (JPEG2000 Test Format)"), .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS, }, +{ +.id= AV_CODEC_ID_AVS3, +.type = AVMEDIA_TYPE_VIDEO, +.name = "avs3", +.long_name = NULL_IF_CONFIG_SMALL("AVS3-P2/IEEE1857.10"), +.props = AV_CODEC_PROP_LOSSY, +}, { .id= AV_CODEC_ID_Y41P, .type = AVMEDIA_TYPE_VIDEO, diff --git a/libavcodec/codec_id.h b/libavcodec/codec_id.h index 21444f9ce3..08c2bbfefb 100644 --- a/libavcodec/codec_id.h +++ b/libavcodec/codec_id.h @@ -242,6 +242,7 @@ enum AVCodecID { AV_CODEC_ID_RSCC, AV_CODEC_ID_AVS2, AV_CODEC_ID_PGX, +AV_CODEC_ID_AVS3, AV_CODEC_ID_Y41P = 0x8000, AV_CODEC_ID_AVRP, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] lavf/avs2dec.c: optimize code style
ffmpeg | branch: master | hwren | Mon Oct 5 23:56:10 2020 +0800| [1e97fbb3b67a9a105dc331c1989fa90f7dce76a4] | committer: hwren lavf/avs2dec.c: optimize code style Signed-off-by: hwren > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1e97fbb3b67a9a105dc331c1989fa90f7dce76a4 --- libavformat/avs2dec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavformat/avs2dec.c b/libavformat/avs2dec.c index f8337ea500..51908d2b63 100644 --- a/libavformat/avs2dec.c +++ b/libavformat/avs2dec.c @@ -33,9 +33,9 @@ static int avs2_probe(const AVProbeData *p) { -uint32_t code= -1, hds=0, pic=0, seq=0; -uint8_t state=0; -const uint8_t *ptr = p->buf, *end = p->buf + p->buf_size, *sqb=0; +uint32_t code = -1, hds = 0, pic = 0, seq = 0; +uint8_t state = 0; +const uint8_t *ptr = p->buf, *end = p->buf + p->buf_size, *sqb = 0; if (AV_RB32(p->buf) != 0x1B0){ return 0; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] lavf/davs2.c: rename as avs2dec.c for better understanding
ffmpeg | branch: master | hwren | Thu Aug 20 14:52:15 2020 +0800| [b15e875c8ca4b77b7989d43f7e2a79f86b33b233] | committer: hwren lavf/davs2.c: rename as avs2dec.c for better understanding Signed-off-by: hwren > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b15e875c8ca4b77b7989d43f7e2a79f86b33b233 --- libavformat/Makefile | 2 +- libavformat/{davs2.c => avs2dec.c} | 0 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/Makefile b/libavformat/Makefile index 7b1fca0bab..a5e8bddb87 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -123,7 +123,7 @@ OBJS-$(CONFIG_AVI_MUXER) += avienc.o mpegtsenc.o avlanguage.o ra OBJS-$(CONFIG_AVM2_MUXER)+= swfenc.o swf.o OBJS-$(CONFIG_AVR_DEMUXER) += avr.o pcm.o OBJS-$(CONFIG_AVS_DEMUXER) += avs.o voc_packet.o vocdec.o voc.o -OBJS-$(CONFIG_AVS2_DEMUXER) += davs2.o rawdec.o +OBJS-$(CONFIG_AVS2_DEMUXER) += avs2dec.o rawdec.o OBJS-$(CONFIG_AVS2_MUXER)+= rawenc.o OBJS-$(CONFIG_AVS3_DEMUXER) += avs3dec.o rawdec.o OBJS-$(CONFIG_BETHSOFTVID_DEMUXER) += bethsoftvid.o diff --git a/libavformat/davs2.c b/libavformat/avs2dec.c similarity index 100% rename from libavformat/davs2.c rename to libavformat/avs2dec.c ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] lavc/avs3_parser: add avs3 parser
ffmpeg | branch: master | hwren | Mon Oct 5 20:09:20 2020 +0800| [6223d77578df8146596c878c96e243095fb9e201] | committer: hwren lavc/avs3_parser: add avs3 parser Signed-off-by: hbj Signed-off-by: hwren > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6223d77578df8146596c878c96e243095fb9e201 --- libavcodec/Makefile | 1 + libavcodec/avs3_parser.c | 179 +++ libavcodec/parsers.c | 1 + 3 files changed, 181 insertions(+) diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 0d2f7960a9..3ac7fa96c4 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -1066,6 +1066,7 @@ OBJS-$(CONFIG_AC3_PARSER) += ac3tab.o aac_ac3_parser.o OBJS-$(CONFIG_ADX_PARSER) += adx_parser.o adx.o OBJS-$(CONFIG_AV1_PARSER) += av1_parser.o av1_parse.o OBJS-$(CONFIG_AVS2_PARSER) += avs2_parser.o +OBJS-$(CONFIG_AVS3_PARSER) += avs3_parser.o OBJS-$(CONFIG_BMP_PARSER) += bmp_parser.o OBJS-$(CONFIG_CAVSVIDEO_PARSER)+= cavs_parser.o OBJS-$(CONFIG_COOK_PARSER) += cook_parser.o diff --git a/libavcodec/avs3_parser.c b/libavcodec/avs3_parser.c new file mode 100644 index 00..bf97f75db6 --- /dev/null +++ b/libavcodec/avs3_parser.c @@ -0,0 +1,179 @@ +/* + * AVS3-P2/IEEE1857.10 video parser. + * Copyright (c) 2020 Zhenyu Wang + *Bingjie Han + *Huiwen Ren + * + * 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 "avs3.h" +#include "get_bits.h" +#include "parser.h" + +static int avs3_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size) +{ +int pic_found = pc->frame_start_found; +uint32_t state = pc->state; +int cur = 0; + +if (!pic_found) { +for (; cur < buf_size; ++cur) { +state = (state << 8) | buf[cur]; +if (AVS3_ISPIC(buf[cur])){ +cur++; +pic_found = 1; +break; +} +} +} + +if (pic_found) { +if (!buf_size) +return END_NOT_FOUND; +for (; cur < buf_size; ++cur) { +state = (state << 8) | buf[cur]; +if ((state & 0xFF00) == 0x100 && AVS3_ISUNIT(state & 0xFF)) { +pc->frame_start_found = 0; +pc->state = -1; +return cur - 3; +} +} +} + +pc->frame_start_found = pic_found; +pc->state = state; + +return END_NOT_FOUND; +} + +static void parse_avs3_nal_units(AVCodecParserContext *s, const uint8_t *buf, + int buf_size, AVCodecContext *avctx) +{ +if (buf_size < 5) { +return; +} + +if (buf[0] == 0x0 && buf[1] == 0x0 && buf[2] == 0x1) { +if (buf[3] == AVS3_SEQ_START_CODE) { +GetBitContext gb; +int profile, ratecode; + +init_get_bits(&gb, buf + 4, buf_size - 4); + +s->key_frame = 1; +s->pict_type = AV_PICTURE_TYPE_I; + +profile = get_bits(&gb, 8); +// Skip bits: level(8) +//progressive(1) +//field(1) +//library(2) +//resv(1) +//width(14) +//resv(1) +//height(14) +//chroma(2) +//sampe_precision(3) +skip_bits(&gb, 47); + +if (profile == AVS3_PROFILE_BASELINE_MAIN10) { +int sample_precision = get_bits(&gb, 3); +if (sample_precision == 1) { +avctx->pix_fmt = AV_PIX_FMT_YUV420P; +} else if (sample_precision == 2) { +avctx->pix_fmt = AV_PIX_FMT_YUV420P10LE; +} else { +avctx->pix_fmt = AV_PIX_FMT_NONE; +} +} + +// Skip bits: resv(1) +//aspect(4) +skip_bits(&gb, 5); + +ratecode = get_bits(&gb, 4); + +
[FFmpeg-cvslog] lavc/avs2_parser.c: optimize code style
ffmpeg | branch: master | hwren | Thu Aug 20 14:58:52 2020 +0800| [de0a5558984e69877e516bfcc1b4e2cb9a7e9bbc] | committer: hwren lavc/avs2_parser.c: optimize code style Signed-off-by: hwren > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=de0a5558984e69877e516bfcc1b4e2cb9a7e9bbc --- libavcodec/avs2_parser.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/avs2_parser.c b/libavcodec/avs2_parser.c index 02af08f079..54f687142f 100644 --- a/libavcodec/avs2_parser.c +++ b/libavcodec/avs2_parser.c @@ -34,9 +34,9 @@ static int avs2_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_siz if (!pic_found) { for (; cur < buf_size; ++cur) { -state = (state<<8) | buf[cur]; +state = (state << 8) | buf[cur]; if (AVS2_ISUNIT(buf[cur])){ -++cur; +cur++; pic_found = 1; break; } @@ -46,7 +46,7 @@ static int avs2_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_siz if (pic_found) { if (!buf_size) return END_NOT_FOUND; -for (; cur < buf_size; ++cur) { +for (; cur < buf_size; cur++) { state = (state << 8) | buf[cur]; if ((state & 0xFF00) == 0x100 && state > AVS2_SLICE_MAX_START_CODE) { pc->frame_start_found = 0; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] lavc,doc: add libuavs3d video decoder wrapper
ffmpeg | branch: master | hwren | Mon Oct 5 20:16:25 2020 +0800| [c952db9d68d31d1eca5ac770cc53bf35b885b087] | committer: hwren lavc,doc: add libuavs3d video decoder wrapper Signed-off-by: hbj Signed-off-by: hwren > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c952db9d68d31d1eca5ac770cc53bf35b885b087 --- Changelog | 1 + configure | 4 + doc/decoders.texi | 21 libavcodec/Makefile| 1 + libavcodec/allcodecs.c | 1 + libavcodec/libuavs3d.c | 262 + libavcodec/version.h | 2 +- 7 files changed, 291 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index 49064becb4..643563b98b 100644 --- a/Changelog +++ b/Changelog @@ -33,6 +33,7 @@ version : - libwavpack encoder removed - ACE demuxer - AVS3 demuxer +- AVS3 video decoder via libuavs3d version 4.3: diff --git a/configure b/configure index 3ce4644cb4..1c36a8dfca 100755 --- a/configure +++ b/configure @@ -277,6 +277,7 @@ External library support: --enable-libtls enable LibreSSL (via libtls), needed for https support if openssl, gnutls or mbedtls is not used [no] --enable-libtwolame enable MP2 encoding via libtwolame [no] + --enable-libuavs3d enable AVS3 decoding via libuavs3d [no] --enable-libv4l2 enable libv4l2/v4l-utils [no] --enable-libvidstab enable video stabilization using vid.stab [no] --enable-libvmaf enable vmaf filter via libvmaf [no] @@ -1810,6 +1811,7 @@ EXTERNAL_LIBRARY_LIST=" libtesseract libtheora libtwolame +libuavs3d libv4l2 libvmaf libvorbis @@ -3255,6 +3257,7 @@ libspeex_encoder_select="audio_frame_queue" libsvtav1_encoder_deps="libsvtav1" libtheora_encoder_deps="libtheora" libtwolame_encoder_deps="libtwolame" +libuavs3d_decoder_deps="libuavs3d" libvo_amrwbenc_encoder_deps="libvo_amrwbenc" libvorbis_decoder_deps="libvorbis" libvorbis_encoder_deps="libvorbis libvorbisenc" @@ -6406,6 +6409,7 @@ enabled libtls&& require_pkg_config libtls libtls tls.h tls_configur enabled libtwolame&& require libtwolame twolame.h twolame_init -ltwolame && { check_lib libtwolame twolame.h twolame_encode_buffer_float32_interleaved -ltwolame || die "ERROR: libtwolame must be installed and version must be >= 0.3.10"; } +enabled libuavs3d && require_pkg_config libuavs3d "uavs3d >= 1.1.41" uavs3d.h uavs3d_decode enabled libv4l2 && require_pkg_config libv4l2 libv4l2 libv4l2.h v4l2_ioctl enabled libvidstab&& require_pkg_config libvidstab "vidstab >= 0.98" vid.stab/libvidstab.h vsMotionDetectInit enabled libvmaf && require_pkg_config libvmaf "libvmaf >= 1.5.2" libvmaf.h compute_vmaf diff --git a/doc/decoders.texi b/doc/decoders.texi index 8649f83e28..bfab562fb2 100644 --- a/doc/decoders.texi +++ b/doc/decoders.texi @@ -88,6 +88,27 @@ This decoder allows libavcodec to decode AVS2 streams with davs2 library. @c man end VIDEO DECODERS +@section libuavs3d + +AVS3-P2/IEEE1857.10 video decoder. + +libuavs3d allows libavcodec to decode AVS3 streams. +Requires the presence of the libuavs3d headers and library during configuration. +You need to explicitly configure the build with @code{--enable-libuavs3d}. + +@subsection Options + +The following option is supported by the libuavs3d wrapper. + +@table @option + +@item frame_threads +Set amount of frame threads to use during decoding. The default value is 0 (autodetect). + +@end table + +@c man end VIDEO DECODERS + @chapter Audio Decoders @c man begin AUDIO DECODERS diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 3ac7fa96c4..421aec984a 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -1040,6 +1040,7 @@ OBJS-$(CONFIG_LIBSPEEX_ENCODER) += libspeexenc.o OBJS-$(CONFIG_LIBSVTAV1_ENCODER) += libsvtav1.o OBJS-$(CONFIG_LIBTHEORA_ENCODER) += libtheoraenc.o OBJS-$(CONFIG_LIBTWOLAME_ENCODER) += libtwolame.o +OBJS-$(CONFIG_LIBUAVS3D_DECODER) += libuavs3d.o OBJS-$(CONFIG_LIBVO_AMRWBENC_ENCODER) += libvo-amrwbenc.o OBJS-$(CONFIG_LIBVORBIS_DECODER) += libvorbisdec.o OBJS-$(CONFIG_LIBVORBIS_ENCODER) += libvorbisenc.o \ diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index 1953cd86c1..f055aea207 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -739,6 +739,7 @@ extern AVCodec ff_libspeex_decoder; extern AVCodec ff_libsvtav1_encoder; extern AVCodec ff_libtheora_encoder; extern AVCodec ff_libtwolame_encoder; +extern AVCodec ff_libuavs3d_decoder; extern AVCodec ff_libvo_amrwbenc_encoder; extern AVCodec ff_libvorbis_enco
[FFmpeg-cvslog] lavc/avs2_parser.c,lavf/davs2.c: add AVS2_* prefix
ffmpeg | branch: master | hwren | Thu Aug 20 14:47:42 2020 +0800| [026be690e65c18bfb30413c0bc31e3a92ec5dcc6] | committer: hwren lavc/avs2_parser.c,lavf/davs2.c: add AVS2_* prefix Add AVS2_* prefix to macro definitions to avoid confusion Signed-off-by: hwren > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=026be690e65c18bfb30413c0bc31e3a92ec5dcc6 --- libavcodec/avs2_parser.c | 10 +- libavformat/davs2.c | 20 ++-- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/libavcodec/avs2_parser.c b/libavcodec/avs2_parser.c index 1c9b3423ff..02af08f079 100644 --- a/libavcodec/avs2_parser.c +++ b/libavcodec/avs2_parser.c @@ -21,10 +21,10 @@ #include "parser.h" -#define SLICE_MAX_START_CODE0x01af +#define AVS2_SLICE_MAX_START_CODE 0x01AF -#define ISPIC(x) ((x) == 0xB3 || (x) == 0xB6) -#define ISUNIT(x) ((x) == 0xB0 || (x) == 0xB1 || (x) == 0xB2 || ISPIC(x)) +#define AVS2_ISPIC(x) ((x) == 0xB3 || (x) == 0xB6) +#define AVS2_ISUNIT(x) ((x) == 0xB0 || (x) == 0xB1 || (x) == 0xB2 || AVS2_ISPIC(x)) static int avs2_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size) { @@ -35,7 +35,7 @@ static int avs2_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_siz if (!pic_found) { for (; cur < buf_size; ++cur) { state = (state<<8) | buf[cur]; -if (ISUNIT(buf[cur])){ +if (AVS2_ISUNIT(buf[cur])){ ++cur; pic_found = 1; break; @@ -48,7 +48,7 @@ static int avs2_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_siz return END_NOT_FOUND; for (; cur < buf_size; ++cur) { state = (state << 8) | buf[cur]; -if ((state & 0xFF00) == 0x100 && state > SLICE_MAX_START_CODE) { +if ((state & 0xFF00) == 0x100 && state > AVS2_SLICE_MAX_START_CODE) { pc->frame_start_found = 0; pc->state = -1; return cur - 3; diff --git a/libavformat/davs2.c b/libavformat/davs2.c index 59f41fd499..f8337ea500 100644 --- a/libavformat/davs2.c +++ b/libavformat/davs2.c @@ -25,11 +25,11 @@ #include "libavcodec/internal.h" #include "libavutil/intreadwrite.h" -#define ISSQH(x) ((x) == 0xB0 ) -#define ISEND(x) ((x) == 0xB1 ) -#define ISPIC(x) ((x) == 0xB3 || (x) == 0xB6) -#define ISUNIT(x) ( ISSQH(x) || ISEND(x) || (x) == 0xB2 || ISPIC(x) || (x) == 0xB5 || (x) == 0xB7 ) -#define ISAVS2(x) ((x) == 0x20 || (x) == 0x22 || (x) == 0x30 || (x) == 0x32 ) +#define AVS2_ISSQH(x) ((x) == 0xB0) +#define AVS2_ISEND(x) ((x) == 0xB1) +#define AVS2_ISPIC(x) ((x) == 0xB3 || (x) == 0xB6) +#define AVS2_ISUNIT(x) (AVS2_ISSQH(x) || AVS2_ISEND(x) || (x) == 0xB2 || AVS2_ISPIC(x) || (x) == 0xB5 || (x) == 0xB7) +#define AVS2_ISPROFILE(x) ((x) == 0x20 || (x) == 0x22 || (x) == 0x30 || (x) == 0x32) static int avs2_probe(const AVProbeData *p) { @@ -44,18 +44,18 @@ static int avs2_probe(const AVProbeData *p) ptr = avpriv_find_start_code(ptr, end, &code); state = code & 0xFF; if ((code & 0xff00) == 0x100) { -if (ISUNIT(state)) { +if (AVS2_ISUNIT(state)) { if (sqb && !hds) { hds = ptr - sqb; } -if (ISSQH(state)) { -if (!ISAVS2(*ptr)) +if (AVS2_ISSQH(state)) { +if (!AVS2_ISPROFILE(*ptr)) return 0; sqb = ptr; seq++; -} else if (ISPIC(state)) { +} else if (AVS2_ISPIC(state)) { pic++; -} else if (ISEND(state)) { +} else if (AVS2_ISEND(state)) { break; } } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] doc/general_contents.texi: add uavs3d section
ffmpeg | branch: master | hwren | Tue Oct 6 15:02:00 2020 +0800| [682990a849ae7cd56e510a910845726c801eb8cd] | committer: hwren doc/general_contents.texi: add uavs3d section Signed-off-by: hwren > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=682990a849ae7cd56e510a910845726c801eb8cd --- doc/general_contents.texi | 10 ++ 1 file changed, 10 insertions(+) diff --git a/doc/general_contents.texi b/doc/general_contents.texi index 598e0e74da..f441a75ee9 100644 --- a/doc/general_contents.texi +++ b/doc/general_contents.texi @@ -119,6 +119,14 @@ libdavs2 is under the GNU Public License Version 2 or later details), you must upgrade FFmpeg's license to GPL in order to use it. @end float +@section uavs3d + +FFmpeg can make use of the uavs3d library for AVS3-P2/IEEE1857.10 video decoding. + +Go to @url{https://github.com/uavs3/uavs3d} and follow the instructions for +installing the library. Then pass @code{--enable-libuavs3d} to configure to +enable it. + @section Game Music Emu FFmpeg can make use of the Game Music Emu library to read audio from supported video game @@ -816,6 +824,8 @@ following image formats are supported: @tab Video encoding used by the Creature Shock game. @item AVS2-P2/IEEE1857.4 @tab E @tab E @tab Supported through external libraries libxavs2 and libdavs2 +@item AVS3-P2/IEEE1857.10@tab @tab E +@tab Supported through external library libuavs3d @item AYUV @tab X @tab X @tab Microsoft uncompressed packed 4:4:4:4 @item Beam Software VB @tab @tab X ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] MAINTAINERS: add AVS2 section
ffmpeg | branch: master | hwren | Sat Jul 28 11:20:48 2018 +0800| [3016e1f8c53d2b035810684a18159bf5a8d47399] | committer: Michael Niedermayer MAINTAINERS: add AVS2 section Signed-off-by: hwren Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3016e1f8c53d2b035810684a18159bf5a8d47399 --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index bc2ae13320..799d12f09b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -143,6 +143,7 @@ Codecs: asv* Michael Niedermayer atrac3plus* Maxim Poliakovski audiotoolbox* Rodger Combs + avs2* Huiwen Ren bgmc.c, bgmc.hThilo Borgmann binkaudio.c Peter Ross cavs* Stefan Gehrer @@ -189,6 +190,7 @@ Codecs: libcelt_dec.c Nicolas George libcodec2.c Tomas Härdin libdirac* David Conrad + libdavs2.cHuiwen Ren libgsm.c Michel Bardiaux libkvazaar.c Arttu Ylä-Outinen libopenjpeg.c Jaikrishnan Menon ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavc/libdavs2: fix parameter setting error
ffmpeg | branch: master | hwren | Thu Jan 24 23:16:18 2019 +0800| [ff03418348dda5b8353e5fdcf7c7ff75472b6074] | committer: Jun Zhao lavc/libdavs2: fix parameter setting error Signed-off-by: hwrenx > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ff03418348dda5b8353e5fdcf7c7ff75472b6074 --- libavcodec/libdavs2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c index cf7565659c..080872195a 100644 --- a/libavcodec/libdavs2.c +++ b/libavcodec/libdavs2.c @@ -45,9 +45,9 @@ static av_cold int davs2_init(AVCodecContext *avctx) /* init the decoder */ cad->param.threads = avctx->thread_count; cad->param.info_level = 0; -cad->decoder= davs2_decoder_open(&cad->param); cad->param.disable_avx = !(cpu_flags & AV_CPU_FLAG_AVX && cpu_flags & AV_CPU_FLAG_AVX2); +cad->decoder= davs2_decoder_open(&cad->param); if (!cad->decoder) { av_log(avctx, AV_LOG_ERROR, "decoder created error."); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavc/libxavs2: use upper layer qp parameters first
ffmpeg | branch: master | hwren | Thu Jan 24 23:16:17 2019 +0800| [11751f62520b0b5a575abb5a8ce061a727eb2668] | committer: Jun Zhao lavc/libxavs2: use upper layer qp parameters first Signed-off-by: hwrenx > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=11751f62520b0b5a575abb5a8ce061a727eb2668 --- libavcodec/libxavs2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/libxavs2.c b/libavcodec/libxavs2.c index 2d294272a2..d5c455797d 100644 --- a/libavcodec/libxavs2.c +++ b/libavcodec/libxavs2.c @@ -109,8 +109,8 @@ static av_cold int xavs2_init(AVCodecContext *avctx) xavs2_opt_set2("RateControl", "%d", 1); xavs2_opt_set2("TargetBitRate", "%"PRId64"", avctx->bit_rate); xavs2_opt_set2("InitialQP", "%d", cae->initial_qp); -xavs2_opt_set2("MaxQP", "%d", cae->max_qp); -xavs2_opt_set2("MinQP", "%d", cae->min_qp); +xavs2_opt_set2("MaxQP", "%d", avctx->qmax >= 0 ? avctx->qmax : cae->max_qp); +xavs2_opt_set2("MinQP", "%d", avctx->qmin >= 0 ? avctx->qmin : cae->min_qp); } else { xavs2_opt_set2("InitialQP", "%d", cae->qp); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavc/libxavs2: remove unused context parameter
ffmpeg | branch: master | hwren | Thu Jan 24 23:16:16 2019 +0800| [8754147db668f55a4ba3e5c27929a6cda747d1dd] | committer: Jun Zhao lavc/libxavs2: remove unused context parameter Signed-off-by: hwrenx > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8754147db668f55a4ba3e5c27929a6cda747d1dd --- libavcodec/libxavs2.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libavcodec/libxavs2.c b/libavcodec/libxavs2.c index 52c50a119f..2d294272a2 100644 --- a/libavcodec/libxavs2.c +++ b/libavcodec/libxavs2.c @@ -46,7 +46,6 @@ typedef struct XAVS2EContext { int min_qp; int preset_level; int log_level; -int hierarchical_reference; void *encoder; char *xavs2_opts; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog