[FFmpeg-cvslog] avcodec/psd: fix ugly typo
ffmpeg | branch: master | Paul B Mahol | Wed Jan 11 11:42:50 2017 +0100| [45cd50e5e24e991634b69d3869f2f336ca0ca612] | committer: Paul B Mahol avcodec/psd: fix ugly typo Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=45cd50e5e24e991634b69d3869f2f336ca0ca612 --- libavcodec/psd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/psd.c b/libavcodec/psd.c index e6ec896..4d6b0e3 100644 --- a/libavcodec/psd.c +++ b/libavcodec/psd.c @@ -356,7 +356,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, } break; case PSD_DUOTONE: -av_log(avctx, AV_LOG_WARNING, "ignoring unknwon duotone specification.\n"); +av_log(avctx, AV_LOG_WARNING, "ignoring unknown duotone specification.\n"); case PSD_GRAYSCALE: if (s->channel_count == 1) { if (s->channel_depth == 8) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/wmaprodec: do not force extradata presence for XMA
ffmpeg | branch: master | Paul B Mahol | Wed Jan 11 11:38:56 2017 +0100| [107b3064d8bf783c64f488f17c1f485dd72653e7] | committer: Paul B Mahol avcodec/wmaprodec: do not force extradata presence for XMA Mainly useful for supporting decoding of headerless files. Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=107b3064d8bf783c64f488f17c1f485dd72653e7 --- libavcodec/wmaprodec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c index d06e3b7..105e279 100644 --- a/libavcodec/wmaprodec.c +++ b/libavcodec/wmaprodec.c @@ -322,12 +322,12 @@ static av_cold int decode_init(AVCodecContext *avctx) for (i = 0; i < avctx->extradata_size; i++) av_log(avctx, AV_LOG_DEBUG, "[%x] ", avctx->extradata[i]); av_log(avctx, AV_LOG_DEBUG, "\n"); -if (avctx->codec_id == AV_CODEC_ID_XMA2 && avctx->extradata_size >= 34) { +if (avctx->codec_id == AV_CODEC_ID_XMA2 && (!avctx->extradata || avctx->extradata_size >= 6)) { s->decode_flags= 0x10d6; -channel_mask = AV_RL32(edata_ptr+2); +channel_mask = avctx->extradata ? AV_RL32(edata_ptr+2) : 0; s->bits_per_sample = 16; - } else if (avctx->codec_id == AV_CODEC_ID_XMA1 && avctx->extradata_size >= 28) { + } else if (avctx->codec_id == AV_CODEC_ID_XMA1) { s->decode_flags= 0x10d6; s->bits_per_sample = 16; channel_mask = 0; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec: add Newtek SpeedHQ decoder
ffmpeg | branch: master | Steinar H. Gunderson | Sun Jan 8 12:07:09 2017 +0100| [2a293ec7ac72723b5f07aa804bb981ce1de35b82] | committer: Paul B Mahol avcodec: add Newtek SpeedHQ decoder This decoder can decode all existing SpeedHQ formats (SHQ0–5, 7, and 9), including correct decoding of the alpha channel. 1080p is decoded in 142 fps on one core of my i7-4600U (2.1 GHz Haswell), about evenly split between bitstream reader and IDCT. There is currently no attempt at slice or frame threading, even though the format trivially supports both. NewTek very helpfully provided a full set of SHQ samples, as well as source code for an SHQ2 encoder (not included) and assistance with understanding some details of the format. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2a293ec7ac72723b5f07aa804bb981ce1de35b82 --- Changelog | 1 + libavcodec/Makefile | 1 + libavcodec/allcodecs.c | 1 + libavcodec/avcodec.h| 1 + libavcodec/codec_desc.c | 7 + libavcodec/get_bits.h | 14 + libavcodec/mpeg12.c | 15 +- libavcodec/mpeg12.h | 9 + libavcodec/speedhq.c| 659 libavcodec/version.h| 4 +- libavcodec/vlc.h| 9 + libavformat/riff.c | 8 + 12 files changed, 716 insertions(+), 13 deletions(-) diff --git a/Changelog b/Changelog index e09bf20..e15d8e2 100644 --- a/Changelog +++ b/Changelog @@ -13,6 +13,7 @@ version : - 24.0 floating point pcm decoder - Apple Pixlet decoder - QDMC audio decoder +- NewTek SpeedHQ decoder version 3.2: - libopenmpt demuxer diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 44e416e..7864079 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -521,6 +521,7 @@ OBJS-$(CONFIG_SOL_DPCM_DECODER)+= dpcm.o OBJS-$(CONFIG_SONIC_DECODER) += sonic.o OBJS-$(CONFIG_SONIC_ENCODER) += sonic.o OBJS-$(CONFIG_SONIC_LS_ENCODER)+= sonic.o +OBJS-$(CONFIG_SPEEDHQ_DECODER) += speedhq.o simple_idct.o OBJS-$(CONFIG_SP5X_DECODER)+= sp5xdec.o OBJS-$(CONFIG_SRT_DECODER) += srtdec.o ass.o htmlsubtitles.o OBJS-$(CONFIG_SRT_ENCODER) += srtenc.o ass_split.o diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index 4540ef7..22a93f3 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -316,6 +316,7 @@ void avcodec_register_all(void) REGISTER_DECODER(SMVJPEG, smvjpeg); REGISTER_ENCDEC (SNOW, snow); REGISTER_DECODER(SP5X, sp5x); +REGISTER_DECODER(SPEEDHQ, speedhq); REGISTER_ENCDEC (SUNRAST, sunrast); REGISTER_ENCDEC (SVQ1, svq1); REGISTER_DECODER(SVQ3, svq3); diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index ca8b786..4d26d14 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -413,6 +413,7 @@ enum AVCodecID { AV_CODEC_ID_YLC, AV_CODEC_ID_PSD, AV_CODEC_ID_PIXLET, +AV_CODEC_ID_SPEEDHQ, /* various PCM "codecs" */ AV_CODEC_ID_FIRST_AUDIO = 0x1, ///< A dummy id pointing at the start of audio codecs diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c index e7ef368..09d3c48 100644 --- a/libavcodec/codec_desc.c +++ b/libavcodec/codec_desc.c @@ -1291,6 +1291,13 @@ static const AVCodecDescriptor codec_descriptors[] = { .props = AV_CODEC_PROP_LOSSLESS, }, { +.id= AV_CODEC_ID_SPEEDHQ, +.type = AVMEDIA_TYPE_VIDEO, +.name = "speedhq", +.long_name = NULL_IF_CONFIG_SMALL("NewTek SpeedHQ"), +.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY, +}, +{ .id= AV_CODEC_ID_WRAPPED_AVFRAME, .type = AVMEDIA_TYPE_VIDEO, .name = "wrapped_avframe", diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h index c094a14..c530015 100644 --- a/libavcodec/get_bits.h +++ b/libavcodec/get_bits.h @@ -229,6 +229,20 @@ static inline int get_xbits(GetBitContext *s, int n) return (NEG_USR32(sign ^ cache, n) ^ sign) - sign; } +static inline int get_xbits_le(GetBitContext *s, int n) +{ +register int sign; +register int32_t cache; +OPEN_READER(re, s); +av_assert2(n>0 && n<=25); +UPDATE_CACHE_LE(re, s); +cache = GET_CACHE(re, s); +sign = sign_extend(~cache, n) >> 31; +LAST_SKIP_BITS(re, s, n); +CLOSE_READER(re, s); +return (zero_extend(sign ^ cache, n) ^ sign) - sign; +} + static inline int get_sbits(GetBitContext *s, int n) { register int tmp; diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index a61d45b..ab6c19c 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -67,20 +67,13 @@ static const uint8_t table_mb_btype[11][2] = { { 2, 5 }, // 0x1E MB_QUANT|MB_FOR|MB_BACK|MB_PAT }; -#define INIT_2D_VLC_RL(rl, static_size)\ -{\ -static RL_VLC_ELEM rl_vlc_table[static_size];\ -rl.rl_vlc[0] =
[FFmpeg-cvslog] avcodec: move bitswap_32() into a header file
ffmpeg | branch: master | Steinar H. Gunderson | Sun Jan 8 14:14:54 2017 +0100| [eaff1aa09e90e2711207c9463db8bf8e8dec8178] | committer: Paul B Mahol avcodec: move bitswap_32() into a header file Allows more codecs than mpeg12video to make use of it. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=eaff1aa09e90e2711207c9463db8bf8e8dec8178 --- libavcodec/bitstream.c | 8 libavcodec/mathops.h | 8 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c index 6c8dca1..c266500 100644 --- a/libavcodec/bitstream.c +++ b/libavcodec/bitstream.c @@ -128,14 +128,6 @@ static int alloc_table(VLC *vlc, int size, int use_static) return index; } -static av_always_inline uint32_t bitswap_32(uint32_t x) -{ -return (uint32_t)ff_reverse[ x& 0xFF] << 24 | - (uint32_t)ff_reverse[(x >> 8) & 0xFF] << 16 | - (uint32_t)ff_reverse[(x >> 16) & 0xFF] << 8 | - (uint32_t)ff_reverse[ x >> 24]; -} - typedef struct VLCcode { uint8_t bits; uint16_t symbol; diff --git a/libavcodec/mathops.h b/libavcodec/mathops.h index 5168dc2..958132d 100644 --- a/libavcodec/mathops.h +++ b/libavcodec/mathops.h @@ -249,4 +249,12 @@ static inline int8_t ff_u8_to_s8(uint8_t a) return b.s8; } +static av_always_inline uint32_t bitswap_32(uint32_t x) +{ +return (uint32_t)ff_reverse[ x& 0xFF] << 24 | + (uint32_t)ff_reverse[(x >> 8) & 0xFF] << 16 | + (uint32_t)ff_reverse[(x >> 16) & 0xFF] << 8 | + (uint32_t)ff_reverse[ x >> 24]; +} + #endif /* AVCODEC_MATHOPS_H */ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] hevc: Mark as having threadsafe init
ffmpeg | branch: master | Derek Buitenhuis | Tue Jan 10 13:24:27 2017 -0500| [14b9060160e453398d01ca767c0f8ace9fb4b5e3] | committer: Derek Buitenhuis hevc: Mark as having threadsafe init Signed-off-by: Derek Buitenhuis > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=14b9060160e453398d01ca767c0f8ace9fb4b5e3 --- libavcodec/hevc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c index 7c563a3..607a8da 100644 --- a/libavcodec/hevc.c +++ b/libavcodec/hevc.c @@ -3416,5 +3416,6 @@ AVCodec ff_hevc_decoder = { .init_thread_copy = hevc_init_thread_copy, .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, .profiles = NULL_IF_CONFIG_SMALL(ff_hevc_profiles), }; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavf/dss: Support version 3 files / files with larger header.
ffmpeg | branch: master | Carl Eugen Hoyos | Wed Jan 11 13:23:13 2017 +0100| [f55da2200dbf98311969e0f345edbc82177d4836] | committer: Carl Eugen Hoyos lavf/dss: Support version 3 files / files with larger header. Fixes ticket #6072. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f55da2200dbf98311969e0f345edbc82177d4836 --- libavformat/dss.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/libavformat/dss.c b/libavformat/dss.c index 2f7f20d..cbf6e17 100644 --- a/libavformat/dss.c +++ b/libavformat/dss.c @@ -42,7 +42,6 @@ #define DSS_COMMENT_SIZE 64 #define DSS_BLOCK_SIZE512 -#define DSS_HEADER_SIZE (DSS_BLOCK_SIZE * 2) #define DSS_AUDIO_BLOCK_HEADER_SIZE 6 #define DSS_FRAME_SIZE42 @@ -56,11 +55,13 @@ typedef struct DSSDemuxContext { int8_t *dss_sp_buf; int packet_size; +int dss_header_size; } DSSDemuxContext; static int dss_probe(AVProbeData *p) { -if (AV_RL32(p->buf) != MKTAG(0x2, 'd', 's', 's')) +if ( AV_RL32(p->buf) != MKTAG(0x2, 'd', 's', 's') +&& AV_RL32(p->buf) != MKTAG(0x3, 'd', 's', 's')) return 0; return AVPROBE_SCORE_MAX; @@ -120,12 +121,15 @@ static int dss_read_header(AVFormatContext *s) DSSDemuxContext *ctx = s->priv_data; AVIOContext *pb = s->pb; AVStream *st; -int ret; +int ret, version; st = avformat_new_stream(s, NULL); if (!st) return AVERROR(ENOMEM); +version = avio_r8(pb); +ctx->dss_header_size = version * DSS_BLOCK_SIZE; + ret = dss_read_metadata_string(s, DSS_HEAD_OFFSET_AUTHOR, DSS_AUTHOR_SIZE, "author"); if (ret) @@ -164,7 +168,7 @@ static int dss_read_header(AVFormatContext *s) /* Jump over header */ -if (avio_seek(pb, DSS_HEADER_SIZE, SEEK_SET) != DSS_HEADER_SIZE) +if (avio_seek(pb, ctx->dss_header_size, SEEK_SET) != ctx->dss_header_size) return AVERROR(EIO); ctx->counter = 0; @@ -361,7 +365,7 @@ static int dss_read_seek(AVFormatContext *s, int stream_index, if (seekto < 0) seekto = 0; -seekto += DSS_HEADER_SIZE; +seekto += ctx->dss_header_size; ret = avio_seek(s->pb, seekto, SEEK_SET); if (ret < 0) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] ffmpeg: Add an option "qsv_device" to choose proper node for QSV child device (vaapi or dxva2)
ffmpeg | branch: master | Zhengxu | Thu Jan 5 14:48:06 2017 +0800| [1a79b8f8d2b5d26c60c237d6e585873238e46914] | committer: Mark Thompson ffmpeg: Add an option "qsv_device" to choose proper node for QSV child device (vaapi or dxva2) Reason: For some cases, such as 2 or more graphics cards existing, the default command line may fail because ffmpeg does not open the correct device node: ffmpeg -hwaccel qsv -c:v h264_qsv -i test.264 -c:v h264_qsv out.264 Let user choose the proper one by running like below: ffmpeg -hwaccel qsv -qsv_device /dev/dri/renderD128 -c:v h264_qsv \ -i test.264 -c:v h264_qsv out.264 Signed-off-by: ChaoX A Liu Signed-off-by: Huang, Zhengxu Signed-off-by: Andrew, Zhang Signed-off-by: Mark Thompson > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1a79b8f8d2b5d26c60c237d6e585873238e46914 --- ffmpeg.h | 3 +++ ffmpeg_opt.c | 5 + ffmpeg_qsv.c | 19 --- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/ffmpeg.h b/ffmpeg.h index ebe5bf0..081913b 100644 --- a/ffmpeg.h +++ b/ffmpeg.h @@ -602,6 +602,9 @@ extern const OptionDef options[]; extern const HWAccel hwaccels[]; extern int hwaccel_lax_profile_check; extern AVBufferRef *hw_device_ctx; +#if CONFIG_QSV +extern char *qsv_device; +#endif void term_init(void); diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c index 6862456..a4b8d24 100644 --- a/ffmpeg_opt.c +++ b/ffmpeg_opt.c @@ -3679,5 +3679,10 @@ const OptionDef options[] = { "set VAAPI hardware device (DRM path or X11 display name)", "device" }, #endif +#if CONFIG_QSV +{ "qsv_device", HAS_ARG | OPT_STRING | OPT_EXPERT, { &qsv_device }, +"set QSV hardware device (DirectX adapter index, DRM path or X11 display name)", "device"}, +#endif + { NULL, }, }; diff --git a/ffmpeg_qsv.c b/ffmpeg_qsv.c index 68ff5bd..86824b6 100644 --- a/ffmpeg_qsv.c +++ b/ffmpeg_qsv.c @@ -28,6 +28,8 @@ #include "ffmpeg.h" +char *qsv_device = NULL; + static int qsv_get_buffer(AVCodecContext *s, AVFrame *frame, int flags) { InputStream *ist = s->opaque; @@ -44,15 +46,26 @@ static void qsv_uninit(AVCodecContext *s) static int qsv_device_init(InputStream *ist) { int err; +AVDictionary *dict = NULL; + +if (qsv_device) { +err = av_dict_set(&dict, "child_device", qsv_device, 0); +if (err < 0) +return err; +} err = av_hwdevice_ctx_create(&hw_device_ctx, AV_HWDEVICE_TYPE_QSV, - ist->hwaccel_device, NULL, 0); + ist->hwaccel_device, dict, 0); if (err < 0) { av_log(NULL, AV_LOG_ERROR, "Error creating a QSV device\n"); -return err; +goto err_out; } -return 0; +err_out: +if (dict) +av_dict_free(&dict); + +return err; } int qsv_init(AVCodecContext *s) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] fate/psd : add test for 256 color
ffmpeg | branch: master | Martin Vignali | Mon Jan 9 23:03:42 2017 +0100| [682769d3d3a48d8e4c661df2dbc29aa4555e879b] | committer: Michael Niedermayer fate/psd : add test for 256 color Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=682769d3d3a48d8e4c661df2dbc29aa4555e879b --- tests/fate/image.mak | 3 +++ tests/ref/fate/psd-lena-256c | 6 ++ 2 files changed, 9 insertions(+) diff --git a/tests/fate/image.mak b/tests/fate/image.mak index 17c9245..e9a3f28 100644 --- a/tests/fate/image.mak +++ b/tests/fate/image.mak @@ -309,6 +309,9 @@ fate-psd-lena-rgb-rle-127x127-8b: CMD = framecrc -i $(TARGET_SAMPLES)/psd/lena-r FATE_PSD += fate-psd-lena-rgba-rle-128x128-8b fate-psd-lena-rgba-rle-128x128-8b: CMD = framecrc -i $(TARGET_SAMPLES)/psd/lena-rgba_rle_128x128_8b.psd +FATE_PSD += fate-psd-lena-256c +fate-psd-lena-256c: CMD = framecrc -i $(TARGET_SAMPLES)/psd/lena-256c.psd + FATE_PSD-$(call DEMDEC, IMAGE2, PSD) += $(FATE_PSD) FATE_IMAGE += $(FATE_PSD-yes) diff --git a/tests/ref/fate/psd-lena-256c b/tests/ref/fate/psd-lena-256c new file mode 100644 index 000..fdf1390 --- /dev/null +++ b/tests/ref/fate/psd-lena-256c @@ -0,0 +1,6 @@ +#tb 0: 1/25 +#media_type 0: video +#codec_id 0: rawvideo +#dimensions 0: 128x128 +#sar 0: 0/1 +0, 0, 0,1,17408, 0x4d80bf4f ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/mathops: add missing header for ff_reverse
ffmpeg | branch: master | James Almer | Wed Jan 11 21:17:52 2017 -0300| [e71b8119e7db675dd2dac3f7fb069b0df2943c38] | committer: James Almer avcodec/mathops: add missing header for ff_reverse Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e71b8119e7db675dd2dac3f7fb069b0df2943c38 --- libavcodec/mathops.h | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/mathops.h b/libavcodec/mathops.h index 958132d..2d56d00 100644 --- a/libavcodec/mathops.h +++ b/libavcodec/mathops.h @@ -25,6 +25,7 @@ #include #include "libavutil/common.h" +#include "libavutil/internal.h" #include "config.h" #define MAX_NEG_CROP 1024 ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog