[FFmpeg-cvslog] Merge commit 'd00a0d8e84fef1b9124bfaf71cc17df79ca464a6'
ffmpeg | branch: master | James Almer| Thu Sep 28 01:04:46 2017 -0300| [47d6b02f6c3d58141ace48bb5e8971cae56f8874] | committer: James Almer Merge commit 'd00a0d8e84fef1b9124bfaf71cc17df79ca464a6' * commit 'd00a0d8e84fef1b9124bfaf71cc17df79ca464a6': configure: Handle SDL version check through pkg-config Merged-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=47d6b02f6c3d58141ace48bb5e8971cae56f8874 --- configure | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/configure b/configure index c7d73325db..e0e8c028e2 100755 --- a/configure +++ b/configure @@ -6101,9 +6101,7 @@ fi if enabled sdl2; then SDL2_CONFIG="${cross_prefix}sdl2-config" -if check_pkg_config sdl2 SDL_events.h SDL_PollEvent; then -check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x020001" $sdl2_cflags && -check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x020100" $sdl2_cflags && +if check_pkg_config "sdl2 >= 2.0.1 sdl2 < 2.1.0" SDL_events.h SDL_PollEvent; then check_func SDL_Init $sdl2_extralibs $sdl2_cflags || disable sdl2 elif "${SDL2_CONFIG}" --version > /dev/null 2>&1; then == diff --cc configure index c7d73325db,4635b73b08..e0e8c028e2 --- a/configure +++ b/configure @@@ -6078,96 -4740,28 +6078,94 @@@ enabled openssl && { use_pkg_ check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 || check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 || die "ERROR: openssl not found"; } - -enabled gnutls&& check_lib gmp gmp.h mpz_export -lgmp - -if enabled nvenc; then -require_header nvEncodeAPI.h -require_cpp_condition nvEncodeAPI.h "NVENCAPI_MAJOR_VERSION >= 6" +enabled rkmpp && { { require_pkg_config rockchip_mpp rockchip_mpp rockchip/rk_mpi.h mpp_create || + die "ERROR : Rockchip MPP was not found."; } && + { check_func_headers rockchip/rk_mpi_cmd.h "MPP_DEC_GET_FREE_PACKET_SLOT_COUNT" || + die "ERROR: Rockchip MPP is outdated, please get a more recent one."; } && + { enabled libdrm || + die "ERROR: rkmpp requires --enable-libdrm"; } + } + +if enabled gcrypt; then +GCRYPT_CONFIG="${cross_prefix}libgcrypt-config" +if "${GCRYPT_CONFIG}" --version > /dev/null 2>&1; then +gcrypt_cflags=$("${GCRYPT_CONFIG}" --cflags) +gcrypt_extralibs=$("${GCRYPT_CONFIG}" --libs) +check_func_headers gcrypt.h gcry_mpi_new $gcrypt_cflags $gcrypt_extralibs || +die "ERROR: gcrypt not found" +add_cflags $gcrypt_cflags && add_extralibs $gcrypt_extralibs +else +require gcrypt gcrypt.h gcry_mpi_new -lgcrypt +fi fi -if check_pkg_config "sdl >= 1.2.1 sdl < 1.3.0" SDL_events.h SDL_PollEvent; then -enable sdl +if enabled sdl2; then +SDL2_CONFIG="${cross_prefix}sdl2-config" - if check_pkg_config sdl2 SDL_events.h SDL_PollEvent; then - check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x020001" $sdl2_cflags && - check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x020100" $sdl2_cflags && ++if check_pkg_config "sdl2 >= 2.0.1 sdl2 < 2.1.0" SDL_events.h SDL_PollEvent; then +check_func SDL_Init $sdl2_extralibs $sdl2_cflags || +disable sdl2 +elif "${SDL2_CONFIG}" --version > /dev/null 2>&1; then +sdl2_cflags=$("${SDL2_CONFIG}" --cflags) +sdl2_extralibs=$("${SDL2_CONFIG}" --libs) +check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x020001" $sdl2_cflags && +check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x020100" $sdl2_cflags && +check_func SDL_Init $sdl2_extralibs $sdl2_cflags || +disable sdl2 +else +disable sdl2 +fi +if test $target_os = "mingw32"; then +sdl2_extralibs="$sdl2_extralibs -mconsole" +fi fi +enabled sdl2 && add_cflags $sdl2_cflags && add_extralibs $sdl2_extralibs -! disabled pod2man && check_cmd pod2man --help && enable pod2man || disable pod2man -! disabled texi2html && check_cmd texi2html -version && enable texi2html || disable texi2html +if enabled decklink; then +case $target_os in +mingw32*|mingw64*|win32|win64) +decklink_outdev_extralibs="$decklink_outdev_extralibs -lole32 -loleaut32" +
[FFmpeg-cvslog] configure: Handle SDL version check through pkg-config
ffmpeg | branch: master | Diego Biurrun| Sat Feb 11 16:51:25 2017 +0100| [d00a0d8e84fef1b9124bfaf71cc17df79ca464a6] | committer: Diego Biurrun configure: Handle SDL version check through pkg-config > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d00a0d8e84fef1b9124bfaf71cc17df79ca464a6 --- configure | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/configure b/configure index b8cbe175e8..4635b73b08 100755 --- a/configure +++ b/configure @@ -4748,9 +4748,7 @@ if enabled nvenc; then require_cpp_condition nvEncodeAPI.h "NVENCAPI_MAJOR_VERSION >= 6" fi -if check_pkg_config sdl SDL_events.h SDL_PollEvent; then -check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags && -check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x010300" $sdl_cflags && +if check_pkg_config "sdl >= 1.2.1 sdl < 1.3.0" SDL_events.h SDL_PollEvent; then enable sdl fi ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] aarch64: Add parentheses around the offset parameter in movrel
ffmpeg | branch: master | Martin Storsjö| Thu Feb 16 09:18:25 2017 +0200| [8847eeaa14189885038140fb2b8a7adc7100] | committer: Martin Storsjö aarch64: Add parentheses around the offset parameter in movrel This fixes building with clang for linux with PIC enabled. Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8847eeaa14189885038140fb2b8a7adc7100 --- libavutil/aarch64/asm.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavutil/aarch64/asm.S b/libavutil/aarch64/asm.S index 0fc649ad0e..86d36cd57f 100644 --- a/libavutil/aarch64/asm.S +++ b/libavutil/aarch64/asm.S @@ -83,8 +83,8 @@ ELF .size \name, . - \name add \rd, \rd, \val+(\offset)@PAGEOFF .endif #elif CONFIG_PIC -adrp\rd, \val+\offset -add \rd, \rd, :lo12:\val+\offset +adrp\rd, \val+(\offset) +add \rd, \rd, :lo12:\val+(\offset) #else ldr \rd, =\val+\offset #endif ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '8847eeaa141898850381400000fb2b8a7adc7100'
ffmpeg | branch: master | James Almer| Thu Sep 28 00:53:40 2017 -0300| [d2ec2e27f81989ec11d6d43529b792610776c85c] | committer: James Almer Merge commit '8847eeaa14189885038140fb2b8a7adc7100' * commit '8847eeaa14189885038140fb2b8a7adc7100': aarch64: Add parentheses around the offset parameter in movrel This commit is a noop, see dda45c087b2c09ba9e485c51ff9c8f2aaca709a9 Merged-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d2ec2e27f81989ec11d6d43529b792610776c85c --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avconv: Move rescale to stream timebase before monotonisation
ffmpeg | branch: master | Mark Thompson| Sun Feb 12 23:47:58 2017 +| [82989bd98c7f4e87f59af2147b645b8fd8f31c53] | committer: Mark Thompson avconv: Move rescale to stream timebase before monotonisation If the stream timebase is coarser than the muxing timebase then the monotonisation process may fail because adding one to the timestamp need not actually produce a different timestamp after the rescale. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=82989bd98c7f4e87f59af2147b645b8fd8f31c53 --- avconv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/avconv.c b/avconv.c index 94b6da2a8b..5c36761c1d 100644 --- a/avconv.c +++ b/avconv.c @@ -326,6 +326,8 @@ static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost) } } +av_packet_rescale_ts(pkt, ost->mux_timebase, ost->st->time_base); + if (!(s->oformat->flags & AVFMT_NOTIMESTAMPS) && ost->last_mux_dts != AV_NOPTS_VALUE && pkt->dts < ost->last_mux_dts + !(s->oformat->flags & AVFMT_TS_NONSTRICT)) { @@ -349,7 +351,6 @@ static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost) ost->packets_written++; pkt->stream_index = ost->index; -av_packet_rescale_ts(pkt, ost->mux_timebase, ost->st->time_base); ret = av_interleaved_write_frame(s, pkt); if (ret < 0) { @@ -1006,7 +1007,7 @@ FF_ENABLE_DEPRECATION_WARNINGS vid = 1; } /* compute min output value */ -pts = (double)ost->last_mux_dts * av_q2d(ost->mux_timebase); +pts = (double)ost->last_mux_dts * av_q2d(ost->st->time_base); if ((pts < ti1) && (pts > 0)) ti1 = pts; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '82989bd98c7f4e87f59af2147b645b8fd8f31c53'
ffmpeg | branch: master | James Almer| Thu Sep 28 00:52:02 2017 -0300| [e862a433d8e33787dd2ce14783e3afc511671d9f] | committer: James Almer Merge commit '82989bd98c7f4e87f59af2147b645b8fd8f31c53' * commit '82989bd98c7f4e87f59af2147b645b8fd8f31c53': avconv: Move rescale to stream timebase before monotonisation This commit is a noop, see 4ee5aed122ba7d289c1686eca6eba161d5d62304 Merged-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e862a433d8e33787dd2ce14783e3afc511671d9f --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/libopenh264dec: check for ff_set_dimensions() return value
ffmpeg | branch: master | James Almer| Thu Sep 28 00:49:05 2017 -0300| [93dfc4f174d89ad4c9a76fb542ddfed138e4f01b] | committer: James Almer avcodec/libopenh264dec: check for ff_set_dimensions() return value Was removed by accident in e9b6212de29a966f200833220ed35f51852f05f6. Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=93dfc4f174d89ad4c9a76fb542ddfed138e4f01b --- libavcodec/libopenh264dec.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavcodec/libopenh264dec.c b/libavcodec/libopenh264dec.c index 4a27a5a0a6..d12e715117 100644 --- a/libavcodec/libopenh264dec.c +++ b/libavcodec/libopenh264dec.c @@ -92,7 +92,7 @@ static int svc_decode_frame(AVCodecContext *avctx, void *data, SVCContext *s = avctx->priv_data; SBufferInfo info = { 0 }; uint8_t* ptrs[3]; -int linesize[3]; +int ret, linesize[3]; AVFrame *avframe = data; DECODING_STATE state; @@ -106,7 +106,9 @@ static int svc_decode_frame(AVCodecContext *avctx, void *data, return avpkt->size; } -ff_set_dimensions(avctx, info.UsrData.sSystemBuffer.iWidth, info.UsrData.sSystemBuffer.iHeight); +ret = ff_set_dimensions(avctx, info.UsrData.sSystemBuffer.iWidth, info.UsrData.sSystemBuffer.iHeight); +if (ret < 0) +return ret; // The decoder doesn't (currently) support decoding into a user // provided buffer, so do a copy instead. if (ff_get_buffer(avctx, avframe, 0) < 0) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '030de53e9cc225dc767458aedcc87efd457b4f3b'
ffmpeg | branch: master | James Almer| Thu Sep 28 00:44:11 2017 -0300| [e9b6212de29a966f200833220ed35f51852f05f6] | committer: James Almer Merge commit '030de53e9cc225dc767458aedcc87efd457b4f3b' * commit '030de53e9cc225dc767458aedcc87efd457b4f3b': libopenh264dec: Let the framework use the h264_mp4toannexb bitstream filter Merged-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e9b6212de29a966f200833220ed35f51852f05f6 --- libavcodec/libopenh264dec.c | 146 1 file changed, 25 insertions(+), 121 deletions(-) diff --git a/libavcodec/libopenh264dec.c b/libavcodec/libopenh264dec.c index a362be7e23..4a27a5a0a6 100644 --- a/libavcodec/libopenh264dec.c +++ b/libavcodec/libopenh264dec.c @@ -35,28 +35,15 @@ typedef struct SVCContext { ISVCDecoder *decoder; -AVBSFContext *bsf; -AVFifoBuffer *packet_fifo; -AVPacket pkt_filtered; } SVCContext; static av_cold int svc_decode_close(AVCodecContext *avctx) { SVCContext *s = avctx->priv_data; -AVPacket pkt; if (s->decoder) WelsDestroyDecoder(s->decoder); -while (s->packet_fifo && av_fifo_size(s->packet_fifo) >= sizeof(pkt)) { -av_fifo_generic_read(s->packet_fifo, , sizeof(pkt), NULL); -av_packet_unref(); -} - -av_bsf_free(>bsf); -av_packet_unref(>pkt_filtered); -av_fifo_free(s->packet_fifo); - return 0; } @@ -71,10 +58,6 @@ static av_cold int svc_decode_init(AVCodecContext *avctx) if ((err = ff_libopenh264_check_version(avctx)) < 0) return err; -s->packet_fifo = av_fifo_alloc(sizeof(AVPacket)); -if (!s->packet_fifo) -return AVERROR(ENOMEM); - if (WelsCreateDecoder(>decoder)) { av_log(avctx, AV_LOG_ERROR, "Unable to create decoder\n"); return AVERROR_UNKNOWN; @@ -103,38 +86,6 @@ static av_cold int svc_decode_init(AVCodecContext *avctx) return 0; } -static int init_bsf(AVCodecContext *avctx) -{ -SVCContext *s = avctx->priv_data; -const AVBitStreamFilter *filter; -int ret; - -if (s->bsf) -return 0; - -// If the input stream already is annex b, this BSF only passes the -// packets through unchanged. -filter = av_bsf_get_by_name("h264_mp4toannexb"); -if (!filter) -return AVERROR_BSF_NOT_FOUND; - -ret = av_bsf_alloc(filter, >bsf); -if (ret < 0) -return ret; - -ret = avcodec_parameters_from_context(s->bsf->par_in, avctx); -if (ret < 0) -return ret; - -s->bsf->time_base_in = avctx->time_base; - -ret = av_bsf_init(s->bsf); -if (ret < 0) -return ret; - -return ret; -} - static int svc_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { @@ -143,87 +94,39 @@ static int svc_decode_frame(AVCodecContext *avctx, void *data, uint8_t* ptrs[3]; int linesize[3]; AVFrame *avframe = data; -int ret; DECODING_STATE state; -if ((ret = init_bsf(avctx)) < 0) -return ret; - -if (avpkt->size) { -AVPacket input_ref = { 0 }; -if (av_fifo_space(s->packet_fifo) < sizeof(input_ref)) { -ret = av_fifo_realloc2(s->packet_fifo, - av_fifo_size(s->packet_fifo) + sizeof(input_ref)); -if (ret < 0) -return ret; -} - -ret = av_packet_ref(_ref, avpkt); -if (ret < 0) -return ret; -av_fifo_generic_write(s->packet_fifo, _ref, sizeof(input_ref), NULL); +state = (*s->decoder)->DecodeFrame2(s->decoder, avpkt->data, avpkt->size, ptrs, ); +if (state != dsErrorFree) { +av_log(avctx, AV_LOG_ERROR, "DecodeFrame2 failed\n"); +return AVERROR_UNKNOWN; +} +if (info.iBufferStatus != 1) { +av_log(avctx, AV_LOG_DEBUG, "No frame produced\n"); +return avpkt->size; } -while (!*got_frame) { -/* prepare the input data -- convert to Annex B if needed */ -if (s->pkt_filtered.size <= 0) { -AVPacket input_ref; - -/* no more data */ -if (av_fifo_size(s->packet_fifo) < sizeof(AVPacket)) -return avpkt->size ? avpkt->size : 0; - -av_packet_unref(>pkt_filtered); - -av_fifo_generic_read(s->packet_fifo, _ref, sizeof(input_ref), NULL); -ret = av_bsf_send_packet(s->bsf, _ref); -if (ret < 0) { -av_packet_unref(_ref); -return ret; -} - -ret = av_bsf_receive_packet(s->bsf, >pkt_filtered); -if (ret < 0) -av_packet_move_ref(>pkt_filtered, _ref); -else -av_packet_unref(_ref); -} - -state = (*s->decoder)->DecodeFrame2(s->decoder, s->pkt_filtered.data, s->pkt_filtered.size, ptrs, ); -s->pkt_filtered.size = 0; -if (state !=
[FFmpeg-cvslog] libopenh264dec: Let the framework use the h264_mp4toannexb bitstream filter
ffmpeg | branch: master | Martin Storsjö| Wed Feb 15 11:06:17 2017 +0200| [030de53e9cc225dc767458aedcc87efd457b4f3b] | committer: Martin Storsjö libopenh264dec: Let the framework use the h264_mp4toannexb bitstream filter This avoids a lot of boilerplate code within the decoder wrapper itself. Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=030de53e9cc225dc767458aedcc87efd457b4f3b --- libavcodec/libopenh264dec.c | 144 1 file changed, 25 insertions(+), 119 deletions(-) diff --git a/libavcodec/libopenh264dec.c b/libavcodec/libopenh264dec.c index cc18f240a6..d65d63914c 100644 --- a/libavcodec/libopenh264dec.c +++ b/libavcodec/libopenh264dec.c @@ -35,28 +35,15 @@ typedef struct SVCContext { ISVCDecoder *decoder; -AVBSFContext *bsf; -AVFifoBuffer *packet_fifo; -AVPacket pkt_filtered; } SVCContext; static av_cold int svc_decode_close(AVCodecContext *avctx) { SVCContext *s = avctx->priv_data; -AVPacket pkt; if (s->decoder) WelsDestroyDecoder(s->decoder); -while (s->packet_fifo && av_fifo_size(s->packet_fifo) >= sizeof(pkt)) { -av_fifo_generic_read(s->packet_fifo, , sizeof(pkt), NULL); -av_packet_unref(); -} - -av_bsf_free(>bsf); -av_packet_unref(>pkt_filtered); -av_fifo_free(s->packet_fifo); - return 0; } @@ -71,10 +58,6 @@ static av_cold int svc_decode_init(AVCodecContext *avctx) if ((err = ff_libopenh264_check_version(avctx)) < 0) return err; -s->packet_fifo = av_fifo_alloc(sizeof(AVPacket)); -if (!s->packet_fifo) -return AVERROR(ENOMEM); - if (WelsCreateDecoder(>decoder)) { av_log(avctx, AV_LOG_ERROR, "Unable to create decoder\n"); return AVERROR_UNKNOWN; @@ -103,38 +86,6 @@ static av_cold int svc_decode_init(AVCodecContext *avctx) return 0; } -static int init_bsf(AVCodecContext *avctx) -{ -SVCContext *s = avctx->priv_data; -const AVBitStreamFilter *filter; -int ret; - -if (s->bsf) -return 0; - -// If the input stream already is annex b, this BSF only passes the -// packets through unchanged. -filter = av_bsf_get_by_name("h264_mp4toannexb"); -if (!filter) -return AVERROR_BUG; - -ret = av_bsf_alloc(filter, >bsf); -if (ret < 0) -return ret; - -ret = avcodec_parameters_from_context(s->bsf->par_in, avctx); -if (ret < 0) -return ret; - -s->bsf->time_base_in = avctx->time_base; - -ret = av_bsf_init(s->bsf); -if (ret < 0) -return ret; - -return ret; -} - static int svc_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { @@ -143,85 +94,39 @@ static int svc_decode_frame(AVCodecContext *avctx, void *data, uint8_t* ptrs[3]; int linesize[3]; AVFrame *avframe = data; -int ret; DECODING_STATE state; -if ((ret = init_bsf(avctx)) < 0) -return ret; - -if (avpkt->size) { -AVPacket input_ref = { 0 }; -if (av_fifo_space(s->packet_fifo) < sizeof(input_ref)) { -ret = av_fifo_realloc2(s->packet_fifo, - av_fifo_size(s->packet_fifo) + sizeof(input_ref)); -if (ret < 0) -return ret; -} - -ret = av_packet_ref(_ref, avpkt); -if (ret < 0) -return ret; -av_fifo_generic_write(s->packet_fifo, _ref, sizeof(input_ref), NULL); +state = (*s->decoder)->DecodeFrame2(s->decoder, avpkt->data, avpkt->size, ptrs, ); +if (state != dsErrorFree) { +av_log(avctx, AV_LOG_ERROR, "DecodeFrame2 failed\n"); +return AVERROR_UNKNOWN; +} +if (info.iBufferStatus != 1) { +av_log(avctx, AV_LOG_DEBUG, "No frame produced\n"); +return avpkt->size; } -while (!*got_frame) { -/* prepare the input data -- convert to Annex B if needed */ -if (s->pkt_filtered.size <= 0) { -AVPacket input_ref; - -/* no more data */ -if (av_fifo_size(s->packet_fifo) < sizeof(AVPacket)) -return avpkt->size ? avpkt->size : 0; - -av_packet_unref(>pkt_filtered); - -av_fifo_generic_read(s->packet_fifo, _ref, sizeof(input_ref), NULL); -ret = av_bsf_send_packet(s->bsf, _ref); -if (ret < 0) { -av_packet_unref(_ref); -return ret; -} - -ret = av_bsf_receive_packet(s->bsf, >pkt_filtered); -if (ret < 0) -av_packet_move_ref(>pkt_filtered, _ref); -else -av_packet_unref(_ref); -} - -state = (*s->decoder)->DecodeFrame2(s->decoder, s->pkt_filtered.data, s->pkt_filtered.size, ptrs, ); -s->pkt_filtered.size = 0; -if (state != dsErrorFree) { -av_log(avctx,
[FFmpeg-cvslog] Merge commit '0539d84d985e811e5989ef27c13f7e2dda0f9b89'
ffmpeg | branch: master | James Almer| Thu Sep 28 00:18:10 2017 -0300| [42f27d1b8eab9ea88d2e9faeb35f72dd72eca7b4] | committer: James Almer Merge commit '0539d84d985e811e5989ef27c13f7e2dda0f9b89' * commit '0539d84d985e811e5989ef27c13f7e2dda0f9b89': asfdec: Account for different Format Data sizes See 76853a3e0ce4d4ef09ffcca7307991b8db832cd4 Merged-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=42f27d1b8eab9ea88d2e9faeb35f72dd72eca7b4 --- libavformat/asfdec_o.c | 12 +++- libavformat/riff.h | 3 ++- libavformat/riffdec.c | 7 --- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/libavformat/asfdec_o.c b/libavformat/asfdec_o.c index 7450ea0f74..86ea962849 100644 --- a/libavformat/asfdec_o.c +++ b/libavformat/asfdec_o.c @@ -691,20 +691,22 @@ static int asf_read_properties(AVFormatContext *s, const GUIDParseTable *g) static int parse_video_info(AVIOContext *pb, AVStream *st) { -uint16_t size; +uint16_t size_asf; // ASF-specific Format Data size +uint32_t size_bmp; // BMP_HEADER-specific Format Data size unsigned int tag; st->codecpar->width = avio_rl32(pb); st->codecpar->height = avio_rl32(pb); avio_skip(pb, 1); // skip reserved flags -size = avio_rl16(pb); // size of the Format Data -tag = ff_get_bmp_header(pb, st, NULL); +size_asf = avio_rl16(pb); +tag = ff_get_bmp_header(pb, st, _bmp); st->codecpar->codec_tag = tag; st->codecpar->codec_id = ff_codec_get_id(ff_codec_bmp_tags, tag); +size_bmp = FFMAX(size_asf, size_bmp); -if (size > BMP_HEADER_SIZE) { +if (size_bmp > BMP_HEADER_SIZE) { int ret; -st->codecpar->extradata_size = size - BMP_HEADER_SIZE; +st->codecpar->extradata_size = size_bmp - BMP_HEADER_SIZE; if (!(st->codecpar->extradata = av_malloc(st->codecpar->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE))) { st->codecpar->extradata_size = 0; diff --git a/libavformat/riff.h b/libavformat/riff.h index c916d1a587..323aa38b4d 100644 --- a/libavformat/riff.h +++ b/libavformat/riff.h @@ -41,9 +41,10 @@ void ff_end_tag(AVIOContext *pb, int64_t start); /** * Read BITMAPINFOHEADER structure and set AVStream codec width, height and * bits_per_encoded_sample fields. Does not read extradata. + * Writes the size of the BMP file to *size. * @return codec tag */ -int ff_get_bmp_header(AVIOContext *pb, AVStream *st, unsigned *esize); +int ff_get_bmp_header(AVIOContext *pb, AVStream *st, uint32_t *size); void ff_put_bmp_header(AVIOContext *pb, AVCodecParameters *par, int for_asf, int ignore_extradata); diff --git a/libavformat/riffdec.c b/libavformat/riffdec.c index 656a9ebcf8..b448f9116f 100644 --- a/libavformat/riffdec.c +++ b/libavformat/riffdec.c @@ -208,11 +208,12 @@ enum AVCodecID ff_wav_codec_get_id(unsigned int tag, int bps) return id; } -int ff_get_bmp_header(AVIOContext *pb, AVStream *st, unsigned *esize) +int ff_get_bmp_header(AVIOContext *pb, AVStream *st, uint32_t *size) { int tag1; -if(esize) *esize = avio_rl32(pb); -elseavio_rl32(pb); +uint32_t size_ = avio_rl32(pb); +if (size) +*size = size_; st->codecpar->width = avio_rl32(pb); st->codecpar->height = (int32_t)avio_rl32(pb); avio_rl16(pb); /* planes */ == diff --cc libavformat/asfdec_o.c index 7450ea0f74,00..86ea962849 mode 100644,00..100644 --- a/libavformat/asfdec_o.c +++ b/libavformat/asfdec_o.c @@@ -1,1792 -1,0 +1,1794 @@@ +/* + * Microsoft Advanced Streaming Format demuxer + * Copyright (c) 2014 Alexandra Hájková + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/attributes.h" +#include "libavutil/avstring.h" +#include "libavutil/bswap.h" +#include "libavutil/common.h" +#include "libavutil/dict.h" +#include "libavutil/internal.h" +#include "libavutil/mathematics.h" +#include "libavutil/opt.h" +#include "libavutil/time_internal.h" + +#include "avformat.h" +#include "avio_internal.h" +#include "avlanguage.h" +#include
[FFmpeg-cvslog] asfdec: Account for different Format Data sizes
ffmpeg | branch: master | Alexandra Hájková| Wed Feb 8 12:51:37 2017 +0100| [0539d84d985e811e5989ef27c13f7e2dda0f9b89] | committer: Diego Biurrun asfdec: Account for different Format Data sizes Some muxers may use the BMP_HEADER Format Data size instead of the ASF-specific one. Bug-Id: 1020 CC: libav-sta...@libav.org Signed-off-by: Diego Biurrun > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0539d84d985e811e5989ef27c13f7e2dda0f9b89 --- libavformat/asfdec.c | 12 +++- libavformat/avidec.c | 2 +- libavformat/riff.h| 3 ++- libavformat/riffdec.c | 6 -- libavformat/wtv.c | 2 +- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c index d602af8793..34730b20aa 100644 --- a/libavformat/asfdec.c +++ b/libavformat/asfdec.c @@ -691,20 +691,22 @@ static int asf_read_properties(AVFormatContext *s, const GUIDParseTable *g) static int parse_video_info(AVIOContext *pb, AVStream *st) { -uint16_t size; +uint16_t size_asf; // ASF-specific Format Data size +uint32_t size_bmp; // BMP_HEADER-specific Format Data size unsigned int tag; st->codecpar->width = avio_rl32(pb); st->codecpar->height = avio_rl32(pb); avio_skip(pb, 1); // skip reserved flags -size = avio_rl16(pb); // size of the Format Data -tag = ff_get_bmp_header(pb, st); +size_asf = avio_rl16(pb); +tag = ff_get_bmp_header(pb, st, _bmp); st->codecpar->codec_tag = tag; st->codecpar->codec_id = ff_codec_get_id(ff_codec_bmp_tags, tag); +size_bmp = FFMAX(size_asf, size_bmp); -if (size > BMP_HEADER_SIZE) { +if (size_bmp > BMP_HEADER_SIZE) { int ret; -st->codecpar->extradata_size = size - BMP_HEADER_SIZE; +st->codecpar->extradata_size = size_bmp - BMP_HEADER_SIZE; if (!(st->codecpar->extradata = av_malloc(st->codecpar->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE))) { st->codecpar->extradata_size = 0; diff --git a/libavformat/avidec.c b/libavformat/avidec.c index 701cccb6b0..870066eb25 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -613,7 +613,7 @@ static int avi_read_header(AVFormatContext *s) avio_skip(pb, size); break; } -tag1 = ff_get_bmp_header(pb, st); +tag1 = ff_get_bmp_header(pb, st, NULL); if (tag1 == MKTAG('D', 'X', 'S', 'B') || tag1 == MKTAG('D', 'X', 'S', 'A')) { diff --git a/libavformat/riff.h b/libavformat/riff.h index a45c7f301c..e5f4645c12 100644 --- a/libavformat/riff.h +++ b/libavformat/riff.h @@ -41,9 +41,10 @@ void ff_end_tag(AVIOContext *pb, int64_t start); /** * Read BITMAPINFOHEADER structure and set AVStream codec width, height and * bits_per_encoded_sample fields. Does not read extradata. + * Writes the size of the BMP file to *size. * @return codec tag */ -int ff_get_bmp_header(AVIOContext *pb, AVStream *st); +int ff_get_bmp_header(AVIOContext *pb, AVStream *st, uint32_t *size); void ff_put_bmp_header(AVIOContext *pb, AVCodecParameters *par, const AVCodecTag *tags, int for_asf); int ff_put_wav_header(AVFormatContext *s, AVIOContext *pb, AVCodecParameters *par); diff --git a/libavformat/riffdec.c b/libavformat/riffdec.c index 81248355e3..db83b3205a 100644 --- a/libavformat/riffdec.c +++ b/libavformat/riffdec.c @@ -180,10 +180,12 @@ enum AVCodecID ff_wav_codec_get_id(unsigned int tag, int bps) return id; } -int ff_get_bmp_header(AVIOContext *pb, AVStream *st) +int ff_get_bmp_header(AVIOContext *pb, AVStream *st, uint32_t *size) { int tag1; -avio_rl32(pb); /* size */ +uint32_t size_ = avio_rl32(pb); +if (size) +*size = size_; st->codecpar->width = avio_rl32(pb); st->codecpar->height = (int32_t)avio_rl32(pb); avio_rl16(pb); /* planes */ diff --git a/libavformat/wtv.c b/libavformat/wtv.c index 794dd4bb71..d750cef647 100644 --- a/libavformat/wtv.c +++ b/libavformat/wtv.c @@ -586,7 +586,7 @@ static int parse_videoinfoheader2(AVFormatContext *s, AVStream *st) AVIOContext *pb = wtv->pb; avio_skip(pb, 72); // picture aspect ratio is unreliable -ff_get_bmp_header(pb, st); +ff_get_bmp_header(pb, st, NULL); return 72 + 40; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '871b4f3654636ed64560e86b9faa33828d195ceb'
ffmpeg | branch: master | James Almer| Thu Sep 28 00:13:10 2017 -0300| [e2a5fa11b2a20a579d425ce6e162873660333445] | committer: James Almer Merge commit '871b4f3654636ed64560e86b9faa33828d195ceb' * commit '871b4f3654636ed64560e86b9faa33828d195ceb': configure: Check for xcb as well as xcb-shape before enabling libxcb This commit is a noop. We already check for libxcb_shape. Merged-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e2a5fa11b2a20a579d425ce6e162873660333445 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] configure: Check for xcb as well as xcb-shape before enabling libxcb
ffmpeg | branch: master | Diego Biurrun| Sat Feb 11 11:47:34 2017 +0100| [871b4f3654636ed64560e86b9faa33828d195ceb] | committer: Diego Biurrun configure: Check for xcb as well as xcb-shape before enabling libxcb Newer versions of libxcb have xcb-foo pkg-config files that do not declare their xcb dependency so that required linker flags will not be generated. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=871b4f3654636ed64560e86b9faa33828d195ceb --- configure | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 69f5863582..b8cbe175e8 100755 --- a/configure +++ b/configure @@ -1752,8 +1752,9 @@ CONFIG_EXTRA=" iso_media ividsp jpegtables -libx262 lgplv3 +libx262 +libxcb_shape lpc lzf me_cmp @@ -2420,7 +2421,7 @@ sndio_indev_deps="sndio" sndio_outdev_deps="sndio" v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h" vfwcap_indev_deps="vfw32 vfwcap_defines" -xcbgrab_indev_deps="libxcb" +xcbgrab_indev_deps="libxcb libxcb_shape" xcbgrab_indev_suggest="libxcb_shm libxcb_xfixes" # protocols @@ -4797,7 +4798,8 @@ if enabled libcdio; then fi if enabled libxcb; then -require_pkg_config libxcb xcb-shape xcb/shape.h xcb_shape_rectangles +require_pkg_config libxcb xcb xcb/xcb.h xcb_connect +require_pkg_config libxcb_shape xcb-shape xcb/shape.h xcb_shape_rectangles disabled libxcb_shm || require_pkg_config libxcb_shm xcb-shm xcb/shm.h xcb_shm_attach disabled libxcb_xfixes || ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'b446f0e98f85e2e931b476e52b319f1c49244660'
ffmpeg | branch: master | James Almer| Thu Sep 28 00:09:20 2017 -0300| [d99c3af7072d0011c4f2cbedb2f624e6b616cfc0] | committer: James Almer Merge commit 'b446f0e98f85e2e931b476e52b319f1c49244660' * commit 'b446f0e98f85e2e931b476e52b319f1c49244660': mov: Do not try to parse multiple stsd for the same track See 8b43ee4054af799e388d380b379a13a60849c1b5 Merged-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d99c3af7072d0011c4f2cbedb2f624e6b616cfc0 --- libavformat/mov.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index 19cda1424d..ede9cda9d3 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2371,9 +2371,11 @@ static int mov_read_stsd(MOVContext *c, AVIOContext *pb, MOVAtom atom) } if (sc->extradata) { -av_log(c->fc, AV_LOG_ERROR, "Duplicate STSD\n"); +av_log(c->fc, AV_LOG_ERROR, + "Duplicate stsd found in this track.\n"); return AVERROR_INVALIDDATA; } + /* Prepare space for hosting multiple extradata. */ sc->extradata = av_mallocz_array(entries, sizeof(*sc->extradata)); sc->extradata_size = av_mallocz_array(entries, sizeof(*sc->extradata_size)); == diff --cc libavformat/mov.c index 19cda1424d,5c9f85c738..ede9cda9d3 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@@ -2365,24 -1911,23 +2365,26 @@@ static int mov_read_stsd(MOVContext *c avio_rb24(pb); /* flags */ entries = avio_rb32(pb); +if (entries <= 0) { +av_log(c->fc, AV_LOG_ERROR, "invalid STSD entries %d\n", entries); +return AVERROR_INVALIDDATA; +} + if (sc->extradata) { - av_log(c->fc, AV_LOG_ERROR, "Duplicate STSD\n"); + av_log(c->fc, AV_LOG_ERROR, +"Duplicate stsd found in this track.\n"); return AVERROR_INVALIDDATA; } + /* Prepare space for hosting multiple extradata. */ sc->extradata = av_mallocz_array(entries, sizeof(*sc->extradata)); -if (!sc->extradata) -return AVERROR(ENOMEM); - -sc->stsd_count = entries; -sc->extradata_size = av_mallocz_array(sc->stsd_count, sizeof(*sc->extradata_size)); -if (!sc->extradata_size) -return AVERROR(ENOMEM); +sc->extradata_size = av_mallocz_array(entries, sizeof(*sc->extradata_size)); +if (!sc->extradata_size || !sc->extradata) { +ret = AVERROR(ENOMEM); +goto fail; +} -ret = ff_mov_read_stsd_entries(c, pb, sc->stsd_count); +ret = ff_mov_read_stsd_entries(c, pb, entries); if (ret < 0) return ret; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] mov: Do not try to parse multiple stsd for the same track
ffmpeg | branch: master | Luca Barbato| Sat Feb 11 21:44:08 2017 +| [b446f0e98f85e2e931b476e52b319f1c49244660] | committer: Luca Barbato mov: Do not try to parse multiple stsd for the same track Bug-Id: 1017 CC: libav-sta...@libav.org Signed-off-by: Luca Barbato > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b446f0e98f85e2e931b476e52b319f1c49244660 --- libavformat/mov.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/libavformat/mov.c b/libavformat/mov.c index 11bcff035c..5c9f85c738 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1911,6 +1911,12 @@ static int mov_read_stsd(MOVContext *c, AVIOContext *pb, MOVAtom atom) avio_rb24(pb); /* flags */ entries = avio_rb32(pb); +if (sc->extradata) { +av_log(c->fc, AV_LOG_ERROR, + "Duplicate stsd found in this track.\n"); +return AVERROR_INVALIDDATA; +} + /* Prepare space for hosting multiple extradata. */ sc->extradata = av_mallocz_array(entries, sizeof(*sc->extradata)); if (!sc->extradata) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] hwcontext_vaapi: Try to support the VDPAU wrapper
ffmpeg | branch: master | Mark Thompson| Mon Jan 30 19:11:28 2017 +| [e791b915c774408fbc0ec9e7270b021899e08ccc] | committer: Mark Thompson hwcontext_vaapi: Try to support the VDPAU wrapper The driver is somewhat bitrotten (not updated for years) but is still usable for decoding with this change. To support it, this adds a new driver quirk to indicate no support at all for surface attributes. Based on a patch by wm4 . > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e791b915c774408fbc0ec9e7270b021899e08ccc --- libavutil/hwcontext_vaapi.c | 79 ++--- libavutil/hwcontext_vaapi.h | 7 2 files changed, 52 insertions(+), 34 deletions(-) diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c index f8719aaf0a..23bce76605 100644 --- a/libavutil/hwcontext_vaapi.c +++ b/libavutil/hwcontext_vaapi.c @@ -153,7 +153,8 @@ static int vaapi_frames_get_constraints(AVHWDeviceContext *hwdev, unsigned int fourcc; int err, i, j, attr_count, pix_fmt_count; -if (config) { +if (config && +!(hwctx->driver_quirks & AV_VAAPI_DRIVER_QUIRK_SURFACE_ATTRIBUTES)) { attr_count = 0; vas = vaQuerySurfaceAttributes(hwctx->display, config->config_id, 0, _count); @@ -271,6 +272,11 @@ static const struct { "ubit", AV_VAAPI_DRIVER_QUIRK_ATTRIB_MEMTYPE, }, +{ +"VDPAU wrapper", +"Splitted-Desktop Systems VDPAU backend for VA-API", +AV_VAAPI_DRIVER_QUIRK_SURFACE_ATTRIBUTES, +}, }; static int vaapi_device_init(AVHWDeviceContext *hwdev) @@ -449,43 +455,48 @@ static int vaapi_frames_init(AVHWFramesContext *hwfc) } if (!hwfc->pool) { -int need_memory_type = !(hwctx->driver_quirks & AV_VAAPI_DRIVER_QUIRK_ATTRIB_MEMTYPE); -int need_pixel_format = 1; -for (i = 0; i < avfc->nb_attributes; i++) { -if (ctx->attributes[i].type == VASurfaceAttribMemoryType) -need_memory_type = 0; -if (ctx->attributes[i].type == VASurfaceAttribPixelFormat) -need_pixel_format = 0; -} -ctx->nb_attributes = -avfc->nb_attributes + need_memory_type + need_pixel_format; +if (!(hwctx->driver_quirks & AV_VAAPI_DRIVER_QUIRK_SURFACE_ATTRIBUTES)) { +int need_memory_type = !(hwctx->driver_quirks & AV_VAAPI_DRIVER_QUIRK_ATTRIB_MEMTYPE); +int need_pixel_format = 1; +for (i = 0; i < avfc->nb_attributes; i++) { +if (ctx->attributes[i].type == VASurfaceAttribMemoryType) +need_memory_type = 0; +if (ctx->attributes[i].type == VASurfaceAttribPixelFormat) +need_pixel_format = 0; +} +ctx->nb_attributes = +avfc->nb_attributes + need_memory_type + need_pixel_format; -ctx->attributes = av_malloc(ctx->nb_attributes * +ctx->attributes = av_malloc(ctx->nb_attributes * sizeof(*ctx->attributes)); -if (!ctx->attributes) { -err = AVERROR(ENOMEM); -goto fail; -} +if (!ctx->attributes) { +err = AVERROR(ENOMEM); +goto fail; +} -for (i = 0; i < avfc->nb_attributes; i++) -ctx->attributes[i] = avfc->attributes[i]; -if (need_memory_type) { -ctx->attributes[i++] = (VASurfaceAttrib) { -.type = VASurfaceAttribMemoryType, -.flags = VA_SURFACE_ATTRIB_SETTABLE, -.value.type= VAGenericValueTypeInteger, -.value.value.i = VA_SURFACE_ATTRIB_MEM_TYPE_VA, -}; -} -if (need_pixel_format) { -ctx->attributes[i++] = (VASurfaceAttrib) { -.type = VASurfaceAttribPixelFormat, -.flags = VA_SURFACE_ATTRIB_SETTABLE, -.value.type= VAGenericValueTypeInteger, -.value.value.i = fourcc, -}; +for (i = 0; i < avfc->nb_attributes; i++) +ctx->attributes[i] = avfc->attributes[i]; +if (need_memory_type) { +ctx->attributes[i++] = (VASurfaceAttrib) { +.type = VASurfaceAttribMemoryType, +.flags = VA_SURFACE_ATTRIB_SETTABLE, +.value.type= VAGenericValueTypeInteger, +.value.value.i = VA_SURFACE_ATTRIB_MEM_TYPE_VA, +}; +} +if (need_pixel_format) { +ctx->attributes[i++] = (VASurfaceAttrib) { +.type = VASurfaceAttribPixelFormat, +.flags = VA_SURFACE_ATTRIB_SETTABLE, +.value.type= VAGenericValueTypeInteger, +
[FFmpeg-cvslog] Merge commit 'e791b915c774408fbc0ec9e7270b021899e08ccc'
ffmpeg | branch: master | James Almer| Thu Sep 28 00:06:42 2017 -0300| [2838ab65ccf5e3ceefe9819c1aee6edd7f3e4d90] | committer: James Almer Merge commit 'e791b915c774408fbc0ec9e7270b021899e08ccc' * commit 'e791b915c774408fbc0ec9e7270b021899e08ccc': hwcontext_vaapi: Try to support the VDPAU wrapper This commit is a noop, see f2e4fb61af4b47c329fbf2b9a245594957d7bbab Merged-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2838ab65ccf5e3ceefe9819c1aee6edd7f3e4d90 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '5dd9a4b88b287bf8c93520afda7becb1ad0d1894'
ffmpeg | branch: master | James Almer| Thu Sep 28 00:05:24 2017 -0300| [752bc6b402ae3a20a7e01e6bdde483b081dffc81] | committer: James Almer Merge commit '5dd9a4b88b287bf8c93520afda7becb1ad0d1894' * commit '5dd9a4b88b287bf8c93520afda7becb1ad0d1894': vaapi: Implement device-only setup This commit is a noop, see 81b7deab8296f8446a64e20b9fcaf8eba88b9e29 Merged-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=752bc6b402ae3a20a7e01e6bdde483b081dffc81 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] vaapi: Implement device-only setup
ffmpeg | branch: master | Mark Thompson| Sat Feb 11 15:13:12 2017 +| [5dd9a4b88b287bf8c93520afda7becb1ad0d1894] | committer: Mark Thompson vaapi: Implement device-only setup In this case, the user only supplies a device and the frame context is allocated internally by lavc. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5dd9a4b88b287bf8c93520afda7becb1ad0d1894 --- libavcodec/vaapi_decode.c | 129 +++--- libavcodec/vaapi_decode.h | 3 ++ 2 files changed, 114 insertions(+), 18 deletions(-) diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c index 42f03ab141..0db79d401d 100644 --- a/libavcodec/vaapi_decode.c +++ b/libavcodec/vaapi_decode.c @@ -18,6 +18,7 @@ #include "libavutil/avassert.h" #include "libavutil/common.h" +#include "libavutil/pixdesc.h" #include "avcodec.h" #include "internal.h" @@ -280,6 +281,7 @@ static int vaapi_decode_make_config(AVCodecContext *avctx) const AVCodecDescriptor *codec_desc; VAProfile profile, *profile_list = NULL; int profile_count, exact_match, alt_profile; +const AVPixFmtDescriptor *sw_desc, *desc; // Allowing a profile mismatch can be useful because streams may // over-declare their required capabilities - in particular, many @@ -373,7 +375,9 @@ static int vaapi_decode_make_config(AVCodecContext *avctx) goto fail; } -hwconfig = av_hwdevice_hwconfig_alloc(ctx->frames->device_ref); +hwconfig = av_hwdevice_hwconfig_alloc(avctx->hw_device_ctx ? + avctx->hw_device_ctx : + ctx->frames->device_ref); if (!hwconfig) { err = AVERROR(ENOMEM); goto fail; @@ -381,24 +385,77 @@ static int vaapi_decode_make_config(AVCodecContext *avctx) hwconfig->config_id = ctx->va_config; constraints = -av_hwdevice_get_hwframe_constraints(ctx->frames->device_ref, +av_hwdevice_get_hwframe_constraints(avctx->hw_device_ctx ? +avctx->hw_device_ctx : +ctx->frames->device_ref, hwconfig); if (!constraints) { -// Ignore. -} else { -if (avctx->coded_width < constraints->min_width || -avctx->coded_height < constraints->min_height || -avctx->coded_width > constraints->max_width || -avctx->coded_height > constraints->max_height) { -av_log(avctx, AV_LOG_ERROR, "Hardware does not support image " - "size %dx%d (constraints: width %d-%d height %d-%d).\n", - avctx->coded_width, avctx->coded_height, - constraints->min_width, constraints->max_width, - constraints->min_height, constraints->max_height); -err = AVERROR(EINVAL); -goto fail; +err = AVERROR(ENOMEM); +goto fail; +} + +if (avctx->coded_width < constraints->min_width || +avctx->coded_height < constraints->min_height || +avctx->coded_width > constraints->max_width || +avctx->coded_height > constraints->max_height) { +av_log(avctx, AV_LOG_ERROR, "Hardware does not support image " + "size %dx%d (constraints: width %d-%d height %d-%d).\n", + avctx->coded_width, avctx->coded_height, + constraints->min_width, constraints->max_width, + constraints->min_height, constraints->max_height); +err = AVERROR(EINVAL); +goto fail; +} +if (!constraints->valid_sw_formats || +constraints->valid_sw_formats[0] == AV_PIX_FMT_NONE) { +av_log(avctx, AV_LOG_ERROR, "Hardware does not offer any " + "usable surface formats.\n"); +err = AVERROR(EINVAL); +goto fail; +} + +// Find the first format in the list which matches the expected +// bit depth and subsampling. If none are found (this can happen +// when 10-bit streams are decoded to 8-bit surfaces, for example) +// then just take the first format on the list. +ctx->surface_format = constraints->valid_sw_formats[0]; +sw_desc = av_pix_fmt_desc_get(avctx->sw_pix_fmt); +for (i = 0; constraints->valid_sw_formats[i] != AV_PIX_FMT_NONE; i++) { +desc = av_pix_fmt_desc_get(constraints->valid_sw_formats[i]); +if (desc->nb_components != sw_desc->nb_components || +desc->log2_chroma_w != sw_desc->log2_chroma_w || +desc->log2_chroma_h != sw_desc->log2_chroma_h) +continue; +for (j = 0; j < desc->nb_components; j++) { +if (desc->comp[j].depth != sw_desc->comp[j].depth) +break; } +if (j < desc->nb_components) +continue; +ctx->surface_format = constraints->valid_sw_formats[i]; +break; +} + +// Start with at
[FFmpeg-cvslog] Merge commit '44f2eda39ff55c69d4d739fb12a42a10b7ce581c'
ffmpeg | branch: master | James Almer| Thu Sep 28 00:02:15 2017 -0300| [d7458ca8d7c8ae65fca0e4641cdc77c6dc327808] | committer: James Almer Merge commit '44f2eda39ff55c69d4d739fb12a42a10b7ce581c' * commit '44f2eda39ff55c69d4d739fb12a42a10b7ce581c': lavc: Add device context field to AVCodecContext This commit is a noop, see c1a5fca06f75cc0e7b9b2808fecaa0c1b424da50 Merged-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d7458ca8d7c8ae65fca0e4641cdc77c6dc327808 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavc: Add device context field to AVCodecContext
ffmpeg | branch: master | Mark Thompson| Sat Feb 11 15:13:04 2017 +| [44f2eda39ff55c69d4d739fb12a42a10b7ce581c] | committer: Mark Thompson lavc: Add device context field to AVCodecContext For use by codec implementations which can allocate frames internally. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=44f2eda39ff55c69d4d739fb12a42a10b7ce581c --- doc/APIchanges | 3 +++ libavcodec/avcodec.h | 25 - libavcodec/utils.c | 1 + libavcodec/version.h | 2 +- 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index e7a0b14038..a919ffb2bf 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -13,6 +13,9 @@ libavutil: 2015-08-28 API changes, most recent first: +2017-xx-xx - xxx - lavc 57.34.0 - avcodec.h + Add AVCodecContext.hw_device_ctx. + 2017-02-11 - xxx - lavu 55.32.0 - frame.h Add AVFrame.opaque_ref. diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 8d8fa594aa..b7bf85a041 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -3093,7 +3093,8 @@ typedef struct AVCodecContext { /** * A reference to the AVHWFramesContext describing the input (for encoding) * or output (decoding) frames. The reference is set by the caller and - * afterwards owned (and freed) by libavcodec. + * afterwards owned (and freed) by libavcodec - it should never be read by + * the caller after being set. * * - decoding: This field should be set by the caller from the get_format() * callback. The previous reference (if any) will always be @@ -3139,6 +3140,28 @@ typedef struct AVCodecContext { * (with the display dimensions being determined by the crop_* fields). */ int apply_cropping; + +/** + * A reference to the AVHWDeviceContext describing the device which will + * be used by a hardware encoder/decoder. The reference is set by the + * caller and afterwards owned (and freed) by libavcodec. + * + * This should be used if either the codec device does not require + * hardware frames or any that are used are to be allocated internally by + * libavcodec. If the user wishes to supply any of the frames used as + * encoder input or decoder output then hw_frames_ctx should be used + * instead. When hw_frames_ctx is set in get_format() for a decoder, this + * field will be ignored while decoding the associated stream segment, but + * may again be used on a following one after another get_format() call. + * + * For both encoders and decoders this field should be set before + * avcodec_open2() is called and must not be written to thereafter. + * + * Note that some decoders may require this field to be set initially in + * order to support hw_frames_ctx at all - in that case, all frames + * contexts used must be created on the same device. + */ +AVBufferRef *hw_device_ctx; } AVCodecContext; /** diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 06a5784046..ea4d5fa312 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -794,6 +794,7 @@ av_cold int avcodec_close(AVCodecContext *avctx) avctx->nb_coded_side_data = 0; av_buffer_unref(>hw_frames_ctx); +av_buffer_unref(>hw_device_ctx); if (avctx->priv_data && avctx->codec && avctx->codec->priv_class) av_opt_free(avctx->priv_data); diff --git a/libavcodec/version.h b/libavcodec/version.h index 2ade539c60..a6eda6a691 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -28,7 +28,7 @@ #include "libavutil/version.h" #define LIBAVCODEC_VERSION_MAJOR 57 -#define LIBAVCODEC_VERSION_MINOR 33 +#define LIBAVCODEC_VERSION_MINOR 34 #define LIBAVCODEC_VERSION_MICRO 0 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '07b5136c481d394992c7e951967df0cfbb346c0b'
ffmpeg | branch: master | James Almer| Thu Sep 28 00:00:23 2017 -0300| [d987f9cfe37027758eac54ccac1d9fa040fd5707] | committer: James Almer Merge commit '07b5136c481d394992c7e951967df0cfbb346c0b' * commit '07b5136c481d394992c7e951967df0cfbb346c0b': aarch64: vp9lpf: Fix broken indentation/vertical alignment aarch64: vp9lpf: Interleave the start of flat8in into the calculation above arm: vp9lpf: Interleave the start of flat8in into the calculation above This commit is a noop, see 83399cf569c9f78e0c72e21aa67184c222bb2d59 9f3a8863648ed19ea69ca5ddfcfa3c80e0df15b0 c8d6eec85d6a87c9075c87d5eb75af47c964fff8 Merged-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d987f9cfe37027758eac54ccac1d9fa040fd5707 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] aarch64: vp9lpf: Interleave the start of flat8in into the calculation above
ffmpeg | branch: master | Martin Storsjö| Tue Jan 10 22:08:50 2017 +0200| [b0806088d3b27044145b20421da8d39089ae0c6a] | committer: Martin Storsjö aarch64: vp9lpf: Interleave the start of flat8in into the calculation above This adds lots of extra .ifs, but speeds it up by a couple cycles, by avoiding stalls. Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b0806088d3b27044145b20421da8d39089ae0c6a --- libavcodec/aarch64/vp9lpf_neon.S | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/libavcodec/aarch64/vp9lpf_neon.S b/libavcodec/aarch64/vp9lpf_neon.S index 3b8e6ebc99..2b8a478383 100644 --- a/libavcodec/aarch64/vp9lpf_neon.S +++ b/libavcodec/aarch64/vp9lpf_neon.S @@ -338,20 +338,28 @@ uxtl_sz v0.8h, v1.8h, v22, \sz// p1 uxtl_sz v2.8h, v3.8h, v25, \sz// q1 +.if \wd >= 8 +mov x5, v6.d[0] +.ifc \sz, .16b +mov x6, v6.d[1] +.endif +.endif saddw_szv0.8h, v1.8h, v0.8h, v1.8h, \tmp3, \sz // p1 + f ssubw_szv2.8h, v3.8h, v2.8h, v3.8h, \tmp3, \sz // q1 - f sqxtun_sz v0, v0.8h, v1.8h, \sz // out p1 sqxtun_sz v2, v2.8h, v3.8h, \sz // out q1 +.if \wd >= 8 +.ifc \sz, .16b +addsx5, x5, x6 +.endif +.endif bit v22\sz, v0\sz, v5\sz // if (!hev && fm && !flat8in) bit v25\sz, v2\sz, v5\sz // If no pixels need flat8in, jump to flat8out // (or to a writeout of the inner 4 pixels, for wd=8) .if \wd >= 8 -mov x5, v6.d[0] .ifc \sz, .16b -mov x6, v6.d[1] -addsx5, x5, x6 b.eq6f .else cbz x5, 6f ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] aarch64: vp9lpf: Fix broken indentation/vertical alignment
ffmpeg | branch: master | Martin Storsjö| Wed Jan 11 11:58:02 2017 +0200| [07b5136c481d394992c7e951967df0cfbb346c0b] | committer: Martin Storsjö aarch64: vp9lpf: Fix broken indentation/vertical alignment Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=07b5136c481d394992c7e951967df0cfbb346c0b --- libavcodec/aarch64/vp9lpf_neon.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/aarch64/vp9lpf_neon.S b/libavcodec/aarch64/vp9lpf_neon.S index 2b8a478383..5fafc7ad5c 100644 --- a/libavcodec/aarch64/vp9lpf_neon.S +++ b/libavcodec/aarch64/vp9lpf_neon.S @@ -417,7 +417,7 @@ mov x5, v2.d[0] .ifc \sz, .16b mov x6, v2.d[1] -adds x5, x5, x6 +addsx5, x5, x6 b.ne1f .else cbnzx5, 1f @@ -430,7 +430,7 @@ mov x5, v7.d[0] .ifc \sz, .16b mov x6, v7.d[1] -adds x5, x5, x6 +addsx5, x5, x6 b.ne1f .else cbnzx5, 1f ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] arm: vp9lpf: Interleave the start of flat8in into the calculation above
ffmpeg | branch: master | Martin Storsjö| Tue Jan 10 16:49:13 2017 +0200| [e18c39005ad1dbb178b336f691da1de91afd434e] | committer: Martin Storsjö arm: vp9lpf: Interleave the start of flat8in into the calculation above This adds lots of extra .ifs, but speeds it up by a couple cycles, by avoiding stalls. Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e18c39005ad1dbb178b336f691da1de91afd434e --- libavcodec/arm/vp9lpf_neon.S | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libavcodec/arm/vp9lpf_neon.S b/libavcodec/arm/vp9lpf_neon.S index c2f1c95427..1e161e0c63 100644 --- a/libavcodec/arm/vp9lpf_neon.S +++ b/libavcodec/arm/vp9lpf_neon.S @@ -182,16 +182,20 @@ vmovl.u8q0, d22@ p1 vmovl.u8q1, d25@ q1 +.if \wd >= 8 +vmovr2, r3, d6 +.endif vaddw.s8q0, q0, \tmp3 @ p1 + f vsubw.s8q1, q1, \tmp3 @ q1 - f +.if \wd >= 8 +orrsr2, r2, r3 +.endif vqmovun.s16 d0, q0 @ out p1 vqmovun.s16 d2, q1 @ out q1 vbitd22, d0, d5@ if (!hev && fm && !flat8in) vbitd25, d2, d5 .if \wd >= 8 -vmovr2, r3, d6 -orrsr2, r2, r3 @ If no pixels need flat8in, jump to flat8out @ (or to a writeout of the inner 4 pixels, for wd=8) beq 6f ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] doc/libav-merge: mention skipped or incomplete runtime alignment commits
ffmpeg | branch: master | James Almer| Wed Sep 27 23:57:30 2017 -0300| [774295a3e01a52e20df5b34b56d54f5ff4f0746a] | committer: James Almer doc/libav-merge: mention skipped or incomplete runtime alignment commits Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=774295a3e01a52e20df5b34b56d54f5ff4f0746a --- doc/libav-merge.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/libav-merge.txt b/doc/libav-merge.txt index 96b008b71b..4a46bfcf46 100644 --- a/doc/libav-merge.txt +++ b/doc/libav-merge.txt @@ -98,6 +98,9 @@ Stuff that didn't reach the codebase: - Removal of the custom atomic API (5cc0057f49, see http://ffmpeg.org/pipermail/ffmpeg-devel/2017-March/209003.html) - new bitstream reader (see http://ffmpeg.org/pipermail/ffmpeg-devel/2017-April/209609.html) - use of the bsf instead of our parser for vp9 superframes (see fa1749dd34) +- use av_cpu_max_align() instead of hardcoding alignment requirements (see https://ffmpeg.org/pipermail/ffmpeg-devel/2017-September/215834.html) + - f44ec22e0 lavc: use av_cpu_max_align() instead of hardcoding alignment requirements + - 4de220d2e frame: allow align=0 (meaning automatic) for av_frame_get_buffer() Collateral damage that needs work locally: -- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '9c2d36fcaf8748b9baa9aba9264abefce711d67b'
ffmpeg | branch: master | James Almer| Wed Sep 27 23:52:22 2017 -0300| [a1dcb057e3dc0b19fd0d82745ae7ab4ccdf6a43f] | committer: James Almer Merge commit '9c2d36fcaf8748b9baa9aba9264abefce711d67b' * commit '9c2d36fcaf8748b9baa9aba9264abefce711d67b': dv: Convert to the new bitstream reader This commit is a noop, see http://ffmpeg.org/pipermail/ffmpeg-devel/2017-April/209609.html Merged-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a1dcb057e3dc0b19fd0d82745ae7ab4ccdf6a43f --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] dv: Convert to the new bitstream reader
ffmpeg | branch: master | Luca Barbato| Mon Apr 11 19:18:50 2016 +0200| [9c2d36fcaf8748b9baa9aba9264abefce711d67b] | committer: Diego Biurrun dv: Convert to the new bitstream reader > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9c2d36fcaf8748b9baa9aba9264abefce711d67b --- libavcodec/bitstream.h | 28 +++ libavcodec/dvdec.c | 94 ++ 2 files changed, 69 insertions(+), 53 deletions(-) diff --git a/libavcodec/bitstream.h b/libavcodec/bitstream.h index 996e32e83b..894a13e348 100644 --- a/libavcodec/bitstream.h +++ b/libavcodec/bitstream.h @@ -384,4 +384,32 @@ static inline int bitstream_apply_sign(BitstreamContext *bc, int val) return (val ^ sign) - sign; } +/* Unwind the cache so a refill_32 can fill it again. */ +static inline void bitstream_unwind(BitstreamContext *bc) +{ +int unwind = 4; +int unwind_bits = unwind * 8; + +if (bc->bits_left < unwind_bits) +return; + +bc->bits >>= unwind_bits; +bc->bits <<= unwind_bits; +bc->bits_left -= unwind_bits; +bc->ptr-= unwind; +} + +/* Unget up to 32 bits. */ +static inline void bitstream_unget(BitstreamContext *bc, uint64_t value, + size_t amount) +{ +size_t cache_size = sizeof(bc->bits) * 8; + +if (bc->bits_left + amount > cache_size) +bitstream_unwind(bc); + +bc->bits = (bc->bits >> amount) | (value << (cache_size - amount)); +bc->bits_left += amount; +} + #endif /* AVCODEC_BITSTREAM_H */ diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c index dc37a5efdd..a2f0171a1c 100644 --- a/libavcodec/dvdec.c +++ b/libavcodec/dvdec.c @@ -40,9 +40,9 @@ #include "libavutil/pixdesc.h" #include "avcodec.h" +#include "bitstream.h" #include "dv.h" #include "dvdata.h" -#include "get_bits.h" #include "idctdsp.h" #include "internal.h" #include "put_bits.h" @@ -80,51 +80,34 @@ static av_cold int dvvideo_decode_init(AVCodecContext *avctx) } /* decode AC coefficients */ -static void dv_decode_ac(GetBitContext *gb, BlockInfo *mb, int16_t *block) +static void dv_decode_ac(BitstreamContext *bc, BlockInfo *mb, int16_t *block) { -int last_index = gb->size_in_bits; const uint8_t *scan_table = mb->scan_table; const uint32_t *factor_table = mb->factor_table; int pos = mb->pos; int partial_bit_count= mb->partial_bit_count; -int level, run, vlc_len, index; - -OPEN_READER_NOSIZE(re, gb); -UPDATE_CACHE(re, gb); +int level, run; /* if we must parse a partial VLC, we do it here */ if (partial_bit_count > 0) { -re_cache = re_cache >> partial_bit_count | -mb->partial_bit_buffer; -re_index -= partial_bit_count; +bitstream_unget(bc, mb->partial_bit_buffer, partial_bit_count); mb->partial_bit_count = 0; } /* get the AC coefficients until last_index is reached */ for (;;) { -ff_dlog(NULL, "%2d: bits=%04x index=%u\n", pos, SHOW_UBITS(re, gb, 16), -re_index); -/* our own optimized GET_RL_VLC */ -index = NEG_USR32(re_cache, TEX_VLC_BITS); -vlc_len = ff_dv_rl_vlc[index].len; -if (vlc_len < 0) { -index = NEG_USR32((unsigned) re_cache << TEX_VLC_BITS, -vlc_len) + -ff_dv_rl_vlc[index].level; -vlc_len = TEX_VLC_BITS - vlc_len; -} -level = ff_dv_rl_vlc[index].level; -run = ff_dv_rl_vlc[index].run; - -/* gotta check if we're still within gb boundaries */ -if (re_index + vlc_len > last_index) { -/* should be < 16 bits otherwise a codeword could have been parsed */ -mb->partial_bit_count = last_index - re_index; -mb->partial_bit_buffer = re_cache & ~(-1u >> mb->partial_bit_count); -re_index = last_index; +BitstreamContext tmp = *bc; + +ff_dlog(NULL, "%2d: bits=%04x index=%d\n", +pos, bitstream_peek(bc, 16), bitstream_tell(bc)); + +BITSTREAM_RL_VLC(level, run, bc, ff_dv_rl_vlc, TEX_VLC_BITS, 2); + +if (bitstream_bits_left(bc) < 0) { +mb->partial_bit_count = bitstream_bits_left(); +mb->partial_bit_buffer = bitstream_peek(, mb->partial_bit_count); break; } -re_index += vlc_len; - ff_dlog(NULL, "run=%d level=%d\n", run, level); pos += run; if (pos >= 64) @@ -133,22 +116,22 @@ static void dv_decode_ac(GetBitContext *gb, BlockInfo *mb, int16_t *block) level = (level * factor_table[pos] + (1 << (dv_iweight_bits - 1))) >> dv_iweight_bits; block[scan_table[pos]] = level; - -UPDATE_CACHE(re, gb); } -CLOSE_READER(re, gb); mb->pos = pos; } -static inline void bit_copy(PutBitContext *pb, GetBitContext
[FFmpeg-cvslog] Merge commit 'ba30b74686f0cb6c9dd465ac4820059c48bf9d08'
ffmpeg | branch: master | James Almer| Wed Sep 27 23:48:40 2017 -0300| [e9a388061371d35a949106c627018122ad07eb04] | committer: James Almer Merge commit 'ba30b74686f0cb6c9dd465ac4820059c48bf9d08' * commit 'ba30b74686f0cb6c9dd465ac4820059c48bf9d08': aac: Validate the sbr sample rate before using the value See cf5f4c5169639349262aa221ae485a0de188afb1 Merged-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e9a388061371d35a949106c627018122ad07eb04 --- libavcodec/aacsbr_template.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libavcodec/aacsbr_template.c b/libavcodec/aacsbr_template.c index 930d33e9e5..3fe78d5b62 100644 --- a/libavcodec/aacsbr_template.c +++ b/libavcodec/aacsbr_template.c @@ -261,13 +261,6 @@ static int sbr_make_f_master(AACContext *ac, SpectralBandReplication *sbr, const int8_t *sbr_offset_ptr; int16_t stop_dk[13]; -if (sbr->sample_rate < 32000) { -temp = 3000; -} else if (sbr->sample_rate < 64000) { -temp = 4000; -} else -temp = 5000; - switch (sbr->sample_rate) { case 16000: sbr_offset_ptr = sbr_offset[0]; @@ -293,6 +286,13 @@ static int sbr_make_f_master(AACContext *ac, SpectralBandReplication *sbr, return -1; } +if (sbr->sample_rate < 32000) { +temp = 3000; +} else if (sbr->sample_rate < 64000) { +temp = 4000; +} else +temp = 5000; + start_min = ((temp << 7) + (sbr->sample_rate >> 1)) / sbr->sample_rate; stop_min = ((temp << 8) + (sbr->sample_rate >> 1)) / sbr->sample_rate; == diff --cc libavcodec/aacsbr_template.c index 930d33e9e5,00..3fe78d5b62 mode 100644,00..100644 --- a/libavcodec/aacsbr_template.c +++ b/libavcodec/aacsbr_template.c @@@ -1,1571 -1,0 +1,1571 @@@ +/* + * AAC Spectral Band Replication decoding functions + * Copyright (c) 2008-2009 Robert Swain ( rob opendot cl ) + * Copyright (c) 2009-2010 Alex Converse + * + * Fixed point code + * Copyright (c) 2013 + * MIPS Technologies, Inc., California. + * + * 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 + */ + +/** + * @file + * AAC Spectral Band Replication decoding functions + * @author Robert Swain ( rob opendot cl ) + * @author Stanislav Ocovaj ( stanislav.oco...@imgtec.com ) + * @author Zoran Basaric ( zoran.basa...@imgtec.com ) + */ + +#include "libavutil/qsort.h" + +av_cold void AAC_RENAME(ff_aac_sbr_init)(void) +{ +static const struct { +const void *sbr_codes, *sbr_bits; +const unsigned int table_size, elem_size; +} sbr_tmp[] = { +SBR_VLC_ROW(t_huffman_env_1_5dB), +SBR_VLC_ROW(f_huffman_env_1_5dB), +SBR_VLC_ROW(t_huffman_env_bal_1_5dB), +SBR_VLC_ROW(f_huffman_env_bal_1_5dB), +SBR_VLC_ROW(t_huffman_env_3_0dB), +SBR_VLC_ROW(f_huffman_env_3_0dB), +SBR_VLC_ROW(t_huffman_env_bal_3_0dB), +SBR_VLC_ROW(f_huffman_env_bal_3_0dB), +SBR_VLC_ROW(t_huffman_noise_3_0dB), +SBR_VLC_ROW(t_huffman_noise_bal_3_0dB), +}; + +// SBR VLC table initialization +SBR_INIT_VLC_STATIC(0, 1098); +SBR_INIT_VLC_STATIC(1, 1092); +SBR_INIT_VLC_STATIC(2, 768); +SBR_INIT_VLC_STATIC(3, 1026); +SBR_INIT_VLC_STATIC(4, 1058); +SBR_INIT_VLC_STATIC(5, 1052); +SBR_INIT_VLC_STATIC(6, 544); +SBR_INIT_VLC_STATIC(7, 544); +SBR_INIT_VLC_STATIC(8, 592); +SBR_INIT_VLC_STATIC(9, 512); + +aacsbr_tableinit(); + +AAC_RENAME(ff_ps_init)(); +} + +/** Places SBR in pure upsampling mode. */ +static void sbr_turnoff(SpectralBandReplication *sbr) { +sbr->start = 0; +sbr->ready_for_dequant = 0; +// Init defults used in pure upsampling mode +sbr->kx[1] = 32; //Typo in spec, kx' inits to 32 +sbr->m[1] = 0; +// Reset values for first SBR header +sbr->data[0].e_a[1] = sbr->data[1].e_a[1] = -1; +memset(>spectrum_params, -1, sizeof(SpectrumParameters)); +} + +av_cold void AAC_RENAME(ff_aac_sbr_ctx_init)(AACContext *ac, SpectralBandReplication *sbr, int
[FFmpeg-cvslog] aac: Validate the sbr sample rate before using the value
ffmpeg | branch: master | Luca Barbato| Sat Feb 11 15:40:20 2017 +0100| [ba30b74686f0cb6c9dd465ac4820059c48bf9d08] | committer: Luca Barbato aac: Validate the sbr sample rate before using the value Avoid a floating point exception. Bug-Id: 1027 CC: libav-sta...@libav.org > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ba30b74686f0cb6c9dd465ac4820059c48bf9d08 --- libavcodec/aacsbr.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/libavcodec/aacsbr.c b/libavcodec/aacsbr.c index fc08079194..99f7b0829c 100644 --- a/libavcodec/aacsbr.c +++ b/libavcodec/aacsbr.c @@ -327,16 +327,6 @@ static int sbr_make_f_master(AACContext *ac, SpectralBandReplication *sbr, const int8_t *sbr_offset_ptr; int16_t stop_dk[13]; -if (sbr->sample_rate < 32000) { -temp = 3000; -} else if (sbr->sample_rate < 64000) { -temp = 4000; -} else -temp = 5000; - -start_min = ((temp << 7) + (sbr->sample_rate >> 1)) / sbr->sample_rate; -stop_min = ((temp << 8) + (sbr->sample_rate >> 1)) / sbr->sample_rate; - switch (sbr->sample_rate) { case 16000: sbr_offset_ptr = sbr_offset[0]; @@ -362,6 +352,16 @@ static int sbr_make_f_master(AACContext *ac, SpectralBandReplication *sbr, return -1; } +if (sbr->sample_rate < 32000) { +temp = 3000; +} else if (sbr->sample_rate < 64000) { +temp = 4000; +} else +temp = 5000; + +start_min = ((temp << 7) + (sbr->sample_rate >> 1)) / sbr->sample_rate; +stop_min = ((temp << 8) + (sbr->sample_rate >> 1)) / sbr->sample_rate; + sbr->k[0] = start_min + sbr_offset_ptr[spectrum->bs_start_freq]; if (spectrum->bs_stop_freq < 14) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] configure: Move up the avbuild directory creation
ffmpeg | branch: master | Luca Barbato| Fri Feb 10 19:31:34 2017 +| [0ee78020cd41d81eec651acd7fc65906207796f3] | committer: Luca Barbato configure: Move up the avbuild directory creation The early check for inconsistent in-source vs out-of-source build cannot generate a config.log otherwise. Signed-off-by: Luca Barbato > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0ee78020cd41d81eec651acd7fc65906207796f3 --- configure | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 9ebc3bf894..69f5863582 100755 --- a/configure +++ b/configure @@ -2622,6 +2622,8 @@ target_path='$(CURDIR)' DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $(@:.o=.d)' DEPFLAGS='-MM' +mkdir -p avbuild + # find source path if test -f configure; then source_path=. @@ -2839,7 +2841,6 @@ disable_components(){ map 'disable_components $v' $LIBRARY_LIST -mkdir -p avbuild echo "# $0 $LIBAV_CONFIGURATION" > $logfile set >> $logfile ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '0ee78020cd41d81eec651acd7fc65906207796f3'
ffmpeg | branch: master | James Almer| Wed Sep 27 23:41:24 2017 -0300| [b02b43a823a6ff0278f1ac5d0cfe3ac698d67ba5] | committer: James Almer Merge commit '0ee78020cd41d81eec651acd7fc65906207796f3' * commit '0ee78020cd41d81eec651acd7fc65906207796f3': configure: Move up the avbuild directory creation This commit is a noop, see 19bf50406ebf8bff1be7388da2ed7a85738d055f Merged-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b02b43a823a6ff0278f1ac5d0cfe3ac698d67ba5 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'c2f97f050870897575570708ac48c5c15e6a0dd8'
ffmpeg | branch: master | James Almer| Wed Sep 27 23:37:43 2017 -0300| [596a4cbd0a1bcd2a45fbc97538d4e9bf35bf14a2] | committer: James Almer Merge commit 'c2f97f050870897575570708ac48c5c15e6a0dd8' * commit 'c2f97f050870897575570708ac48c5c15e6a0dd8': hwcontext_dxva2: support D3D9Ex This commit is a noop, see 50708f4aa40ce96122cf93d9e36cca8024baf025 Merged-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=596a4cbd0a1bcd2a45fbc97538d4e9bf35bf14a2 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] hwcontext_dxva2: support D3D9Ex
ffmpeg | branch: master | wm4| Fri Feb 10 12:17:24 2017 +0100| [c2f97f050870897575570708ac48c5c15e6a0dd8] | committer: Anton Khirnov hwcontext_dxva2: support D3D9Ex D3D9Ex uses different driver paths. This helps with "headless" configurations when no user logs in. Plain D3D9 device creation will fail if no user is logged in, while it works with D3D9Ex. Signed-off-by: Anton Khirnov > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c2f97f050870897575570708ac48c5c15e6a0dd8 --- libavutil/hwcontext_dxva2.c | 117 1 file changed, 87 insertions(+), 30 deletions(-) diff --git a/libavutil/hwcontext_dxva2.c b/libavutil/hwcontext_dxva2.c index ccf03c8e9f..3790bed4b7 100644 --- a/libavutil/hwcontext_dxva2.c +++ b/libavutil/hwcontext_dxva2.c @@ -38,8 +38,22 @@ #include "pixfmt.h" typedef IDirect3D9* WINAPI pDirect3DCreate9(UINT); +typedef HRESULT WINAPI pDirect3DCreate9Ex(UINT, IDirect3D9Ex **); typedef HRESULT WINAPI pCreateDeviceManager9(UINT *, IDirect3DDeviceManager9 **); +#define FF_D3DCREATE_FLAGS (D3DCREATE_SOFTWARE_VERTEXPROCESSING | \ +D3DCREATE_MULTITHREADED | \ +D3DCREATE_FPU_PRESERVE) + +static const D3DPRESENT_PARAMETERS dxva2_present_params = { +.Windowed = TRUE, +.BackBufferWidth = 640, +.BackBufferHeight = 480, +.BackBufferCount = 0, +.SwapEffect = D3DSWAPEFFECT_DISCARD, +.Flags= D3DPRESENTFLAG_VIDEO, +}; + typedef struct DXVA2Mapping { uint32_t palette_dummy[256]; } DXVA2Mapping; @@ -411,19 +425,83 @@ static void dxva2_device_free(AVHWDeviceContext *ctx) av_freep(>user_opaque); } +static int dxva2_device_create9(AVHWDeviceContext *ctx, UINT adapter) +{ +DXVA2DevicePriv *priv = ctx->user_opaque; +D3DPRESENT_PARAMETERS d3dpp = dxva2_present_params; +D3DDISPLAYMODE d3ddm; +HRESULT hr; +pDirect3DCreate9 *createD3D = (pDirect3DCreate9 *)GetProcAddress(priv->d3dlib, "Direct3DCreate9"); +if (!createD3D) { +av_log(ctx, AV_LOG_ERROR, "Failed to locate Direct3DCreate9\n"); +return AVERROR_UNKNOWN; +} + +priv->d3d9 = createD3D(D3D_SDK_VERSION); +if (!priv->d3d9) { +av_log(ctx, AV_LOG_ERROR, "Failed to create IDirect3D object\n"); +return AVERROR_UNKNOWN; +} + +IDirect3D9_GetAdapterDisplayMode(priv->d3d9, adapter, ); + +d3dpp.BackBufferFormat = d3ddm.Format; + +hr = IDirect3D9_CreateDevice(priv->d3d9, adapter, D3DDEVTYPE_HAL, GetShellWindow(), +FF_D3DCREATE_FLAGS, +, >d3d9device); +if (FAILED(hr)) { +av_log(ctx, AV_LOG_ERROR, "Failed to create Direct3D device\n"); +return AVERROR_UNKNOWN; +} + +return 0; +} + +static int dxva2_device_create9ex(AVHWDeviceContext *ctx, UINT adapter) +{ +DXVA2DevicePriv *priv = ctx->user_opaque; +D3DPRESENT_PARAMETERS d3dpp = dxva2_present_params; +D3DDISPLAYMODEEX modeex = {0}; +IDirect3D9Ex *d3d9ex = NULL; +IDirect3DDevice9Ex *exdev = NULL; +HRESULT hr; +pDirect3DCreate9Ex *createD3DEx = (pDirect3DCreate9Ex *)GetProcAddress(priv->d3dlib, "Direct3DCreate9Ex"); +if (!createD3DEx) +return AVERROR(ENOSYS); + +hr = createD3DEx(D3D_SDK_VERSION, ); +if (FAILED(hr)) +return AVERROR_UNKNOWN; + +IDirect3D9Ex_GetAdapterDisplayModeEx(d3d9ex, adapter, , NULL); + +d3dpp.BackBufferFormat = modeex.Format; + +hr = IDirect3D9Ex_CreateDeviceEx(d3d9ex, adapter, D3DDEVTYPE_HAL, GetShellWindow(), + FF_D3DCREATE_FLAGS, + , NULL, ); +if (FAILED(hr)) { +IDirect3D9Ex_Release(d3d9ex); +return AVERROR_UNKNOWN; +} + +av_log(ctx, AV_LOG_VERBOSE, "Using D3D9Ex device.\n"); +priv->d3d9 = (IDirect3D9 *)d3d9ex; +priv->d3d9device = (IDirect3DDevice9 *)exdev; +return 0; +} + static int dxva2_device_create(AVHWDeviceContext *ctx, const char *device, AVDictionary *opts, int flags) { AVDXVA2DeviceContext *hwctx = ctx->hwctx; DXVA2DevicePriv *priv; - -pDirect3DCreate9 *createD3D = NULL; pCreateDeviceManager9 *createDeviceManager = NULL; -D3DPRESENT_PARAMETERS d3dpp = {0}; -D3DDISPLAYMODEd3ddm; unsigned resetToken = 0; UINT adapter = D3DADAPTER_DEFAULT; HRESULT hr; +int err; if (device) adapter = atoi(device); @@ -448,11 +526,6 @@ static int dxva2_device_create(AVHWDeviceContext *ctx, const char *device, return AVERROR_UNKNOWN; } -createD3D = (pDirect3DCreate9 *)GetProcAddress(priv->d3dlib, "Direct3DCreate9"); -if (!createD3D) { -av_log(ctx, AV_LOG_ERROR, "Failed to locate Direct3DCreate9\n"); -return AVERROR_UNKNOWN; -} createDeviceManager = (pCreateDeviceManager9
[FFmpeg-cvslog] Merge commit '04f3bd349651694f30feeb8c4ed9bc58106fca54'
ffmpeg | branch: master | James Almer| Wed Sep 27 23:35:59 2017 -0300| [11f3a7ae108ab26ce334d362f076bfdd9c803a43] | committer: James Almer Merge commit '04f3bd349651694f30feeb8c4ed9bc58106fca54' * commit '04f3bd349651694f30feeb8c4ed9bc58106fca54': AVFrame: add an opaque_ref field This commit is a noop, see e3af49b14bf371e18fab1c12cba0239e6658672c Merged-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=11f3a7ae108ab26ce334d362f076bfdd9c803a43 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] AVFrame: add an opaque_ref field
ffmpeg | branch: master | wm4| Thu Feb 2 11:27:54 2017 +0100| [04f3bd349651694f30feeb8c4ed9bc58106fca54] | committer: Anton Khirnov AVFrame: add an opaque_ref field This is an extended version of the AVFrame.opaque field, which can be used to attach arbitrary user information to an AVFrame. The usefulness of the opaque field is rather limited, because it can store only up to 32 bits of information (or 64 bit on 64 bit systems). It's not possible to set this field to a memory allocation, because there is no way to deallocate it correctly. The opaque_ref field circumvents this by letting the user set an AVBuffer, which makes the user data refcounted. Signed-off-by: Anton Khirnov > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=04f3bd349651694f30feeb8c4ed9bc58106fca54 --- doc/APIchanges | 3 +++ libavutil/frame.c | 9 + libavutil/frame.h | 11 +++ libavutil/version.h | 4 ++-- 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index 9b9f46ef49..e7a0b14038 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -13,6 +13,9 @@ libavutil: 2015-08-28 API changes, most recent first: +2017-02-11 - xxx - lavu 55.32.0 - frame.h + Add AVFrame.opaque_ref. + 2017-02-xx - xxx - lavu 55.31.1 - frame.h Allow passing the value of 0 (meaning "automatic") as the required alignment to av_frame_get_buffer(). diff --git a/libavutil/frame.c b/libavutil/frame.c index aa5820c0e9..9cd5f9ab37 100644 --- a/libavutil/frame.c +++ b/libavutil/frame.c @@ -317,6 +317,8 @@ void av_frame_unref(AVFrame *frame) av_buffer_unref(>hw_frames_ctx); +av_buffer_unref(>opaque_ref); + get_frame_defaults(frame); } @@ -440,6 +442,13 @@ FF_ENABLE_DEPRECATION_WARNINGS av_dict_copy(_dst->metadata, sd_src->metadata, 0); } +av_buffer_unref(>opaque_ref); +if (src->opaque_ref) { +dst->opaque_ref = av_buffer_ref(src->opaque_ref); +if (!dst->opaque_ref) +return AVERROR(ENOMEM); +} + return 0; } diff --git a/libavutil/frame.h b/libavutil/frame.h index 4f63fb0249..f9ffb5bbbf 100644 --- a/libavutil/frame.h +++ b/libavutil/frame.h @@ -395,6 +395,17 @@ typedef struct AVFrame { /** * @} */ + +/** + * AVBufferRef for free use by the API user. Libav will never check the + * contents of the buffer ref. Libav calls av_buffer_unref() on it when + * the frame is unreferenced. av_frame_copy_props() calls create a new + * reference with av_buffer_ref() for the target frame's opaque_ref field. + * + * This is unrelated to the opaque field, although it serves a similar + * purpose. + */ +AVBufferRef *opaque_ref; } AVFrame; /** diff --git a/libavutil/version.h b/libavutil/version.h index 0768f9fe99..5dbc57cc1b 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -54,8 +54,8 @@ */ #define LIBAVUTIL_VERSION_MAJOR 55 -#define LIBAVUTIL_VERSION_MINOR 31 -#define LIBAVUTIL_VERSION_MICRO 1 +#define LIBAVUTIL_VERSION_MINOR 32 +#define LIBAVUTIL_VERSION_MICRO 0 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ LIBAVUTIL_VERSION_MINOR, \ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '4de220d2e3751c459f8739a08ac6ca52e63eba30'
ffmpeg | branch: master | James Almer| Wed Sep 27 23:29:20 2017 -0300| [7aa6b8a68fce93d84c359158f198cd55324d0025] | committer: James Almer Merge commit '4de220d2e3751c459f8739a08ac6ca52e63eba30' * commit '4de220d2e3751c459f8739a08ac6ca52e63eba30': frame: allow align=0 (meaning automatic) for av_frame_get_buffer() See https://ffmpeg.org/pipermail/ffmpeg-devel/2017-September/215834.html Merged-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7aa6b8a68fce93d84c359158f198cd55324d0025 --- doc/APIchanges | 4 libavutil/frame.c | 3 +++ libavutil/frame.h | 4 +++- libavutil/version.h | 2 +- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index 4838ec3728..606ba7f6c0 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -15,6 +15,10 @@ libavutil: 2015-08-28 API changes, most recent first: +2017-09-27 - xxx - lavu 55.77.101 / lavu 55.31.1 - frame.h + Allow passing the value of 0 (meaning "automatic") as the required alignment + to av_frame_get_buffer(). + 2017-09-27 - xxx - lavu 55.77.100 / lavu 55.31.0 - cpu.h Add av_cpu_max_align() for querying maximum required data alignment. diff --git a/libavutil/frame.c b/libavutil/frame.c index 85d89b9ed5..d5fd2932e3 100644 --- a/libavutil/frame.c +++ b/libavutil/frame.c @@ -181,6 +181,9 @@ static int get_video_buffer(AVFrame *frame, int align) return ret; if (!frame->linesize[0]) { +if (align <= 0) +align = 32; /* STRIDE_ALIGN. Should be av_cpu_max_align() */ + for(i=1; i<=align; i+=i) { ret = av_image_fill_linesizes(frame->linesize, frame->format, FFALIGN(frame->width, i)); diff --git a/libavutil/frame.h b/libavutil/frame.h index 013043c250..b8591a442b 100644 --- a/libavutil/frame.h +++ b/libavutil/frame.h @@ -681,7 +681,9 @@ void av_frame_move_ref(AVFrame *dst, AVFrame *src); * cases. * * @param frame frame in which to store the new buffers. - * @param align required buffer size alignment + * @param align Required buffer size alignment. If equal to 0, alignment will be + * chosen automatically for the current CPU. It is highly + * recommended to pass 0 here unless you know what you are doing. * * @return 0 on success, a negative AVERROR on error. */ diff --git a/libavutil/version.h b/libavutil/version.h index 9dbcdc4a8c..dee4f5b4c5 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -81,7 +81,7 @@ #define LIBAVUTIL_VERSION_MAJOR 55 #define LIBAVUTIL_VERSION_MINOR 77 -#define LIBAVUTIL_VERSION_MICRO 100 +#define LIBAVUTIL_VERSION_MICRO 101 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ LIBAVUTIL_VERSION_MINOR, \ == diff --cc doc/APIchanges index 4838ec3728,9b9f46ef49..606ba7f6c0 --- a/doc/APIchanges +++ b/doc/APIchanges @@@ -15,10 -13,17 +15,14 @@@ libavutil: 2015-08-2 API changes, most recent first: -2017-02-xx - xxx - lavu 55.31.1 - frame.h ++2017-09-27 - xxx - lavu 55.77.101 / lavu 55.31.1 - frame.h + Allow passing the value of 0 (meaning "automatic") as the required alignment + to av_frame_get_buffer(). + -2017-02-xx - xxx - lavu 55.31.0 - cpu.h +2017-09-27 - xxx - lavu 55.77.100 / lavu 55.31.0 - cpu.h Add av_cpu_max_align() for querying maximum required data alignment. -2016-xx-xx - xxx - lavf 57.11.0 - avio.h - Add avio_context_free(). From now on it must be used for freeing AVIOContext. - -2017-02-01 - xxx - lavc - avcodec.h +2017-09-26 - xxx - lavc 57.106.102 - avcodec.h Deprecate AVCodecContext.refcounted_frames. This was useful for deprecated API only (avcodec_decode_video2/avcodec_decode_audio4). The new decode APIs (avcodec_send_packet/avcodec_receive_frame) always work with reference diff --cc libavutil/frame.c index 85d89b9ed5,aa5820c0e9..d5fd2932e3 --- a/libavutil/frame.c +++ b/libavutil/frame.c @@@ -181,14 -99,13 +181,17 @@@ static int get_video_buffer(AVFrame *fr return ret; if (!frame->linesize[0]) { -ret = av_image_fill_linesizes(frame->linesize, frame->format, - frame->width); -if (ret < 0) -return ret; - + if (align <= 0) -align = av_cpu_max_align(); ++align = 32; /* STRIDE_ALIGN. Should be av_cpu_max_align() */ ++ +for(i=1; i<=align; i+=i) { +ret = av_image_fill_linesizes(frame->linesize, frame->format, + FFALIGN(frame->width, i)); +if (ret < 0) +return ret; +if (!(frame->linesize[0] & (align-1))) +break; +} for (i = 0; i < 4 &&
[FFmpeg-cvslog] frame: allow align=0 (meaning automatic) for av_frame_get_buffer()
ffmpeg | branch: master | Anton Khirnov| Wed Feb 8 09:46:04 2017 +0100| [4de220d2e3751c459f8739a08ac6ca52e63eba30] | committer: Anton Khirnov frame: allow align=0 (meaning automatic) for av_frame_get_buffer() This will avoid every caller from hardcoding some specific alignment, which may break in the future with new instruction sets. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4de220d2e3751c459f8739a08ac6ca52e63eba30 --- doc/APIchanges | 4 libavutil/frame.c | 4 libavutil/frame.h | 4 +++- libavutil/version.h | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index be34c92d3f..9b9f46ef49 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -13,6 +13,10 @@ libavutil: 2015-08-28 API changes, most recent first: +2017-02-xx - xxx - lavu 55.31.1 - frame.h + Allow passing the value of 0 (meaning "automatic") as the required alignment + to av_frame_get_buffer(). + 2017-02-xx - xxx - lavu 55.31.0 - cpu.h Add av_cpu_max_align() for querying maximum required data alignment. diff --git a/libavutil/frame.c b/libavutil/frame.c index aafaa57d8b..aa5820c0e9 100644 --- a/libavutil/frame.c +++ b/libavutil/frame.c @@ -19,6 +19,7 @@ #include "channel_layout.h" #include "buffer.h" #include "common.h" +#include "cpu.h" #include "dict.h" #include "frame.h" #include "imgutils.h" @@ -103,6 +104,9 @@ static int get_video_buffer(AVFrame *frame, int align) if (ret < 0) return ret; +if (align <= 0) +align = av_cpu_max_align(); + for (i = 0; i < 4 && frame->linesize[i]; i++) frame->linesize[i] = FFALIGN(frame->linesize[i], align); } diff --git a/libavutil/frame.h b/libavutil/frame.h index c718f7bd62..4f63fb0249 100644 --- a/libavutil/frame.h +++ b/libavutil/frame.h @@ -475,7 +475,9 @@ void av_frame_move_ref(AVFrame *dst, AVFrame *src); * cases. * * @param frame frame in which to store the new buffers. - * @param align required buffer size alignment + * @param align Required buffer size alignment. If equal to 0, alignment will be + * chosen automatically for the current CPU. It is highly + * recommended to pass 0 here unless you know what you are doing. * * @return 0 on success, a negative AVERROR on error. */ diff --git a/libavutil/version.h b/libavutil/version.h index 0fcd19a1eb..0768f9fe99 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -55,7 +55,7 @@ #define LIBAVUTIL_VERSION_MAJOR 55 #define LIBAVUTIL_VERSION_MINOR 31 -#define LIBAVUTIL_VERSION_MICRO 0 +#define LIBAVUTIL_VERSION_MICRO 1 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ LIBAVUTIL_VERSION_MINOR, \ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'f44ec22e095c5ba00ffeadd891655c456e3dd014'
ffmpeg | branch: master | James Almer| Wed Sep 27 23:16:43 2017 -0300| [24ee1b8c6343f00a3f5cd5d5aee5850f22436204] | committer: James Almer Merge commit 'f44ec22e095c5ba00ffeadd891655c456e3dd014' * commit 'f44ec22e095c5ba00ffeadd891655c456e3dd014': lavc: use av_cpu_max_align() instead of hardcoding alignment requirements This commit is a noop, see https://ffmpeg.org/pipermail/ffmpeg-devel/2017-September/215834.html Merged-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=24ee1b8c6343f00a3f5cd5d5aee5850f22436204 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavc: use av_cpu_max_align() instead of hardcoding alignment requirements
ffmpeg | branch: master | Anton Khirnov| Wed Feb 8 09:34:58 2017 +0100| [f44ec22e095c5ba00ffeadd891655c456e3dd014] | committer: Anton Khirnov lavc: use av_cpu_max_align() instead of hardcoding alignment requirements > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f44ec22e095c5ba00ffeadd891655c456e3dd014 --- libavcodec/utils.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 2978109a23..06a5784046 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -179,17 +179,10 @@ int ff_side_data_update_matrix_encoding(AVFrame *frame, return 0; } -#if HAVE_SIMD_ALIGN_32 -# define STRIDE_ALIGN 32 -#elif HAVE_SIMD_ALIGN_16 -# define STRIDE_ALIGN 16 -#else -# define STRIDE_ALIGN 8 -#endif - void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, int linesize_align[AV_NUM_DATA_POINTERS]) { +size_t max_align = av_cpu_max_align(); int i; int w_align = 1; int h_align = 1; @@ -282,7 +275,7 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, *height += 2; for (i = 0; i < 4; i++) -linesize_align[i] = STRIDE_ALIGN; +linesize_align[i] = max_align; } void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'e6bff23f1e11aefb16a2b5d6ee72bf7469c5a66e'
ffmpeg | branch: master | James Almer| Wed Sep 27 22:56:53 2017 -0300| [522f87708653af3badcdc33be983bcc6009de49b] | committer: James Almer Merge commit 'e6bff23f1e11aefb16a2b5d6ee72bf7469c5a66e' * commit 'e6bff23f1e11aefb16a2b5d6ee72bf7469c5a66e': cpu: add a function for querying maximum required data alignment Adapted to work with the arbitrary runtime cpuflag changes av_force_cpu_flags() can generate. Merged-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=522f87708653af3badcdc33be983bcc6009de49b --- doc/APIchanges | 3 +++ libavutil/cpu.c | 39 +++ libavutil/cpu.h | 13 + libavutil/version.h | 2 +- 4 files changed, 56 insertions(+), 1 deletion(-) diff --git a/doc/APIchanges b/doc/APIchanges index 52336d1dec..4838ec3728 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -15,6 +15,9 @@ libavutil: 2015-08-28 API changes, most recent first: +2017-09-27 - xxx - lavu 55.77.100 / lavu 55.31.0 - cpu.h + Add av_cpu_max_align() for querying maximum required data alignment. + 2017-09-26 - xxx - lavc 57.106.102 - avcodec.h Deprecate AVCodecContext.refcounted_frames. This was useful for deprecated API only (avcodec_decode_video2/avcodec_decode_audio4). The new decode APIs diff --git a/libavutil/cpu.c b/libavutil/cpu.c index a22da0fa8c..ab04494acf 100644 --- a/libavutil/cpu.c +++ b/libavutil/cpu.c @@ -16,9 +16,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include #include +#include "attributes.h" #include "cpu.h" #include "cpu_internal.h" #include "config.h" @@ -299,3 +301,40 @@ int av_cpu_count(void) return nb_cpus; } + +size_t av_cpu_max_align(void) +{ +int av_unused flags = av_get_cpu_flags(); + +#if ARCH_ARM || ARCH_AARCH64 +if (flags & AV_CPU_FLAG_NEON) +return 16; +#elif ARCH_PPC +if (flags & (AV_CPU_FLAG_ALTIVEC | + AV_CPU_FLAG_VSX | + AV_CPU_FLAG_POWER8)) +return 16; +#elif ARCH_X86 +if (flags & (AV_CPU_FLAG_AVX2 | + AV_CPU_FLAG_AVX | + AV_CPU_FLAG_XOP | + AV_CPU_FLAG_FMA4 | + AV_CPU_FLAG_FMA3 | + AV_CPU_FLAG_AVXSLOW)) +return 32; +if (flags & (AV_CPU_FLAG_AESNI | + AV_CPU_FLAG_SSE42 | + AV_CPU_FLAG_SSE4 | + AV_CPU_FLAG_SSSE3 | + AV_CPU_FLAG_SSE3 | + AV_CPU_FLAG_SSE2 | + AV_CPU_FLAG_SSE | + AV_CPU_FLAG_ATOM | + AV_CPU_FLAG_SSSE3SLOW | + AV_CPU_FLAG_SSE3SLOW | + AV_CPU_FLAG_SSE2SLOW)) +return 16; +#endif + +return 8; +} diff --git a/libavutil/cpu.h b/libavutil/cpu.h index de05593446..9e5d40affe 100644 --- a/libavutil/cpu.h +++ b/libavutil/cpu.h @@ -21,6 +21,8 @@ #ifndef AVUTIL_CPU_H #define AVUTIL_CPU_H +#include + #include "attributes.h" #define AV_CPU_FLAG_FORCE0x8000 /* force usage of selected flags (OR) */ @@ -113,4 +115,15 @@ int av_parse_cpu_caps(unsigned *flags, const char *s); */ int av_cpu_count(void); +/** + * Get the maximum data alignment that may be required by FFmpeg. + * + * Note that this is affected by the build configuration and the CPU flags mask, + * so e.g. if the CPU supports AVX, but libavutil has been built with + * --disable-avx or the AV_CPU_FLAG_AVX flag has been disabled through + * av_set_cpu_flags_mask(), then this function will behave as if AVX is not + * present. + */ +size_t av_cpu_max_align(void); + #endif /* AVUTIL_CPU_H */ diff --git a/libavutil/version.h b/libavutil/version.h index 8ac41f49f5..9dbcdc4a8c 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -80,7 +80,7 @@ #define LIBAVUTIL_VERSION_MAJOR 55 -#define LIBAVUTIL_VERSION_MINOR 76 +#define LIBAVUTIL_VERSION_MINOR 77 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ == diff --cc doc/APIchanges index 52336d1dec,be34c92d3f..4838ec3728 --- a/doc/APIchanges +++ b/doc/APIchanges @@@ -15,7 -13,13 +15,10 @@@ libavutil: 2015-08-2 API changes, most recent first: -2017-02-xx - xxx - lavu 55.31.0 - cpu.h ++2017-09-27 - xxx - lavu 55.77.100 / lavu 55.31.0 - cpu.h + Add av_cpu_max_align() for querying maximum required data alignment. + -2016-xx-xx - xxx - lavf 57.11.0 - avio.h - Add avio_context_free(). From now on it must be used for freeing AVIOContext. - -2017-02-01 - xxx - lavc - avcodec.h +2017-09-26 - xxx - lavc 57.106.102 - avcodec.h Deprecate AVCodecContext.refcounted_frames. This was useful for deprecated API only
[FFmpeg-cvslog] avutil/cpu: split flag checks per arch in av_cpu_max_align()
ffmpeg | branch: master | James Almer| Wed Sep 27 23:10:09 2017 -0300| [3b345d389be2d67017f904caa21713f53a8e8c90] | committer: James Almer avutil/cpu: split flag checks per arch in av_cpu_max_align() Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3b345d389be2d67017f904caa21713f53a8e8c90 --- libavutil/aarch64/cpu.c | 10 ++ libavutil/arm/cpu.c | 10 ++ libavutil/cpu.c | 39 --- libavutil/cpu_internal.h | 5 + libavutil/ppc/cpu.c | 12 libavutil/x86/cpu.c | 27 +++ 6 files changed, 72 insertions(+), 31 deletions(-) diff --git a/libavutil/aarch64/cpu.c b/libavutil/aarch64/cpu.c index 8ef077aaea..cc641da576 100644 --- a/libavutil/aarch64/cpu.c +++ b/libavutil/aarch64/cpu.c @@ -26,3 +26,13 @@ int ff_get_cpu_flags_aarch64(void) AV_CPU_FLAG_NEON * HAVE_NEON | AV_CPU_FLAG_VFP * HAVE_VFP; } + +size_t ff_get_cpu_max_align_aarch64(void) +{ +int flags = av_get_cpu_flags(); + +if (flags & AV_CPU_FLAG_NEON) +return 16; + +return 8; +} diff --git a/libavutil/arm/cpu.c b/libavutil/arm/cpu.c index 3889ef011c..81e85e2525 100644 --- a/libavutil/arm/cpu.c +++ b/libavutil/arm/cpu.c @@ -158,3 +158,13 @@ int ff_get_cpu_flags_arm(void) } #endif + +size_t ff_get_cpu_max_align_arm(void) +{ +int flags = av_get_cpu_flags(); + +if (flags & AV_CPU_FLAG_NEON) +return 16; + +return 8; +} diff --git a/libavutil/cpu.c b/libavutil/cpu.c index ab04494acf..c8401b8258 100644 --- a/libavutil/cpu.c +++ b/libavutil/cpu.c @@ -304,37 +304,14 @@ int av_cpu_count(void) size_t av_cpu_max_align(void) { -int av_unused flags = av_get_cpu_flags(); - -#if ARCH_ARM || ARCH_AARCH64 -if (flags & AV_CPU_FLAG_NEON) -return 16; -#elif ARCH_PPC -if (flags & (AV_CPU_FLAG_ALTIVEC | - AV_CPU_FLAG_VSX | - AV_CPU_FLAG_POWER8)) -return 16; -#elif ARCH_X86 -if (flags & (AV_CPU_FLAG_AVX2 | - AV_CPU_FLAG_AVX | - AV_CPU_FLAG_XOP | - AV_CPU_FLAG_FMA4 | - AV_CPU_FLAG_FMA3 | - AV_CPU_FLAG_AVXSLOW)) -return 32; -if (flags & (AV_CPU_FLAG_AESNI | - AV_CPU_FLAG_SSE42 | - AV_CPU_FLAG_SSE4 | - AV_CPU_FLAG_SSSE3 | - AV_CPU_FLAG_SSE3 | - AV_CPU_FLAG_SSE2 | - AV_CPU_FLAG_SSE | - AV_CPU_FLAG_ATOM | - AV_CPU_FLAG_SSSE3SLOW | - AV_CPU_FLAG_SSE3SLOW | - AV_CPU_FLAG_SSE2SLOW)) -return 16; -#endif +if (ARCH_AARCH64) +return ff_get_cpu_max_align_aarch64(); +if (ARCH_ARM) +return ff_get_cpu_max_align_arm(); +if (ARCH_PPC) +return ff_get_cpu_max_align_ppc(); +if (ARCH_X86) +return ff_get_cpu_max_align_x86(); return 8; } diff --git a/libavutil/cpu_internal.h b/libavutil/cpu_internal.h index 6c352abe1b..b8bf1e5396 100644 --- a/libavutil/cpu_internal.h +++ b/libavutil/cpu_internal.h @@ -44,4 +44,9 @@ int ff_get_cpu_flags_arm(void); int ff_get_cpu_flags_ppc(void); int ff_get_cpu_flags_x86(void); +size_t ff_get_cpu_max_align_aarch64(void); +size_t ff_get_cpu_max_align_arm(void); +size_t ff_get_cpu_max_align_ppc(void); +size_t ff_get_cpu_max_align_x86(void); + #endif /* AVUTIL_CPU_INTERNAL_H */ diff --git a/libavutil/ppc/cpu.c b/libavutil/ppc/cpu.c index 0f1e982624..7bb7cd813c 100644 --- a/libavutil/ppc/cpu.c +++ b/libavutil/ppc/cpu.c @@ -148,3 +148,15 @@ out: #endif /* HAVE_ALTIVEC */ return 0; } + +size_t ff_get_cpu_max_align_ppc(void) +{ +int flags = av_get_cpu_flags(); + +if (flags & (AV_CPU_FLAG_ALTIVEC | + AV_CPU_FLAG_VSX | + AV_CPU_FLAG_POWER8)) +return 16; + +return 8; +} diff --git a/libavutil/x86/cpu.c b/libavutil/x86/cpu.c index 3800a11ad8..f33088c8c7 100644 --- a/libavutil/x86/cpu.c +++ b/libavutil/x86/cpu.c @@ -233,3 +233,30 @@ int ff_get_cpu_flags_x86(void) return rval; } + +size_t ff_get_cpu_max_align_x86(void) +{ +int flags = av_get_cpu_flags(); + +if (flags & (AV_CPU_FLAG_AVX2 | + AV_CPU_FLAG_AVX | + AV_CPU_FLAG_XOP | + AV_CPU_FLAG_FMA4 | + AV_CPU_FLAG_FMA3 | + AV_CPU_FLAG_AVXSLOW)) +return 32; +if (flags & (AV_CPU_FLAG_AESNI | + AV_CPU_FLAG_SSE42 | + AV_CPU_FLAG_SSE4 | + AV_CPU_FLAG_SSSE3 | + AV_CPU_FLAG_SSE3 | + AV_CPU_FLAG_SSE2 | + AV_CPU_FLAG_SSE | + AV_CPU_FLAG_ATOM | +
[FFmpeg-cvslog] cpu: add a function for querying maximum required data alignment
ffmpeg | branch: master | Anton Khirnov| Wed Feb 8 09:32:17 2017 +0100| [e6bff23f1e11aefb16a2b5d6ee72bf7469c5a66e] | committer: Anton Khirnov cpu: add a function for querying maximum required data alignment > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e6bff23f1e11aefb16a2b5d6ee72bf7469c5a66e --- doc/APIchanges | 3 +++ libavutil/cpu.c | 13 + libavutil/cpu.h | 13 + libavutil/version.h | 2 +- 4 files changed, 30 insertions(+), 1 deletion(-) diff --git a/doc/APIchanges b/doc/APIchanges index 8c7d279fec..be34c92d3f 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -13,6 +13,9 @@ libavutil: 2015-08-28 API changes, most recent first: +2017-02-xx - xxx - lavu 55.31.0 - cpu.h + Add av_cpu_max_align() for querying maximum required data alignment. + 2016-xx-xx - xxx - lavf 57.11.0 - avio.h Add avio_context_free(). From now on it must be used for freeing AVIOContext. diff --git a/libavutil/cpu.c b/libavutil/cpu.c index 0109c9e8d1..5aef6af217 100644 --- a/libavutil/cpu.c +++ b/libavutil/cpu.c @@ -16,6 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include #include @@ -180,3 +181,15 @@ int av_cpu_count(void) return nb_cpus; } + +size_t av_cpu_max_align(void) +{ +int flags = av_get_cpu_flags(); + +if (flags & AV_CPU_FLAG_AVX) +return 32; +if (flags & (AV_CPU_FLAG_ALTIVEC | AV_CPU_FLAG_SSE | AV_CPU_FLAG_NEON)) +return 16; + +return 8; +} diff --git a/libavutil/cpu.h b/libavutil/cpu.h index c205ee16f6..4dcde27dbe 100644 --- a/libavutil/cpu.h +++ b/libavutil/cpu.h @@ -21,6 +21,8 @@ #ifndef AVUTIL_CPU_H #define AVUTIL_CPU_H +#include + #include "version.h" #define AV_CPU_FLAG_FORCE0x8000 /* force usage of selected flags (OR) */ @@ -88,4 +90,15 @@ int av_parse_cpu_flags(const char *s); */ int av_cpu_count(void); +/** + * Get the maximum data alignment that may be required by Libav. + * + * Note that this is affected by the build configuration and the CPU flags mask, + * so e.g. if the CPU supports AVX, but libavutil has been built with + * --disable-avx or the AV_CPU_FLAG_AVX flag has been disabled through + * av_set_cpu_flags_mask(), then this function will behave as if AVX is not + * present. + */ +size_t av_cpu_max_align(void); + #endif /* AVUTIL_CPU_H */ diff --git a/libavutil/version.h b/libavutil/version.h index 7856a0acc3..0fcd19a1eb 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -54,7 +54,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 55 -#define LIBAVUTIL_VERSION_MINOR 30 +#define LIBAVUTIL_VERSION_MINOR 31 #define LIBAVUTIL_VERSION_MICRO 0 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] scale_npp: explicitly set the output frames context for passthrough mode
ffmpeg | branch: master | Anton Khirnov| Wed Feb 1 10:38:42 2017 +0100| [5c8a5765dc5f4e29afb85b95be393c30f45412a8] | committer: Anton Khirnov scale_npp: explicitly set the output frames context for passthrough mode This is no longer done automatically for filters marked as hwframe-aware. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5c8a5765dc5f4e29afb85b95be393c30f45412a8 --- libavfilter/vf_scale_npp.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libavfilter/vf_scale_npp.c b/libavfilter/vf_scale_npp.c index 0e636a997d..be1f81f8ad 100644 --- a/libavfilter/vf_scale_npp.c +++ b/libavfilter/vf_scale_npp.c @@ -336,9 +336,11 @@ static int init_processing_chain(AVFilterContext *ctx, int in_width, int in_heig last_stage = i; } -if (last_stage < 0) -return 0; -ctx->outputs[0]->hw_frames_ctx = av_buffer_ref(s->stages[last_stage].frames_ctx); +if (last_stage >= 0) +ctx->outputs[0]->hw_frames_ctx = av_buffer_ref(s->stages[last_stage].frames_ctx); +else +ctx->outputs[0]->hw_frames_ctx = av_buffer_ref(ctx->inputs[0]->hw_frames_ctx); + if (!ctx->outputs[0]->hw_frames_ctx) return AVERROR(ENOMEM); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '5c8a5765dc5f4e29afb85b95be393c30f45412a8'
ffmpeg | branch: master | James Almer| Wed Sep 27 20:59:14 2017 -0300| [5256a86da067a324ece20bb9584880f5a63744ce] | committer: James Almer Merge commit '5c8a5765dc5f4e29afb85b95be393c30f45412a8' * commit '5c8a5765dc5f4e29afb85b95be393c30f45412a8': scale_npp: explicitly set the output frames context for passthrough mode See 62b75537db15816fde8b8a33976ffc4a8277f1fc Merged-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5256a86da067a324ece20bb9584880f5a63744ce --- libavfilter/vf_scale_npp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavfilter/vf_scale_npp.c b/libavfilter/vf_scale_npp.c index eadb3b5828..8a277ce8e1 100644 --- a/libavfilter/vf_scale_npp.c +++ b/libavfilter/vf_scale_npp.c @@ -319,10 +319,10 @@ static int init_processing_chain(AVFilterContext *ctx, int in_width, int in_heig last_stage = i; } -if (last_stage < 0) -ctx->outputs[0]->hw_frames_ctx = av_buffer_ref(ctx->inputs[0]->hw_frames_ctx); -else +if (last_stage >= 0) ctx->outputs[0]->hw_frames_ctx = av_buffer_ref(s->stages[last_stage].frames_ctx); +else +ctx->outputs[0]->hw_frames_ctx = av_buffer_ref(ctx->inputs[0]->hw_frames_ctx); if (!ctx->outputs[0]->hw_frames_ctx) return AVERROR(ENOMEM); == ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '6f554521afdf7ab4edbfaa9536660a1dca946b19'
ffmpeg | branch: master | James Almer| Wed Sep 27 20:55:46 2017 -0300| [4ad0264ab3d4ecfc0b5a3a399224ead33f1a5754] | committer: James Almer Merge commit '6f554521afdf7ab4edbfaa9536660a1dca946b19' * commit '6f554521afdf7ab4edbfaa9536660a1dca946b19': Use the new AVIOContext destructor. avio: add a destructor for AVIOContext This commit is a noop, see b12e4d3bb8df994f042ff1216fb8de2b967aab9e 78a7af823b7c2a1e3184e6680f2b49bf67101e5c Merged-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4ad0264ab3d4ecfc0b5a3a399224ead33f1a5754 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avio: add a destructor for AVIOContext
ffmpeg | branch: master | Anton Khirnov| Fri Jan 13 11:53:51 2017 +0100| [99684f3ae752fc8bfb44a2dd1482f8d7a3d8536d] | committer: Anton Khirnov avio: add a destructor for AVIOContext Before this commit, AVIOContext is to be freed with a plain av_free(), which prevents us from adding any deeper structure to it. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=99684f3ae752fc8bfb44a2dd1482f8d7a3d8536d --- doc/APIchanges| 3 +++ libavformat/avio.h| 8 libavformat/aviobuf.c | 17 ++--- libavformat/version.h | 4 ++-- 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index c161618d92..8c7d279fec 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -13,6 +13,9 @@ libavutil: 2015-08-28 API changes, most recent first: +2016-xx-xx - xxx - lavf 57.11.0 - avio.h + Add avio_context_free(). From now on it must be used for freeing AVIOContext. + 2017-02-01 - xxx - lavc - avcodec.h Deprecate AVCodecContext.refcounted_frames. This was useful for deprecated API only (avcodec_decode_video2/avcodec_decode_audio4). The new decode APIs diff --git a/libavformat/avio.h b/libavformat/avio.h index 7bf7985c5e..e65135ed99 100644 --- a/libavformat/avio.h +++ b/libavformat/avio.h @@ -219,6 +219,14 @@ AVIOContext *avio_alloc_context( int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), int64_t (*seek)(void *opaque, int64_t offset, int whence)); +/** + * Free the supplied IO context and everything associated with it. + * + * @param s Double pointer to the IO context. This function will write NULL + * into s. + */ +void avio_context_free(AVIOContext **s); + void avio_w8(AVIOContext *s, int b); void avio_write(AVIOContext *s, const unsigned char *buf, int size); void avio_wl64(AVIOContext *s, uint64_t val); diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 6d83a9661b..31476d3f6d 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -165,6 +165,11 @@ AVIOContext *avio_alloc_context( return s; } +void avio_context_free(AVIOContext **ps) +{ +av_freep(ps); +} + static void flush_buffer(AVIOContext *s) { if (s->buf_ptr > s->buffer) { @@ -1007,7 +1012,9 @@ int avio_close(AVIOContext *s) av_freep(>protocols); av_freep(>opaque); av_freep(>buffer); -av_free(s); + +avio_context_free(); + return ffurl_close(h); } @@ -1186,7 +1193,9 @@ int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer) *pbuffer = d->buffer; size = d->size; av_free(d); -av_free(s); + +avio_context_free(); + return size - padding; } @@ -1229,6 +1238,8 @@ int ffio_close_null_buf(AVIOContext *s) size = d->size; av_free(d); -av_free(s); + +avio_context_free(); + return size; } diff --git a/libavformat/version.h b/libavformat/version.h index 65d5754630..92f3407909 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -30,8 +30,8 @@ #include "libavutil/version.h" #define LIBAVFORMAT_VERSION_MAJOR 57 -#define LIBAVFORMAT_VERSION_MINOR 10 -#define LIBAVFORMAT_VERSION_MICRO 3 +#define LIBAVFORMAT_VERSION_MINOR 11 +#define LIBAVFORMAT_VERSION_MICRO 0 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ LIBAVFORMAT_VERSION_MINOR, \ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Use the new AVIOContext destructor.
ffmpeg | branch: master | Anton Khirnov| Fri Jan 13 12:04:16 2017 +0100| [6f554521afdf7ab4edbfaa9536660a1dca946b19] | committer: Anton Khirnov Use the new AVIOContext destructor. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6f554521afdf7ab4edbfaa9536660a1dca946b19 --- avprobe.c| 2 +- libavformat/avidec.c | 4 ++-- libavformat/flac_picture.c | 4 ++-- libavformat/hdsenc.c | 4 ++-- libavformat/mpjpegdec.c | 2 +- libavformat/rdt.c| 2 +- libavformat/segment.c| 10 +- libavformat/smoothstreamingenc.c | 4 ++-- libavformat/swfdec.c | 4 +++- libavformat/tests/movenc.c | 2 +- libavformat/wtv.c| 2 +- 11 files changed, 21 insertions(+), 19 deletions(-) diff --git a/avprobe.c b/avprobe.c index a24e6440eb..613e090be6 100644 --- a/avprobe.c +++ b/avprobe.c @@ -1178,7 +1178,7 @@ int main(int argc, char **argv) ret = probe_file(input_filename); probe_footer(); avio_flush(probe_out); -av_freep(_out); +avio_context_free(_out); av_freep(); uninit_opts(); avformat_network_deinit(); diff --git a/libavformat/avidec.c b/libavformat/avidec.c index 0439c9c94c..701cccb6b0 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -901,7 +901,7 @@ static int read_gab2_sub(AVStream *st, AVPacket *pkt) return 1; error: -av_freep(); +avio_context_free(); } return 0; } @@ -1576,7 +1576,7 @@ static int avi_read_close(AVFormatContext *s) AVIStream *ast = st->priv_data; if (ast) { if (ast->sub_ctx) { -av_freep(>sub_ctx->pb); +avio_context_free(>sub_ctx->pb); avformat_close_input(>sub_ctx); } av_free(ast->sub_buffer); diff --git a/libavformat/flac_picture.c b/libavformat/flac_picture.c index 1381a28b80..fd0bb0291f 100644 --- a/libavformat/flac_picture.c +++ b/libavformat/flac_picture.c @@ -139,14 +139,14 @@ int ff_flac_parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size) if (desc) av_dict_set(>metadata, "title", desc, AV_DICT_DONT_STRDUP_VAL); -av_freep(); +avio_context_free(); return 0; fail: av_buffer_unref(); av_freep(); -av_freep(); +avio_context_free(); return ret; } diff --git a/libavformat/hdsenc.c b/libavformat/hdsenc.c index e32c36503e..a608e7eb0f 100644 --- a/libavformat/hdsenc.c +++ b/libavformat/hdsenc.c @@ -143,8 +143,8 @@ static void hds_free(AVFormatContext *s) ff_format_io_close(s, >out); if (os->ctx && os->ctx_inited) av_write_trailer(os->ctx); -if (os->ctx && os->ctx->pb) -av_free(os->ctx->pb); +if (os->ctx) +avio_context_free(>ctx->pb); if (os->ctx) avformat_free_context(os->ctx); av_free(os->metadata); diff --git a/libavformat/mpjpegdec.c b/libavformat/mpjpegdec.c index 886bdfcbef..844aa87da8 100644 --- a/libavformat/mpjpegdec.c +++ b/libavformat/mpjpegdec.c @@ -102,7 +102,7 @@ static int mpjpeg_read_probe(AVProbeData *p) } } -av_free(pb); +avio_context_free(); return ret; } diff --git a/libavformat/rdt.c b/libavformat/rdt.c index 825e4f1355..0adfa2534f 100644 --- a/libavformat/rdt.c +++ b/libavformat/rdt.c @@ -324,7 +324,7 @@ get_cache: st, rdt->rmst[st->index], pkt); if (rdt->audio_pkt_cnt == 0 && st->codecpar->codec_id == AV_CODEC_ID_AAC) -av_freep(>rmctx->pb); +avio_context_free(>rmctx->pb); } pkt->stream_index = st->index; pkt->pts = *timestamp; diff --git a/libavformat/segment.c b/libavformat/segment.c index fd68a9f753..7d23afc013 100644 --- a/libavformat/segment.c +++ b/libavformat/segment.c @@ -184,10 +184,10 @@ static int open_null_ctx(AVIOContext **ctx) return 0; } -static void close_null_ctx(AVIOContext *pb) +static void close_null_ctx(AVIOContext **pb) { -av_free(pb->buffer); -av_free(pb); +av_free((*pb)->buffer); +avio_context_free(pb); } static void seg_free_context(SegmentContext *seg) @@ -259,7 +259,7 @@ static int seg_write_header(AVFormatContext *s) } if (!seg->write_header_trailer) { -close_null_ctx(oc->pb); +close_null_ctx(>pb); if ((ret = s->io_open(s, >pb, oc->filename, AVIO_FLAG_WRITE, NULL)) < 0) goto fail; } @@ -353,7 +353,7 @@ static int seg_write_trailer(struct AVFormatContext *s) if ((ret = open_null_ctx(>pb)) < 0) goto fail; ret = av_write_trailer(oc); -close_null_ctx(oc->pb); +close_null_ctx(>pb); } else { ret = segment_end(oc, 1); } diff --git a/libavformat/smoothstreamingenc.c b/libavformat/smoothstreamingenc.c index 065ecc2ee4..997b9e636c 100644 ---
[FFmpeg-cvslog] Merge commit '435cd7bc99671bf561193421a50ac6e9d63c4266'
ffmpeg | branch: master | James Almer| Wed Sep 27 20:51:29 2017 -0300| [7f89e9621b9efb78e74a2dd359247debf4950bc5] | committer: James Almer Merge commit '435cd7bc99671bf561193421a50ac6e9d63c4266' * commit '435cd7bc99671bf561193421a50ac6e9d63c4266': arm: vp9lpf: Use orrs instead of orr+cmp arm/aarch64: vp9lpf: Calculate !hev directly aarch64: vp9itxfm: Optimize 16x16 and 32x32 idct dc by unrolling arm: vp9itxfm: Optimize 16x16 and 32x32 idct dc by unrolling aarch64: vp9mc: Calculate less unused data in the 4 pixel wide horizontal filter arm: vp9mc: Calculate less unused data in the 4 pixel wide horizontal filter aarch64: vp9mc: Simplify the extmla macro parameters This commit is a noop, see ac6cb8ae5b1c56c4a3fceb635c60d05e447c4365 bff07715904cc02f04eb5c5e171b431eb00f0c3b 045e33ae3fee74e39b1321dddf727eacb1ecf541 758302e4bc14e93989e7feb1135ec3f807c3310d 148cc0bb890839bc2a9cda514c5e71acc39eb374 f0ecbb13cf1cf706a1350dad657219dc7b3c131e 92ab8374b1051dd632c3ccc326b6cb1d564f293f Merged-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7f89e9621b9efb78e74a2dd359247debf4950bc5 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] arm: vp9lpf: Use orrs instead of orr+cmp
ffmpeg | branch: master | Martin Storsjö| Fri Jan 13 23:42:28 2017 +0200| [435cd7bc99671bf561193421a50ac6e9d63c4266] | committer: Martin Storsjö arm: vp9lpf: Use orrs instead of orr+cmp Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=435cd7bc99671bf561193421a50ac6e9d63c4266 --- libavcodec/arm/vp9lpf_neon.S | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/libavcodec/arm/vp9lpf_neon.S b/libavcodec/arm/vp9lpf_neon.S index c57c0e9c31..c2f1c95427 100644 --- a/libavcodec/arm/vp9lpf_neon.S +++ b/libavcodec/arm/vp9lpf_neon.S @@ -78,8 +78,7 @@ vdup.u8 d3, r3 @ H vmovr2, r3, d4 -orr r2, r2, r3 -cmp r2, #0 +orrsr2, r2, r3 @ If no pixels need filtering, just exit as soon as possible beq 9f @@ -192,8 +191,7 @@ .if \wd >= 8 vmovr2, r3, d6 -orr r2, r2, r3 -cmp r2, #0 +orrsr2, r2, r3 @ If no pixels need flat8in, jump to flat8out @ (or to a writeout of the inner 4 pixels, for wd=8) beq 6f @@ -248,14 +246,12 @@ 6: vorrd2, d6, d7 vmovr2, r3, d2 -orr r2, r2, r3 -cmp r2, #0 +orrsr2, r2, r3 @ If no pixels needed flat8in nor flat8out, jump to a @ writeout of the inner 4 pixels beq 7f vmovr2, r3, d7 -orr r2, r2, r3 -cmp r2, #0 +orrsr2, r2, r3 @ If no pixels need flat8out, jump to a writeout of the inner 6 pixels beq 8f ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] arm/aarch64: vp9lpf: Calculate !hev directly
ffmpeg | branch: master | Martin Storsjö| Thu Jan 12 16:52:33 2017 +0200| [e1f9de86f454861b69b199ad801adc2ec6c3b220] | committer: Martin Storsjö arm/aarch64: vp9lpf: Calculate !hev directly Previously we first calculated hev, and then negated it. Since we were able to schedule the negation in the middle of another calculation, we don't see any gain in all cases. Before: Cortex A7 A8 A9 A53 A53/AArch64 vp9_loop_filter_v_4_8_neon: 147.0 129.0 115.889.0 88.7 vp9_loop_filter_v_8_8_neon: 242.0 198.5 174.7 140.0136.7 vp9_loop_filter_v_16_8_neon:500.0 419.5 382.7 293.0275.7 vp9_loop_filter_v_16_16_neon: 971.2 825.5 731.5 579.0453.0 After: vp9_loop_filter_v_4_8_neon: 143.0 127.7 114.888.0 87.7 vp9_loop_filter_v_8_8_neon: 241.0 197.2 173.7 140.0136.7 vp9_loop_filter_v_16_8_neon:497.0 419.5 379.7 293.0275.7 vp9_loop_filter_v_16_16_neon: 965.2 818.7 731.4 579.0452.0 Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e1f9de86f454861b69b199ad801adc2ec6c3b220 --- libavcodec/aarch64/vp9lpf_neon.S | 5 ++--- libavcodec/arm/vp9lpf_neon.S | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/libavcodec/aarch64/vp9lpf_neon.S b/libavcodec/aarch64/vp9lpf_neon.S index e9c7d9edc8..3b8e6ebc99 100644 --- a/libavcodec/aarch64/vp9lpf_neon.S +++ b/libavcodec/aarch64/vp9lpf_neon.S @@ -292,7 +292,7 @@ .if \mix != 0 sxtlv1.8h, v1.8b .endif -cmhiv5\sz, v5\sz, v3\sz // hev +cmhsv5\sz, v3\sz, v5\sz // !hev .if \wd == 8 // If a 4/8 or 8/4 mix is used, clear the relevant half of v6 .if \mix != 0 @@ -306,11 +306,10 @@ .elseif \wd == 8 bic v4\sz, v4\sz, v6\sz // fm && !flat8in .endif -mvn v5\sz, v5\sz // !hev +and v5\sz, v5\sz, v4\sz // !hev && fm && !flat8in .if \wd == 16 and v7\sz, v7\sz, v6\sz // flat8out && flat8in && fm .endif -and v5\sz, v5\sz, v4\sz // !hev && fm && !flat8in mul_sz \tmp3\().8h, \tmp4\().8h, \tmp3\().8h, \tmp4\().8h, \tmp5\().8h, \tmp5\().8h, \sz // 3 * (q0 - p0) bic \tmp1\sz, \tmp1\sz, v5\sz// if (!hev) av_clip_int8 = 0 diff --git a/libavcodec/arm/vp9lpf_neon.S b/libavcodec/arm/vp9lpf_neon.S index fbf2901f75..c57c0e9c31 100644 --- a/libavcodec/arm/vp9lpf_neon.S +++ b/libavcodec/arm/vp9lpf_neon.S @@ -141,7 +141,7 @@ .if \wd == 8 vcle.u8 d6, d6, d0@ flat8in .endif -vcgt.u8 d5, d5, d3@ hev +vcle.u8 d5, d5, d3@ !hev .if \wd == 8 vandd6, d6, d4@ flat8in && fm .endif @@ -151,11 +151,10 @@ .elseif \wd == 8 vbicd4, d4, d6@ fm && !flat8in .endif -vmvnd5, d5 @ !hev +vandd5, d5, d4@ !hev && fm && !flat8in .if \wd == 16 vandd7, d7, d6@ flat8out && flat8in && fm .endif -vandd5, d5, d4@ !hev && fm && !flat8in vmul.s16\tmpq2, \tmpq2, \tmpq3 @ 3 * (q0 - p0) vbic\tmp1, \tmp1, d5@ if (!hev) av_clip_int8 = 0 ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] aarch64: vp9itxfm: Optimize 16x16 and 32x32 idct dc by unrolling
ffmpeg | branch: master | Martin Storsjö| Wed Jan 4 12:57:56 2017 +0200| [3fcf788fbbccc4130868e7abe58a88990290f7c1] | committer: Martin Storsjö aarch64: vp9itxfm: Optimize 16x16 and 32x32 idct dc by unrolling This work is sponsored by, and copyright, Google. Before: Cortex A53 vp9_inv_dct_dct_16x16_sub1_add_neon: 235.3 vp9_inv_dct_dct_32x32_sub1_add_neon: 555.1 After: vp9_inv_dct_dct_16x16_sub1_add_neon: 180.2 vp9_inv_dct_dct_32x32_sub1_add_neon: 475.3 Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3fcf788fbbccc4130868e7abe58a88990290f7c1 --- libavcodec/aarch64/vp9itxfm_neon.S | 54 +- 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/libavcodec/aarch64/vp9itxfm_neon.S b/libavcodec/aarch64/vp9itxfm_neon.S index a199e9c603..d35f103a79 100644 --- a/libavcodec/aarch64/vp9itxfm_neon.S +++ b/libavcodec/aarch64/vp9itxfm_neon.S @@ -495,16 +495,23 @@ function idct16x16_dc_add_neon srshr v2.8h, v2.8h, #6 +mov x3, x0 mov x4, #16 1: // Loop to add the constant from v2 into all 16x16 outputs -ld1 {v3.16b}, [x0] -uaddw v4.8h, v2.8h, v3.8b -uaddw2 v5.8h, v2.8h, v3.16b -sqxtun v4.8b, v4.8h -sqxtun2 v4.16b, v5.8h -st1 {v4.16b}, [x0], x1 -subsx4, x4, #1 +subsx4, x4, #2 +ld1 {v3.16b}, [x0], x1 +ld1 {v4.16b}, [x0], x1 +uaddw v16.8h, v2.8h, v3.8b +uaddw2 v17.8h, v2.8h, v3.16b +uaddw v18.8h, v2.8h, v4.8b +uaddw2 v19.8h, v2.8h, v4.16b +sqxtun v3.8b, v16.8h +sqxtun2 v3.16b, v17.8h +sqxtun v4.8b, v18.8h +sqxtun2 v4.16b, v19.8h +st1 {v3.16b}, [x3], x1 +st1 {v4.16b}, [x3], x1 b.ne1b ret @@ -1054,20 +1061,31 @@ function idct32x32_dc_add_neon srshr v0.8h, v2.8h, #6 +mov x3, x0 mov x4, #32 1: // Loop to add the constant v0 into all 32x32 outputs -ld1 {v1.16b,v2.16b}, [x0] -uaddw v3.8h, v0.8h, v1.8b -uaddw2 v4.8h, v0.8h, v1.16b -uaddw v5.8h, v0.8h, v2.8b -uaddw2 v6.8h, v0.8h, v2.16b -sqxtun v3.8b, v3.8h -sqxtun2 v3.16b, v4.8h -sqxtun v4.8b, v5.8h -sqxtun2 v4.16b, v6.8h -st1 {v3.16b,v4.16b}, [x0], x1 -subsx4, x4, #1 +subsx4, x4, #2 +ld1 {v1.16b,v2.16b}, [x0], x1 +uaddw v16.8h, v0.8h, v1.8b +uaddw2 v17.8h, v0.8h, v1.16b +ld1 {v3.16b,v4.16b}, [x0], x1 +uaddw v18.8h, v0.8h, v2.8b +uaddw2 v19.8h, v0.8h, v2.16b +uaddw v20.8h, v0.8h, v3.8b +uaddw2 v21.8h, v0.8h, v3.16b +uaddw v22.8h, v0.8h, v4.8b +uaddw2 v23.8h, v0.8h, v4.16b +sqxtun v1.8b, v16.8h +sqxtun2 v1.16b, v17.8h +sqxtun v2.8b, v18.8h +sqxtun2 v2.16b, v19.8h +sqxtun v3.8b, v20.8h +sqxtun2 v3.16b, v21.8h +st1 {v1.16b,v2.16b}, [x3], x1 +sqxtun v4.8b, v22.8h +sqxtun2 v4.16b, v23.8h +st1 {v3.16b,v4.16b}, [x3], x1 b.ne1b ret ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] arm: vp9mc: Calculate less unused data in the 4 pixel wide horizontal filter
ffmpeg | branch: master | Martin Storsjö| Sat Dec 17 13:09:50 2016 +0200| [fea92a4b57d1c328b1de226a5f213a629ee63754] | committer: Martin Storsjö arm: vp9mc: Calculate less unused data in the 4 pixel wide horizontal filter Before:Cortex A7 A8 A9 A53 vp9_put_8tap_smooth_4h_neon: 378.1 273.2 340.7 229.5 After: vp9_put_8tap_smooth_4h_neon: 352.1 222.2 290.5 229.5 Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fea92a4b57d1c328b1de226a5f213a629ee63754 --- libavcodec/arm/vp9mc_neon.S | 33 ++--- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/libavcodec/arm/vp9mc_neon.S b/libavcodec/arm/vp9mc_neon.S index a5413a3c9f..8d43ff19c3 100644 --- a/libavcodec/arm/vp9mc_neon.S +++ b/libavcodec/arm/vp9mc_neon.S @@ -209,7 +209,7 @@ endfunc @ Extract a vector from src1-src2 and src4-src5 (src1-src3 and src4-src6 @ for size >= 16), and multiply-accumulate into dst1 and dst3 (or @ dst1-dst2 and dst3-dst4 for size >= 16) -.macro extmla dst1, dst2, dst3, dst4, src1, src2, src3, src4, src5, src6, offset, size +.macro extmla dst1, dst2, dst3, dst4, dst1d, dst3d, src1, src2, src3, src4, src5, src6, offset, size vext.8 q14, \src1, \src2, #(2*\offset) vext.8 q15, \src4, \src5, #(2*\offset) .if \size >= 16 @@ -219,14 +219,17 @@ endfunc vext.8 q6, \src5, \src6, #(2*\offset) vmla_lane \dst2, q5, \offset vmla_lane \dst4, q6, \offset -.else +.elseif \size == 8 vmla_lane \dst1, q14, \offset vmla_lane \dst3, q15, \offset +.else +vmla_lane \dst1d, d28, \offset +vmla_lane \dst3d, d30, \offset .endif .endm @ The same as above, but don't accumulate straight into the @ destination, but use a temp register and accumulate with saturation. -.macro extmulqadd dst1, dst2, dst3, dst4, src1, src2, src3, src4, src5, src6, offset, size +.macro extmulqadd dst1, dst2, dst3, dst4, dst1d, dst3d, src1, src2, src3, src4, src5, src6, offset, size vext.8 q14, \src1, \src2, #(2*\offset) vext.8 q15, \src4, \src5, #(2*\offset) .if \size >= 16 @@ -236,16 +239,24 @@ endfunc vext.8 q6, \src5, \src6, #(2*\offset) vmul_lane q5, q5, \offset vmul_lane q6, q6, \offset -.else +.elseif \size == 8 vmul_lane q14, q14, \offset vmul_lane q15, q15, \offset +.else +vmul_lane d28, d28, \offset +vmul_lane d30, d30, \offset .endif +.if \size == 4 +vqadd.s16 \dst1d, \dst1d, d28 +vqadd.s16 \dst3d, \dst3d, d30 +.else vqadd.s16 \dst1, \dst1, q14 vqadd.s16 \dst3, \dst3, q15 .if \size >= 16 vqadd.s16 \dst2, \dst2, q5 vqadd.s16 \dst4, \dst4, q6 .endif +.endif .endm @@ -309,13 +320,13 @@ function \type\()_8tap_\size\()h_\idx1\idx2 vmul.s16q2, q9, d0[0] vmul.s16q4, q12, d0[0] .endif -extmla q1, q2, q3, q4, q8, q9, q10, q11, q12, q13, 1, \size -extmla q1, q2, q3, q4, q8, q9, q10, q11, q12, q13, 2, \size -extmla q1, q2, q3, q4, q8, q9, q10, q11, q12, q13, \idx1, \size -extmla q1, q2, q3, q4, q8, q9, q10, q11, q12, q13, 5, \size -extmla q1, q2, q3, q4, q8, q9, q10, q11, q12, q13, 6, \size -extmla q1, q2, q3, q4, q8, q9, q10, q11, q12, q13, 7, \size -extmulqadd q1, q2, q3, q4, q8, q9, q10, q11, q12, q13, \idx2, \size +extmla q1, q2, q3, q4, d2, d6, q8, q9, q10, q11, q12, q13, 1, \size +extmla q1, q2, q3, q4, d2, d6, q8, q9, q10, q11, q12, q13, 2, \size +extmla q1, q2, q3, q4, d2, d6, q8, q9, q10, q11, q12, q13, \idx1, \size +extmla q1, q2, q3, q4, d2, d6, q8, q9, q10, q11, q12, q13, 5, \size +extmla q1, q2, q3, q4, d2, d6, q8, q9, q10, q11, q12, q13, 6, \size +extmla q1, q2, q3, q4, d2, d6, q8, q9, q10, q11, q12, q13, 7, \size +extmulqadd q1, q2, q3, q4, d2, d6, q8, q9, q10, q11, q12, q13, \idx2, \size @ Round, shift and saturate vqrshrun.s16d2, q1, #7 ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] arm: vp9itxfm: Optimize 16x16 and 32x32 idct dc by unrolling
ffmpeg | branch: master | Martin Storsjö| Wed Jan 4 13:08:51 2017 +0200| [a76bf8cf1277ef6feb1580b578f5e6ca327e713c] | committer: Martin Storsjö arm: vp9itxfm: Optimize 16x16 and 32x32 idct dc by unrolling This work is sponsored by, and copyright, Google. Before:Cortex A7 A8 A9 A53 vp9_inv_dct_dct_16x16_sub1_add_neon: 273.0 189.5 211.7 235.8 vp9_inv_dct_dct_32x32_sub1_add_neon: 752.0 459.2 862.2 553.9 After: vp9_inv_dct_dct_16x16_sub1_add_neon: 226.5 145.0 225.1 171.8 vp9_inv_dct_dct_32x32_sub1_add_neon: 721.2 415.7 727.6 475.0 Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a76bf8cf1277ef6feb1580b578f5e6ca327e713c --- libavcodec/arm/vp9itxfm_neon.S | 54 -- 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/libavcodec/arm/vp9itxfm_neon.S b/libavcodec/arm/vp9itxfm_neon.S index 3d0b0fab2e..8dc4bbfa55 100644 --- a/libavcodec/arm/vp9itxfm_neon.S +++ b/libavcodec/arm/vp9itxfm_neon.S @@ -542,16 +542,23 @@ function idct16x16_dc_add_neon vrshr.s16 q8, q8, #6 +mov r3, r0 mov r12, #16 1: @ Loop to add the constant from q8 into all 16x16 outputs -vld1.8 {q3}, [r0,:128] -vaddw.u8q10, q8, d6 -vaddw.u8q11, q8, d7 -vqmovun.s16 d6, q10 -vqmovun.s16 d7, q11 -vst1.8 {q3}, [r0,:128], r1 -subsr12, r12, #1 +subsr12, r12, #2 +vld1.8 {q2}, [r0,:128], r1 +vaddw.u8q10, q8, d4 +vld1.8 {q3}, [r0,:128], r1 +vaddw.u8q11, q8, d5 +vaddw.u8q12, q8, d6 +vaddw.u8q13, q8, d7 +vqmovun.s16 d4, q10 +vqmovun.s16 d5, q11 +vqmovun.s16 d6, q12 +vst1.8 {q2}, [r3,:128], r1 +vqmovun.s16 d7, q13 +vst1.8 {q3}, [r3,:128], r1 bne 1b bx lr @@ -1147,20 +1154,31 @@ function idct32x32_dc_add_neon vrshr.s16 q8, q8, #6 +mov r3, r0 mov r12, #32 1: @ Loop to add the constant from q8 into all 32x32 outputs -vld1.8 {q2-q3}, [r0,:128] -vaddw.u8q10, q8, d4 -vaddw.u8q11, q8, d5 -vaddw.u8q12, q8, d6 -vaddw.u8q13, q8, d7 -vqmovun.s16 d4, q10 -vqmovun.s16 d5, q11 -vqmovun.s16 d6, q12 -vqmovun.s16 d7, q13 -vst1.8 {q2-q3}, [r0,:128], r1 -subsr12, r12, #1 +subsr12, r12, #2 +vld1.8 {q0-q1}, [r0,:128], r1 +vaddw.u8q9, q8, d0 +vaddw.u8q10, q8, d1 +vld1.8 {q2-q3}, [r0,:128], r1 +vaddw.u8q11, q8, d2 +vaddw.u8q12, q8, d3 +vaddw.u8q13, q8, d4 +vaddw.u8q14, q8, d5 +vaddw.u8q15, q8, d6 +vqmovun.s16 d0, q9 +vaddw.u8q9, q8, d7 +vqmovun.s16 d1, q10 +vqmovun.s16 d2, q11 +vqmovun.s16 d3, q12 +vqmovun.s16 d4, q13 +vqmovun.s16 d5, q14 +vst1.8 {q0-q1}, [r3,:128], r1 +vqmovun.s16 d6, q15 +vqmovun.s16 d7, q9 +vst1.8 {q2-q3}, [r3,:128], r1 bne 1b bx lr ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] aarch64: vp9mc: Calculate less unused data in the 4 pixel wide horizontal filter
ffmpeg | branch: master | Martin Storsjö| Sat Dec 17 13:14:38 2016 +0200| [388e0d2515bc6bbc9d0c9af1d230bd16cf945fe7] | committer: Martin Storsjö aarch64: vp9mc: Calculate less unused data in the 4 pixel wide horizontal filter No measured speedup on a Cortex A53, but other cores might benefit. Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=388e0d2515bc6bbc9d0c9af1d230bd16cf945fe7 --- libavcodec/aarch64/vp9mc_neon.S | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/libavcodec/aarch64/vp9mc_neon.S b/libavcodec/aarch64/vp9mc_neon.S index 99f1809270..95ed26c232 100644 --- a/libavcodec/aarch64/vp9mc_neon.S +++ b/libavcodec/aarch64/vp9mc_neon.S @@ -202,9 +202,12 @@ endfunc ext v23.16b, \src5\().16b, \src6\().16b, #(2*\offset) mla \dst2\().8h, v21.8h, v0.h[\offset] mla \dst4\().8h, v23.8h, v0.h[\offset] -.else +.elseif \size == 8 mla \dst1\().8h, v20.8h, v0.h[\offset] mla \dst3\().8h, v22.8h, v0.h[\offset] +.else +mla \dst1\().4h, v20.4h, v0.h[\offset] +mla \dst3\().4h, v22.4h, v0.h[\offset] .endif .endm // The same as above, but don't accumulate straight into the @@ -219,16 +222,24 @@ endfunc ext v23.16b, \src5\().16b, \src6\().16b, #(2*\offset) mul v21.8h, v21.8h, v0.h[\offset] mul v23.8h, v23.8h, v0.h[\offset] -.else +.elseif \size == 8 mul v20.8h, v20.8h, v0.h[\offset] mul v22.8h, v22.8h, v0.h[\offset] +.else +mul v20.4h, v20.4h, v0.h[\offset] +mul v22.4h, v22.4h, v0.h[\offset] .endif +.if \size == 4 +sqadd \dst1\().4h, \dst1\().4h, v20.4h +sqadd \dst3\().4h, \dst3\().4h, v22.4h +.else sqadd \dst1\().8h, \dst1\().8h, v20.8h sqadd \dst3\().8h, \dst3\().8h, v22.8h .if \size >= 16 sqadd \dst2\().8h, \dst2\().8h, v21.8h sqadd \dst4\().8h, \dst4\().8h, v23.8h .endif +.endif .endm ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] aarch64: vp9mc: Simplify the extmla macro parameters
ffmpeg | branch: master | Martin Storsjö| Sat Dec 17 00:55:41 2016 +0200| [5e0c2158fbc774f87d3ce4b7b950ba4d42c4a7b8] | committer: Martin Storsjö aarch64: vp9mc: Simplify the extmla macro parameters Fold the field lengths into the macro. This makes the macro invocations much more readable, when the lines are shorter. This also makes it easier to use only half the registers within the macro. Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5e0c2158fbc774f87d3ce4b7b950ba4d42c4a7b8 --- libavcodec/aarch64/vp9mc_neon.S | 50 - 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/libavcodec/aarch64/vp9mc_neon.S b/libavcodec/aarch64/vp9mc_neon.S index c1f1876fce..99f1809270 100644 --- a/libavcodec/aarch64/vp9mc_neon.S +++ b/libavcodec/aarch64/vp9mc_neon.S @@ -193,41 +193,41 @@ endfunc // for size >= 16), and multiply-accumulate into dst1 and dst3 (or // dst1-dst2 and dst3-dst4 for size >= 16) .macro extmla dst1, dst2, dst3, dst4, src1, src2, src3, src4, src5, src6, offset, size -ext v20.16b, \src1, \src2, #(2*\offset) -ext v22.16b, \src4, \src5, #(2*\offset) +ext v20.16b, \src1\().16b, \src2\().16b, #(2*\offset) +ext v22.16b, \src4\().16b, \src5\().16b, #(2*\offset) .if \size >= 16 -mla \dst1, v20.8h, v0.h[\offset] -ext v21.16b, \src2, \src3, #(2*\offset) -mla \dst3, v22.8h, v0.h[\offset] -ext v23.16b, \src5, \src6, #(2*\offset) -mla \dst2, v21.8h, v0.h[\offset] -mla \dst4, v23.8h, v0.h[\offset] +mla \dst1\().8h, v20.8h, v0.h[\offset] +ext v21.16b, \src2\().16b, \src3\().16b, #(2*\offset) +mla \dst3\().8h, v22.8h, v0.h[\offset] +ext v23.16b, \src5\().16b, \src6\().16b, #(2*\offset) +mla \dst2\().8h, v21.8h, v0.h[\offset] +mla \dst4\().8h, v23.8h, v0.h[\offset] .else -mla \dst1, v20.8h, v0.h[\offset] -mla \dst3, v22.8h, v0.h[\offset] +mla \dst1\().8h, v20.8h, v0.h[\offset] +mla \dst3\().8h, v22.8h, v0.h[\offset] .endif .endm // The same as above, but don't accumulate straight into the // destination, but use a temp register and accumulate with saturation. .macro extmulqadd dst1, dst2, dst3, dst4, src1, src2, src3, src4, src5, src6, offset, size -ext v20.16b, \src1, \src2, #(2*\offset) -ext v22.16b, \src4, \src5, #(2*\offset) +ext v20.16b, \src1\().16b, \src2\().16b, #(2*\offset) +ext v22.16b, \src4\().16b, \src5\().16b, #(2*\offset) .if \size >= 16 mul v20.8h, v20.8h, v0.h[\offset] -ext v21.16b, \src2, \src3, #(2*\offset) +ext v21.16b, \src2\().16b, \src3\().16b, #(2*\offset) mul v22.8h, v22.8h, v0.h[\offset] -ext v23.16b, \src5, \src6, #(2*\offset) +ext v23.16b, \src5\().16b, \src6\().16b, #(2*\offset) mul v21.8h, v21.8h, v0.h[\offset] mul v23.8h, v23.8h, v0.h[\offset] .else mul v20.8h, v20.8h, v0.h[\offset] mul v22.8h, v22.8h, v0.h[\offset] .endif -sqadd \dst1, \dst1, v20.8h -sqadd \dst3, \dst3, v22.8h +sqadd \dst1\().8h, \dst1\().8h, v20.8h +sqadd \dst3\().8h, \dst3\().8h, v22.8h .if \size >= 16 -sqadd \dst2, \dst2, v21.8h -sqadd \dst4, \dst4, v23.8h +sqadd \dst2\().8h, \dst2\().8h, v21.8h +sqadd \dst4\().8h, \dst4\().8h, v23.8h .endif .endm @@ -292,13 +292,13 @@ function \type\()_8tap_\size\()h_\idx1\idx2 mul v2.8h, v5.8h, v0.h[0] mul v25.8h, v17.8h, v0.h[0] .endif -extmla v1.8h, v2.8h, v24.8h, v25.8h, v4.16b, v5.16b, v6.16b, v16.16b, v17.16b, v18.16b, 1, \size -extmla v1.8h, v2.8h, v24.8h, v25.8h, v4.16b, v5.16b, v6.16b, v16.16b, v17.16b, v18.16b, 2, \size -extmla v1.8h, v2.8h, v24.8h, v25.8h, v4.16b, v5.16b, v6.16b, v16.16b, v17.16b, v18.16b, \idx1, \size -extmla v1.8h, v2.8h, v24.8h, v25.8h, v4.16b, v5.16b, v6.16b, v16.16b, v17.16b, v18.16b, 5, \size -extmla v1.8h, v2.8h, v24.8h, v25.8h, v4.16b, v5.16b, v6.16b, v16.16b, v17.16b, v18.16b, 6, \size -extmla v1.8h, v2.8h, v24.8h, v25.8h, v4.16b, v5.16b, v6.16b, v16.16b, v17.16b, v18.16b, 7, \size -extmulqadd v1.8h, v2.8h, v24.8h, v25.8h, v4.16b, v5.16b, v6.16b, v16.16b,
[FFmpeg-cvslog] Merge commit '53ea595eec984e3109310e8bb7ff4b5786d91057'
ffmpeg | branch: master | James Almer| Wed Sep 27 20:42:39 2017 -0300| [b35f6d3aa359567fa4572a1a982ec6d233929d35] | committer: James Almer Merge commit '53ea595eec984e3109310e8bb7ff4b5786d91057' * commit '53ea595eec984e3109310e8bb7ff4b5786d91057': mov: Rework stsc index validation See e26e6240b6700c5e8c16d0f092f1ad46805a723c. Merged-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b35f6d3aa359567fa4572a1a982ec6d233929d35 --- libavformat/isom.h | 2 +- libavformat/mov.c | 9 ++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/libavformat/isom.h b/libavformat/isom.h index fdd98c28f5..9aea629293 100644 --- a/libavformat/isom.h +++ b/libavformat/isom.h @@ -141,7 +141,7 @@ typedef struct MOVStreamContext { MOVStts *ctts_data; unsigned int stsc_count; MOVStsc *stsc_data; -int stsc_index; +unsigned int stsc_index; int stsc_sample; unsigned int stps_count; unsigned *stps_data; ///< partial sync sample for mpeg-2 open gop diff --git a/libavformat/mov.c b/libavformat/mov.c index 2de60b2159..19cda1424d 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2447,10 +2447,13 @@ static int mov_read_stsc(MOVContext *c, AVIOContext *pb, MOVAtom atom) return 0; } -#define mov_stsc_index_valid(index, count) ((index) < (count) - 1) +static inline int mov_stsc_index_valid(unsigned int index, unsigned int count) +{ +return index < count - 1; +} /* Compute the samples value for the stsc entry at the given index. */ -static inline int mov_get_stsc_samples(MOVStreamContext *sc, int index) +static inline int mov_get_stsc_samples(MOVStreamContext *sc, unsigned int index) { int chunk_count; @@ -6647,7 +6650,7 @@ static int mov_seek_stream(AVFormatContext *s, AVStream *st, int64_t timestamp, { MOVStreamContext *sc = st->priv_data; int sample, time_sample; -int i; +unsigned int i; int ret = mov_seek_fragment(s, st, timestamp); if (ret < 0) == diff --cc libavformat/mov.c index 2de60b2159,11bcff035c..19cda1424d --- a/libavformat/mov.c +++ b/libavformat/mov.c @@@ -6647,12 -3982,8 +6650,12 @@@ static int mov_seek_stream(AVFormatCont { MOVStreamContext *sc = st->priv_data; int sample, time_sample; - int i; + unsigned int i; +int ret = mov_seek_fragment(s, st, timestamp); +if (ret < 0) +return ret; + sample = av_index_search_timestamp(st, timestamp, flags); av_log(s, AV_LOG_TRACE, "stream %d, timestamp %"PRId64", sample %d\n", st->index, timestamp, sample); if (sample < 0 && st->nb_index_entries && timestamp < st->index_entries[0].timestamp) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] mov: Rework stsc index validation
ffmpeg | branch: master | Vittorio Giovara| Fri Feb 3 13:05:27 2017 +0100| [53ea595eec984e3109310e8bb7ff4b5786d91057] | committer: Vittorio Giovara mov: Rework stsc index validation In order to avoid potential integer overflow change the comparison and make sure to use the same unsigned type for both elements. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=53ea595eec984e3109310e8bb7ff4b5786d91057 --- libavformat/isom.h | 2 +- libavformat/mov.c | 8 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libavformat/isom.h b/libavformat/isom.h index 85b876106f..8cc5ab744d 100644 --- a/libavformat/isom.h +++ b/libavformat/isom.h @@ -111,7 +111,7 @@ typedef struct MOVStreamContext { MOVStts *ctts_data; unsigned int stsc_count; MOVStsc *stsc_data; -int stsc_index; +unsigned int stsc_index; int stsc_sample; unsigned int stps_count; unsigned *stps_data; ///< partial sync sample for mpeg-2 open gop diff --git a/libavformat/mov.c b/libavformat/mov.c index 2810960e87..11bcff035c 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1983,13 +1983,13 @@ static int mov_read_stsc(MOVContext *c, AVIOContext *pb, MOVAtom atom) return 0; } -static inline int mov_stsc_index_valid(int index, int count) +static inline int mov_stsc_index_valid(unsigned int index, unsigned int count) { -return index + 1 < count; +return index < count - 1; } /* Compute the samples value for the stsc entry at the given index. */ -static inline int mov_get_stsc_samples(MOVStreamContext *sc, int index) +static inline int mov_get_stsc_samples(MOVStreamContext *sc, unsigned int index) { int chunk_count; @@ -3982,7 +3982,7 @@ static int mov_seek_stream(AVFormatContext *s, AVStream *st, int64_t timestamp, { MOVStreamContext *sc = st->priv_data; int sample, time_sample; -int i; +unsigned int i; sample = av_index_search_timestamp(st, timestamp, flags); av_log(s, AV_LOG_TRACE, "stream %d, timestamp %"PRId64", sample %d\n", st->index, timestamp, sample); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] imgutils: Document av_image_get_buffer_size()
ffmpeg | branch: master | Vittorio Giovara| Tue Feb 7 10:01:41 2017 -0500| [ce6d72d10776b03c6780d4aa676414ce002285d4] | committer: Vittorio Giovara imgutils: Document av_image_get_buffer_size() > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ce6d72d10776b03c6780d4aa676414ce002285d4 --- libavutil/imgutils.h | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavutil/imgutils.h b/libavutil/imgutils.h index 67063a2947..fafabc48ca 100644 --- a/libavutil/imgutils.h +++ b/libavutil/imgutils.h @@ -169,7 +169,11 @@ int av_image_fill_arrays(uint8_t *dst_data[4], int dst_linesize[4], * Return the size in bytes of the amount of data required to store an * image with the given parameters. * - * @param[in] align the assumed linesize alignment + * @param pix_fmt the pixel format of the image + * @param widththe width of the image in pixels + * @param height the height of the image in pixels + * @param alignthe assumed linesize alignment + * @return the buffer size in bytes, a negative error code in case of failure */ int av_image_get_buffer_size(enum AVPixelFormat pix_fmt, int width, int height, int align); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'ce6d72d10776b03c6780d4aa676414ce002285d4'
ffmpeg | branch: master | James Almer| Wed Sep 27 20:35:04 2017 -0300| [1a115a31d430b71973b1e1556fcf767417449f09] | committer: James Almer Merge commit 'ce6d72d10776b03c6780d4aa676414ce002285d4' * commit 'ce6d72d10776b03c6780d4aa676414ce002285d4': imgutils: Document av_image_get_buffer_size() Merged-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1a115a31d430b71973b1e1556fcf767417449f09 --- libavutil/imgutils.h | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavutil/imgutils.h b/libavutil/imgutils.h index 2ab90ac033..5b790ecf0a 100644 --- a/libavutil/imgutils.h +++ b/libavutil/imgutils.h @@ -172,7 +172,11 @@ int av_image_fill_arrays(uint8_t *dst_data[4], int dst_linesize[4], * Return the size in bytes of the amount of data required to store an * image with the given parameters. * - * @param[in] align the assumed linesize alignment + * @param pix_fmt the pixel format of the image + * @param widththe width of the image in pixels + * @param height the height of the image in pixels + * @param alignthe assumed linesize alignment + * @return the buffer size in bytes, a negative error code in case of failure */ int av_image_get_buffer_size(enum AVPixelFormat pix_fmt, int width, int height, int align); == ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'b6093e8c72a80710f086c678ab0730cf30953b5c'
ffmpeg | branch: master | James Almer| Wed Sep 27 20:33:41 2017 -0300| [9cf1376aadcdd8952c4ba7af0bf8634ddf99da0d] | committer: James Almer Merge commit 'b6093e8c72a80710f086c678ab0730cf30953b5c' * commit 'b6093e8c72a80710f086c678ab0730cf30953b5c': hlsenc: Correctly write down all 16 bytes in hex This commit is a noop. Merged-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9cf1376aadcdd8952c4ba7af0bf8634ddf99da0d --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] hlsenc: Correctly write down all 16 bytes in hex
ffmpeg | branch: master | Luca Barbato| Thu Feb 9 23:27:41 2017 +0100| [b6093e8c72a80710f086c678ab0730cf30953b5c] | committer: Luca Barbato hlsenc: Correctly write down all 16 bytes in hex Signed-off-by: Luca Barbato > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b6093e8c72a80710f086c678ab0730cf30953b5c --- libavformat/hlsenc.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 05c9adb959..7aef02b805 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -102,11 +102,12 @@ static void free_encryption(AVFormatContext *s) av_freep(>key_basename); } -static int dict_set_bin(AVDictionary **dict, const char *key, uint8_t *buf) +static int dict_set_bin(AVDictionary **dict, const char *key, +uint8_t *buf, size_t len) { char hex[33]; -ff_data_to_hex(hex, buf, sizeof(buf), 0); +ff_data_to_hex(hex, buf, len, 0); hex[32] = '\0'; return av_dict_set(dict, key, hex, 0); @@ -136,7 +137,7 @@ static int setup_encryption(AVFormatContext *s) return AVERROR(EINVAL); } -if ((ret = dict_set_bin(>enc_opts, "key", hls->key)) < 0) +if ((ret = dict_set_bin(>enc_opts, "key", hls->key, hls->key_len)) < 0) return ret; k = hls->key; } else { @@ -145,7 +146,7 @@ static int setup_encryption(AVFormatContext *s) return ret; } -if ((ret = dict_set_bin(>enc_opts, "key", buf)) < 0) +if ((ret = dict_set_bin(>enc_opts, "key", buf, sizeof(buf))) < 0) return ret; k = buf; } @@ -158,7 +159,7 @@ static int setup_encryption(AVFormatContext *s) return AVERROR(EINVAL); } -if ((ret = dict_set_bin(>enc_opts, "iv", hls->iv)) < 0) +if ((ret = dict_set_bin(>enc_opts, "iv", hls->iv, hls->iv_len)) < 0) return ret; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] utvideodec: Add a missing include
ffmpeg | branch: master | Martin Storsjö| Fri Feb 10 09:20:39 2017 +0200| [bc2589763042dc2384b724b203ec778f35bcebad] | committer: Martin Storsjö utvideodec: Add a missing include This was missing from 77c23704c76, fixing building. Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bc2589763042dc2384b724b203ec778f35bcebad --- libavcodec/utvideodec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/utvideodec.c b/libavcodec/utvideodec.c index 381b4f7403..808e3be067 100644 --- a/libavcodec/utvideodec.c +++ b/libavcodec/utvideodec.c @@ -33,6 +33,7 @@ #include "bitstream.h" #include "bswapdsp.h" #include "bytestream.h" +#include "internal.h" #include "thread.h" #include "utvideo.h" ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'bc2589763042dc2384b724b203ec778f35bcebad'
ffmpeg | branch: master | James Almer| Wed Sep 27 20:31:12 2017 -0300| [09b1a9d74038c1bd0a06445e8afd19f0af3b3c72] | committer: James Almer Merge commit 'bc2589763042dc2384b724b203ec778f35bcebad' * commit 'bc2589763042dc2384b724b203ec778f35bcebad': utvideodec: Add a missing include This commit is a noop, see 91ed4e71967f19824237de4c374f038b543c7555 Merged-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=09b1a9d74038c1bd0a06445e8afd19f0af3b3c72 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'a52976c0feab6e86138983c248bd01fa45cdda69'
ffmpeg | branch: master | James Almer| Wed Sep 27 20:29:20 2017 -0300| [91feb62b3dbfb49632e69ebc1cb46a22eac5] | committer: James Almer Merge commit 'a52976c0feab6e86138983c248bd01fa45cdda69' * commit 'a52976c0feab6e86138983c248bd01fa45cdda69': nvenc: make gpu indices independent of supported capabilities This commit is a noop, see 5403d90f32656719a766254d77bbe4411e473eed Merged-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=91feb62b3dbfb49632e69ebc1cb46a22eac5 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] nvenc: make gpu indices independent of supported capabilities
ffmpeg | branch: master | Timo Rothenpieler| Mon Feb 6 18:04:39 2017 -0800| [a52976c0feab6e86138983c248bd01fa45cdda69] | committer: Luca Barbato nvenc: make gpu indices independent of supported capabilities Do not allocate a CUDA context for every available gpu. Signed-off-by: Luca Barbato > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a52976c0feab6e86138983c248bd01fa45cdda69 --- libavcodec/nvenc.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c index fe7b7f40f0..90b9d1a62a 100644 --- a/libavcodec/nvenc.c +++ b/libavcodec/nvenc.c @@ -359,6 +359,9 @@ static int nvenc_check_device(AVCodecContext *avctx, int idx) if (((major << 4) | minor) < NVENC_CAP) goto fail; +if (ctx->device != idx && ctx->device != ANY_DEVICE) +return -1; + ret = nvel->cu_ctx_create(>cu_context_internal, 0, cu_device); if (ret != CUDA_SUCCESS) goto fail; @@ -377,7 +380,7 @@ static int nvenc_check_device(AVCodecContext *avctx, int idx) av_log(avctx, loglevel, "supports NVENC\n"); -if (ctx->device == cu_device || ctx->device == ANY_DEVICE) +if (ctx->device == idx || ctx->device == ANY_DEVICE) return 0; fail3: ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec: Mark some codecs with threadsafe init as such
ffmpeg | branch: master | Derek Buitenhuis| Wed Feb 8 14:42:16 2017 +| [77c23704c769168e4210956314775a1931f6aa0b] | committer: Luca Barbato avcodec: Mark some codecs with threadsafe init as such Signed-off-by: Derek Buitenhuis Signed-off-by: Luca Barbato > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=77c23704c769168e4210956314775a1931f6aa0b --- libavcodec/aasc.c | 1 + libavcodec/aic.c | 1 + libavcodec/anm.c | 1 + libavcodec/ansi.c | 1 + libavcodec/aura.c | 1 + libavcodec/avs.c | 1 + libavcodec/bethsoftvideo.c | 1 + libavcodec/bfi.c | 1 + libavcodec/bmvvideo.c | 1 + libavcodec/c93.c | 1 + libavcodec/cllc.c | 1 + libavcodec/cyuv.c | 2 ++ libavcodec/fraps.c | 1 + libavcodec/lcldec.c| 2 ++ libavcodec/pngdec.c| 1 + libavcodec/r210dec.c | 2 ++ libavcodec/utvideodec.c| 1 + libavcodec/vble.c | 1 + libavcodec/zerocodec.c | 1 + 19 files changed, 22 insertions(+) diff --git a/libavcodec/aasc.c b/libavcodec/aasc.c index e65ea397b8..c4800f0906 100644 --- a/libavcodec/aasc.c +++ b/libavcodec/aasc.c @@ -119,4 +119,5 @@ AVCodec ff_aasc_decoder = { .close = aasc_decode_end, .decode = aasc_decode_frame, .capabilities = AV_CODEC_CAP_DR1, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/aic.c b/libavcodec/aic.c index ed0be44629..de9d7de91b 100644 --- a/libavcodec/aic.c +++ b/libavcodec/aic.c @@ -488,4 +488,5 @@ AVCodec ff_aic_decoder = { .decode = aic_decode_frame, .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .init_thread_copy = ONLY_IF_THREADS_ENABLED(aic_decode_init), +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/anm.c b/libavcodec/anm.c index b70d220c9a..af8d843f6f 100644 --- a/libavcodec/anm.c +++ b/libavcodec/anm.c @@ -199,4 +199,5 @@ AVCodec ff_anm_decoder = { .close = decode_end, .decode = decode_frame, .capabilities = AV_CODEC_CAP_DR1, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/ansi.c b/libavcodec/ansi.c index 65e2e16fae..0bdbdbe071 100644 --- a/libavcodec/ansi.c +++ b/libavcodec/ansi.c @@ -451,4 +451,5 @@ AVCodec ff_ansi_decoder = { .close = decode_close, .decode = decode_frame, .capabilities = AV_CODEC_CAP_DR1, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/aura.c b/libavcodec/aura.c index a1ef6f8d10..6a03f8f572 100644 --- a/libavcodec/aura.c +++ b/libavcodec/aura.c @@ -107,4 +107,5 @@ AVCodec ff_aura2_decoder = { .init = aura_decode_init, .decode = aura_decode_frame, .capabilities = AV_CODEC_CAP_DR1, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/avs.c b/libavcodec/avs.c index 959f570b38..edd91efbbd 100644 --- a/libavcodec/avs.c +++ b/libavcodec/avs.c @@ -186,4 +186,5 @@ AVCodec ff_avs_decoder = { .decode = avs_decode_frame, .close = avs_decode_end, .capabilities = AV_CODEC_CAP_DR1, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/bethsoftvideo.c b/libavcodec/bethsoftvideo.c index 11e2cfaab2..61f098bc09 100644 --- a/libavcodec/bethsoftvideo.c +++ b/libavcodec/bethsoftvideo.c @@ -164,4 +164,5 @@ AVCodec ff_bethsoftvid_decoder = { .close = bethsoftvid_decode_end, .decode = bethsoftvid_decode_frame, .capabilities = AV_CODEC_CAP_DR1, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/bfi.c b/libavcodec/bfi.c index 8335e9d125..0ce73b1754 100644 --- a/libavcodec/bfi.c +++ b/libavcodec/bfi.c @@ -181,4 +181,5 @@ AVCodec ff_bfi_decoder = { .close = bfi_decode_close, .decode = bfi_decode_frame, .capabilities = AV_CODEC_CAP_DR1, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/bmvvideo.c b/libavcodec/bmvvideo.c index 4fb42f0f5c..698bc56871 100644 --- a/libavcodec/bmvvideo.c +++ b/libavcodec/bmvvideo.c @@ -289,4 +289,5 @@ AVCodec ff_bmv_video_decoder = { .init = decode_init, .decode = decode_frame, .capabilities = AV_CODEC_CAP_DR1, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/c93.c b/libavcodec/c93.c index 18df9586d0..e75148328e 100644 --- a/libavcodec/c93.c +++ b/libavcodec/c93.c @@ -261,4 +261,5 @@ AVCodec ff_c93_decoder = { .close = decode_end, .decode = decode_frame, .capabilities = AV_CODEC_CAP_DR1, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/cllc.c b/libavcodec/cllc.c index bac2b730e1..3c476f71f0 100644 --- a/libavcodec/cllc.c +++ b/libavcodec/cllc.c @@ -488,4 +488,5 @@
[FFmpeg-cvslog] Merge commit '77c23704c769168e4210956314775a1931f6aa0b'
ffmpeg | branch: master | James Almer| Wed Sep 27 20:26:57 2017 -0300| [d96363cc8437c9de8fd747068ab331510149810c] | committer: James Almer Merge commit '77c23704c769168e4210956314775a1931f6aa0b' * commit '77c23704c769168e4210956314775a1931f6aa0b': avcodec: Mark some codecs with threadsafe init as such This commit is a noop, see 91ed4e71967f19824237de4c374f038b543c7555 Merged-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d96363cc8437c9de8fd747068ab331510149810c --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavc: Move V4L2 encoders lower in the list
ffmpeg | branch: master | Mark Thompson| Wed Sep 27 23:34:06 2017 +0100| [c1f22c29593048ce2c457f8c592627234503bd4b] | committer: Mark Thompson lavc: Move V4L2 encoders lower in the list Their previous positioning would cause them to chosen before software encoders like libx264 or libvpx. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c1f22c29593048ce2c457f8c592627234503bd4b --- libavcodec/allcodecs.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index f5ef280313..7ae9e8cea1 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -208,10 +208,10 @@ static void register_all(void) REGISTER_ENCDEC (H263, h263); REGISTER_DECODER(H263I, h263i); REGISTER_ENCDEC (H263P, h263p); -REGISTER_ENCDEC (H263_V4L2M2M, h263_v4l2m2m); +REGISTER_DECODER(H263_V4L2M2M, h263_v4l2m2m); REGISTER_DECODER(H264, h264); REGISTER_DECODER(H264_CRYSTALHD,h264_crystalhd); -REGISTER_ENCDEC (H264_V4L2M2M, h264_v4l2m2m); +REGISTER_DECODER(H264_V4L2M2M, h264_v4l2m2m); REGISTER_DECODER(H264_MEDIACODEC, h264_mediacodec); REGISTER_DECODER(H264_MMAL, h264_mmal); REGISTER_DECODER(H264_QSV, h264_qsv); @@ -224,7 +224,7 @@ static void register_all(void) REGISTER_DECODER(HEVC, hevc); REGISTER_DECODER(HEVC_QSV, hevc_qsv); REGISTER_DECODER(HEVC_RKMPP,hevc_rkmpp); -REGISTER_ENCDEC (HEVC_V4L2M2M, hevc_v4l2m2m); +REGISTER_DECODER(HEVC_V4L2M2M, hevc_v4l2m2m); REGISTER_DECODER(HNM4_VIDEO,hnm4_video); REGISTER_DECODER(HQ_HQA,hq_hqa); REGISTER_DECODER(HQX, hqx); @@ -259,7 +259,7 @@ static void register_all(void) REGISTER_ENCDEC (MPEG2VIDEO,mpeg2video); REGISTER_ENCDEC (MPEG4, mpeg4); REGISTER_DECODER(MPEG4_CRYSTALHD, mpeg4_crystalhd); -REGISTER_ENCDEC (MPEG4_V4L2M2M, mpeg4_v4l2m2m); +REGISTER_DECODER(MPEG4_V4L2M2M, mpeg4_v4l2m2m); REGISTER_DECODER(MPEG4_MMAL,mpeg4_mmal); #if FF_API_VDPAU REGISTER_DECODER(MPEG4_VDPAU, mpeg4_vdpau); @@ -383,7 +383,7 @@ static void register_all(void) REGISTER_DECODER(VP7, vp7); REGISTER_DECODER(VP8, vp8); REGISTER_DECODER(VP8_RKMPP, vp8_rkmpp); -REGISTER_ENCDEC (VP8_V4L2M2M, vp8_v4l2m2m); +REGISTER_DECODER(VP8_V4L2M2M, vp8_v4l2m2m); REGISTER_DECODER(VP9, vp9); REGISTER_DECODER(VP9_RKMPP, vp9_rkmpp); REGISTER_DECODER(VP9_V4L2M2M, vp9_v4l2m2m); @@ -668,11 +668,13 @@ static void register_all(void) /* external libraries, that shouldn't be used by default if one of the * above is available */ +REGISTER_ENCODER(H263_V4L2M2M, h263_v4l2m2m); REGISTER_ENCDEC (LIBOPENH264, libopenh264); REGISTER_DECODER(H264_CUVID,h264_cuvid); REGISTER_ENCODER(H264_NVENC,h264_nvenc); REGISTER_ENCODER(H264_OMX, h264_omx); REGISTER_ENCODER(H264_QSV, h264_qsv); +REGISTER_ENCODER(H264_V4L2M2M, h264_v4l2m2m); REGISTER_ENCODER(H264_VAAPI,h264_vaapi); REGISTER_ENCODER(H264_VIDEOTOOLBOX, h264_videotoolbox); #if FF_API_NVENC_OLD_NAME @@ -684,6 +686,7 @@ static void register_all(void) REGISTER_DECODER(HEVC_MEDIACODEC, hevc_mediacodec); REGISTER_ENCODER(HEVC_NVENC,hevc_nvenc); REGISTER_ENCODER(HEVC_QSV, hevc_qsv); +REGISTER_ENCODER(HEVC_V4L2M2M, hevc_v4l2m2m); REGISTER_ENCODER(HEVC_VAAPI,hevc_vaapi); REGISTER_ENCODER(LIBKVAZAAR,libkvazaar); REGISTER_DECODER(MJPEG_CUVID, mjpeg_cuvid); @@ -694,10 +697,12 @@ static void register_all(void) REGISTER_ENCODER(MPEG2_VAAPI, mpeg2_vaapi); REGISTER_DECODER(MPEG4_CUVID, mpeg4_cuvid); REGISTER_DECODER(MPEG4_MEDIACODEC, mpeg4_mediacodec); +REGISTER_ENCODER(MPEG4_V4L2M2M, mpeg4_v4l2m2m); REGISTER_DECODER(VC1_CUVID, vc1_cuvid); REGISTER_DECODER(VP8_CUVID, vp8_cuvid); REGISTER_DECODER(VP8_MEDIACODEC,vp8_mediacodec); REGISTER_DECODER(VP8_QSV, vp8_qsv); +REGISTER_ENCODER(VP8_V4L2M2M, vp8_v4l2m2m); REGISTER_ENCODER(VP8_VAAPI, vp8_vaapi); REGISTER_DECODER(VP9_CUVID, vp9_cuvid); REGISTER_DECODER(VP9_MEDIACODEC,vp9_mediacodec); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '0c0b87f12d48d4e7f0d3d13f9345e828a3a5ea32'
ffmpeg | branch: master | James Almer| Wed Sep 27 19:37:15 2017 -0300| [276f035a4d0f0cbd88c0b67d0358d3d121202c5a] | committer: James Almer Merge commit '0c0b87f12d48d4e7f0d3d13f9345e828a3a5ea32' * commit '0c0b87f12d48d4e7f0d3d13f9345e828a3a5ea32': aarch64: vp9itxfm: Fix incorrect vertical alignment aarch64: vp9itxfm: Update a comment to refer to a register with a different name aarch64: vp9itxfm: Use the right lane sizes in 8x8 for improved readability aarch64: vp9itxfm: Use a single lane ld1 instead of ld1r where possible aarch64: vp9itxfm: Share instructions for loading idct coeffs in the 8x8 function arm: vp9itxfm: Share instructions for loading idct coeffs in the 8x8 function aarch64: vp9itxfm: Do separate functions for half/quarter idct16 and idct32 arm: vp9itxfm: Do a simpler half/quarter idct16/idct32 when possible aarch64: vp9itxfm: Move the load_add_store macro out from the itxfm16 pass2 function arm: vp9itxfm: Move the load_add_store macro out from the itxfm16 pass2 function aarch64: vp9itxfm: Make the larger core transforms standalone functions arm: vp9itxfm: Make the larger core transforms standalone functions This commit is a noop, see f8fcee0daf42d16581ec581bd5ff6373c3a76103 dc47bf3872fde18f6aea33f015a95b70e24dff19 3bd9b39108076e1fca8cd26970cb946fce66523a a681c793a30386d01d273ce86b3368311cffb511 824589556cb7c4bfafb8a0190e71a10c628f5339 9532a7d4d060f2a2741225a76945daed52dbc478 1d8ab576a7e40ea6209dd753929f26dcb37e1444 3006e5253afc6a0ee001916806aae80f157d7043 19a0f9529ccdb48696f0caa251fe36b1d30df739 6752318c737663f0ac019de3acd63e3cea706864 d0fbf7f34e7243f6a4cbde9925f34d924e6d93f7 16ef000799b227d0226b7a678d28c34ff1d09410 Merged-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=276f035a4d0f0cbd88c0b67d0358d3d121202c5a --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] aarch64: vp9itxfm: Fix incorrect vertical alignment
ffmpeg | branch: master | Martin Storsjö| Tue Jan 3 16:11:56 2017 +0200| [0c0b87f12d48d4e7f0d3d13f9345e828a3a5ea32] | committer: Martin Storsjö aarch64: vp9itxfm: Fix incorrect vertical alignment Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0c0b87f12d48d4e7f0d3d13f9345e828a3a5ea32 --- libavcodec/aarch64/vp9itxfm_neon.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/aarch64/vp9itxfm_neon.S b/libavcodec/aarch64/vp9itxfm_neon.S index 81027202f8..a199e9c603 100644 --- a/libavcodec/aarch64/vp9itxfm_neon.S +++ b/libavcodec/aarch64/vp9itxfm_neon.S @@ -225,7 +225,7 @@ endconst add v21.4s,v17.4s,v19.4s rshrn \c0\().4h, v20.4s,#14 add v16.4s,v16.4s,v17.4s -rshrn \c1\().4h, v21.4s, #14 +rshrn \c1\().4h, v21.4s,#14 sub v16.4s,v16.4s,v19.4s rshrn \c2\().4h, v18.4s,#14 rshrn \c3\().4h, v16.4s,#14 @@ -1313,8 +1313,8 @@ function idct32_1d_8x32_pass1\suffix\()_neon bl idct32_odd\suffix -transpose_8x8H v31, v30, v29, v28, v27, v26, v25, v24, v2, v3 -transpose_8x8H v23, v22, v21, v20, v19, v18, v17, v16, v2, v3 +transpose_8x8H v31, v30, v29, v28, v27, v26, v25, v24, v2, v3 +transpose_8x8H v23, v22, v21, v20, v19, v18, v17, v16, v2, v3 // Store the registers a, b horizontally, // adding into the output first, and the mirrored, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] aarch64: vp9itxfm: Do separate functions for half/quarter idct16 and idct32
ffmpeg | branch: master | Martin Storsjö| Tue Nov 22 22:58:35 2016 +0200| [a63da4511d0fee66695ff4afd264ba1dbf1e812d] | committer: Martin Storsjö aarch64: vp9itxfm: Do separate functions for half/quarter idct16 and idct32 This work is sponsored by, and copyright, Google. This avoids loading and calculating coefficients that we know will be zero, and avoids filling the temp buffer with zeros in places where we know the second pass won't read. This gives a pretty substantial speedup for the smaller subpartitions. The code size increases from 14740 bytes to 24292 bytes. The idct16/32_end macros are moved above the individual functions; the instructions themselves are unchanged, but since new functions are added at the same place where the code is moved from, the diff looks rather messy. Before: vp9_inv_dct_dct_16x16_sub1_add_neon: 236.7 vp9_inv_dct_dct_16x16_sub2_add_neon:1051.0 vp9_inv_dct_dct_16x16_sub4_add_neon:1051.0 vp9_inv_dct_dct_16x16_sub8_add_neon:1051.0 vp9_inv_dct_dct_16x16_sub12_add_neon: 1387.4 vp9_inv_dct_dct_16x16_sub16_add_neon: 1387.6 vp9_inv_dct_dct_32x32_sub1_add_neon: 554.1 vp9_inv_dct_dct_32x32_sub2_add_neon:5198.5 vp9_inv_dct_dct_32x32_sub4_add_neon:5198.6 vp9_inv_dct_dct_32x32_sub8_add_neon:5196.3 vp9_inv_dct_dct_32x32_sub12_add_neon: 6183.4 vp9_inv_dct_dct_32x32_sub16_add_neon: 6174.3 vp9_inv_dct_dct_32x32_sub20_add_neon: 7151.4 vp9_inv_dct_dct_32x32_sub24_add_neon: 7145.3 vp9_inv_dct_dct_32x32_sub28_add_neon: 8119.3 vp9_inv_dct_dct_32x32_sub32_add_neon: 8118.7 After: vp9_inv_dct_dct_16x16_sub1_add_neon: 236.7 vp9_inv_dct_dct_16x16_sub2_add_neon: 640.8 vp9_inv_dct_dct_16x16_sub4_add_neon: 639.0 vp9_inv_dct_dct_16x16_sub8_add_neon: 842.0 vp9_inv_dct_dct_16x16_sub12_add_neon: 1388.3 vp9_inv_dct_dct_16x16_sub16_add_neon: 1389.3 vp9_inv_dct_dct_32x32_sub1_add_neon: 554.1 vp9_inv_dct_dct_32x32_sub2_add_neon:3685.5 vp9_inv_dct_dct_32x32_sub4_add_neon:3685.1 vp9_inv_dct_dct_32x32_sub8_add_neon:3684.4 vp9_inv_dct_dct_32x32_sub12_add_neon: 5312.2 vp9_inv_dct_dct_32x32_sub16_add_neon: 5315.4 vp9_inv_dct_dct_32x32_sub20_add_neon: 7154.9 vp9_inv_dct_dct_32x32_sub24_add_neon: 7154.5 vp9_inv_dct_dct_32x32_sub28_add_neon: 8126.6 vp9_inv_dct_dct_32x32_sub32_add_neon: 8127.2 Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a63da4511d0fee66695ff4afd264ba1dbf1e812d --- libavcodec/aarch64/vp9itxfm_neon.S | 525 - 1 file changed, 466 insertions(+), 59 deletions(-) diff --git a/libavcodec/aarch64/vp9itxfm_neon.S b/libavcodec/aarch64/vp9itxfm_neon.S index b6cadfb66b..c954d1a5e1 100644 --- a/libavcodec/aarch64/vp9itxfm_neon.S +++ b/libavcodec/aarch64/vp9itxfm_neon.S @@ -75,6 +75,17 @@ endconst .endif .endm +// Same as dmbutterfly0 above, but treating the input in in2 as zero, +// writing the same output into both out1 and out2. +.macro dmbutterfly0_h out1, out2, in1, in2, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6 +smull \tmp1\().4s, \in1\().4h, v0.h[0] +smull2 \tmp2\().4s, \in1\().8h, v0.h[0] +rshrn \out1\().4h, \tmp1\().4s, #14 +rshrn2 \out1\().8h, \tmp2\().4s, #14 +rshrn \out2\().4h, \tmp1\().4s, #14 +rshrn2 \out2\().8h, \tmp2\().4s, #14 +.endm + // out1,out2 = in1 * coef1 - in2 * coef2 // out3,out4 = in1 * coef2 + in2 * coef1 // out are 4 x .4s registers, in are 2 x .8h registers @@ -104,6 +115,43 @@ endconst rshrn2 \inout2\().8h, \tmp4\().4s, #14 .endm +// Same as dmbutterfly above, but treating the input in inout2 as zero +.macro dmbutterfly_h1 inout1, inout2, coef1, coef2, tmp1, tmp2, tmp3, tmp4 +smull \tmp1\().4s, \inout1\().4h, \coef1 +smull2 \tmp2\().4s, \inout1\().8h, \coef1 +smull \tmp3\().4s, \inout1\().4h, \coef2 +smull2 \tmp4\().4s, \inout1\().8h, \coef2 +rshrn \inout1\().4h, \tmp1\().4s, #14 +rshrn2 \inout1\().8h, \tmp2\().4s, #14 +rshrn \inout2\().4h, \tmp3\().4s, #14 +rshrn2 \inout2\().8h, \tmp4\().4s, #14 +.endm + +// Same as dmbutterfly above, but treating the input in inout1 as zero +.macro dmbutterfly_h2 inout1, inout2, coef1, coef2, tmp1, tmp2, tmp3, tmp4 +smull \tmp1\().4s, \inout2\().4h, \coef2 +smull2 \tmp2\().4s, \inout2\().8h, \coef2 +smull \tmp3\().4s, \inout2\().4h, \coef1 +smull2 \tmp4\().4s, \inout2\().8h, \coef1 +neg \tmp1\().4s, \tmp1\().4s +neg \tmp2\().4s, \tmp2\().4s +rshrn \inout2\().4h, \tmp3\().4s, #14 +rshrn2 \inout2\().8h, \tmp4\().4s, #14 +rshrn \inout1\().4h, \tmp1\().4s, #14 +rshrn2
[FFmpeg-cvslog] aarch64: vp9itxfm: Use a single lane ld1 instead of ld1r where possible
ffmpeg | branch: master | Martin Storsjö| Tue Jan 3 14:55:46 2017 +0200| [ed8d293306e12c9b79022d37d39f48825ce7f2fa] | committer: Martin Storsjö aarch64: vp9itxfm: Use a single lane ld1 instead of ld1r where possible The ld1r is a leftover from the arm version, where this trick is beneficial on some cores. Use a single-lane load where we don't need the semantics of ld1r. Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ed8d293306e12c9b79022d37d39f48825ce7f2fa --- libavcodec/aarch64/vp9itxfm_neon.S | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libavcodec/aarch64/vp9itxfm_neon.S b/libavcodec/aarch64/vp9itxfm_neon.S index a9c7626e65..e7b88364f1 100644 --- a/libavcodec/aarch64/vp9itxfm_neon.S +++ b/libavcodec/aarch64/vp9itxfm_neon.S @@ -255,7 +255,7 @@ function ff_vp9_\txfm1\()_\txfm2\()_4x4_add_neon, export=1 cmp w3, #1 b.ne1f // DC-only for idct/idct -ld1r{v2.4h}, [x2] +ld1 {v2.h}[0], [x2] smull v2.4s, v2.4h, v0.h[0] rshrn v2.4h, v2.4s, #14 smull v2.4s, v2.4h, v0.h[0] @@ -287,8 +287,8 @@ function ff_vp9_\txfm1\()_\txfm2\()_4x4_add_neon, export=1 \txfm2\()4 v4, v5, v6, v7 2: -ld1r{v0.2s}, [x0], x1 -ld1r{v1.2s}, [x0], x1 +ld1 {v0.s}[0], [x0], x1 +ld1 {v1.s}[0], [x0], x1 .ifnc \txfm1,iwht srshr v4.4h, v4.4h, #4 srshr v5.4h, v5.4h, #4 @@ -297,8 +297,8 @@ function ff_vp9_\txfm1\()_\txfm2\()_4x4_add_neon, export=1 .endif uaddw v4.8h, v4.8h, v0.8b uaddw v5.8h, v5.8h, v1.8b -ld1r{v2.2s}, [x0], x1 -ld1r{v3.2s}, [x0], x1 +ld1 {v2.s}[0], [x0], x1 +ld1 {v3.s}[0], [x0], x1 sqxtun v0.8b, v4.8h sqxtun v1.8b, v5.8h sub x0, x0, x1, lsl #2 @@ -394,7 +394,7 @@ function ff_vp9_\txfm1\()_\txfm2\()_8x8_add_neon, export=1 cmp w3, #1 b.ne1f // DC-only for idct/idct -ld1r{v2.4h}, [x2] +ld1 {v2.h}[0], [x2] smull v2.4s, v2.4h, v0.h[0] rshrn v2.4h, v2.4s, #14 smull v2.4s, v2.4h, v0.h[0] @@ -485,7 +485,7 @@ function idct16x16_dc_add_neon moviv1.4h, #0 -ld1r{v2.4h}, [x2] +ld1 {v2.h}[0], [x2] smull v2.4s, v2.4h, v0.h[0] rshrn v2.4h, v2.4s, #14 smull v2.4s, v2.4h, v0.h[0] @@ -1044,7 +1044,7 @@ function idct32x32_dc_add_neon moviv1.4h, #0 -ld1r{v2.4h}, [x2] +ld1 {v2.h}[0], [x2] smull v2.4s, v2.4h, v0.h[0] rshrn v2.4h, v2.4s, #14 smull v2.4s, v2.4h, v0.h[0] ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] aarch64: vp9itxfm: Move the load_add_store macro out from the itxfm16 pass2 function
ffmpeg | branch: master | Martin Storsjö| Sun Feb 5 22:53:55 2017 +0200| [79d332ebbde8c0a3e9da094dcfd10abd33ba7378] | committer: Martin Storsjö aarch64: vp9itxfm: Move the load_add_store macro out from the itxfm16 pass2 function This allows reusing the macro for a separate implementation of the pass2 function. Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=79d332ebbde8c0a3e9da094dcfd10abd33ba7378 --- libavcodec/aarch64/vp9itxfm_neon.S | 90 +++--- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/libavcodec/aarch64/vp9itxfm_neon.S b/libavcodec/aarch64/vp9itxfm_neon.S index 729860ca1f..b6cadfb66b 100644 --- a/libavcodec/aarch64/vp9itxfm_neon.S +++ b/libavcodec/aarch64/vp9itxfm_neon.S @@ -598,6 +598,51 @@ endfunc st1 {v2.8h}, [\src], \inc .endm +.macro load_add_store coef0, coef1, coef2, coef3, coef4, coef5, coef6, coef7, tmp1, tmp2 +srshr \coef0, \coef0, #6 +ld1 {v2.8b}, [x0], x1 +srshr \coef1, \coef1, #6 +ld1 {v3.8b}, [x3], x1 +srshr \coef2, \coef2, #6 +ld1 {v4.8b}, [x0], x1 +srshr \coef3, \coef3, #6 +uaddw \coef0, \coef0, v2.8b +ld1 {v5.8b}, [x3], x1 +uaddw \coef1, \coef1, v3.8b +srshr \coef4, \coef4, #6 +ld1 {v6.8b}, [x0], x1 +srshr \coef5, \coef5, #6 +ld1 {v7.8b}, [x3], x1 +sqxtun v2.8b, \coef0 +srshr \coef6, \coef6, #6 +sqxtun v3.8b, \coef1 +srshr \coef7, \coef7, #6 +uaddw \coef2, \coef2, v4.8b +ld1 {\tmp1}, [x0], x1 +uaddw \coef3, \coef3, v5.8b +ld1 {\tmp2}, [x3], x1 +sqxtun v4.8b, \coef2 +sub x0, x0, x1, lsl #2 +sub x3, x3, x1, lsl #2 +sqxtun v5.8b, \coef3 +uaddw \coef4, \coef4, v6.8b +st1 {v2.8b}, [x0], x1 +uaddw \coef5, \coef5, v7.8b +st1 {v3.8b}, [x3], x1 +sqxtun v6.8b, \coef4 +st1 {v4.8b}, [x0], x1 +sqxtun v7.8b, \coef5 +st1 {v5.8b}, [x3], x1 +uaddw \coef6, \coef6, \tmp1 +st1 {v6.8b}, [x0], x1 +uaddw \coef7, \coef7, \tmp2 +st1 {v7.8b}, [x3], x1 +sqxtun \tmp1, \coef6 +sqxtun \tmp2, \coef7 +st1 {\tmp1}, [x0], x1 +st1 {\tmp2}, [x3], x1 +.endm + // Read a vertical 8x16 slice out of a 16x16 matrix, do a transform on it, // transpose into a horizontal 16x8 slice and store. // x0 = dst (temp buffer) @@ -671,53 +716,8 @@ function \txfm\()16_1d_8x16_pass2_neon lsl x1, x1, #1 bl \txfm\()16 -.macro load_add_store coef0, coef1, coef2, coef3, coef4, coef5, coef6, coef7, tmp1, tmp2 -srshr \coef0, \coef0, #6 -ld1 {v2.8b}, [x0], x1 -srshr \coef1, \coef1, #6 -ld1 {v3.8b}, [x3], x1 -srshr \coef2, \coef2, #6 -ld1 {v4.8b}, [x0], x1 -srshr \coef3, \coef3, #6 -uaddw \coef0, \coef0, v2.8b -ld1 {v5.8b}, [x3], x1 -uaddw \coef1, \coef1, v3.8b -srshr \coef4, \coef4, #6 -ld1 {v6.8b}, [x0], x1 -srshr \coef5, \coef5, #6 -ld1 {v7.8b}, [x3], x1 -sqxtun v2.8b, \coef0 -srshr \coef6, \coef6, #6 -sqxtun v3.8b, \coef1 -srshr \coef7, \coef7, #6 -uaddw \coef2, \coef2, v4.8b -ld1 {\tmp1}, [x0], x1 -uaddw \coef3, \coef3, v5.8b -ld1 {\tmp2}, [x3], x1 -sqxtun v4.8b, \coef2 -sub x0, x0, x1, lsl #2 -sub x3, x3, x1, lsl #2 -sqxtun v5.8b, \coef3 -uaddw \coef4, \coef4, v6.8b -st1 {v2.8b}, [x0], x1 -uaddw \coef5, \coef5, v7.8b -st1 {v3.8b}, [x3], x1 -sqxtun v6.8b, \coef4 -st1 {v4.8b}, [x0], x1 -sqxtun v7.8b, \coef5 -st1 {v5.8b}, [x3], x1 -uaddw \coef6, \coef6, \tmp1 -st1 {v6.8b}, [x0], x1 -uaddw \coef7, \coef7, \tmp2 -st1 {v7.8b}, [x3], x1 -sqxtun \tmp1, \coef6 -sqxtun \tmp2,
[FFmpeg-cvslog] aarch64: vp9itxfm: Update a comment to refer to a register with a different name
ffmpeg | branch: master | Martin Storsjö| Tue Jan 3 23:11:51 2017 +0200| [8476eb0d3ab1f7a52317b23346646389c08fb57a] | committer: Martin Storsjö aarch64: vp9itxfm: Update a comment to refer to a register with a different name Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8476eb0d3ab1f7a52317b23346646389c08fb57a --- libavcodec/aarch64/vp9itxfm_neon.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/aarch64/vp9itxfm_neon.S b/libavcodec/aarch64/vp9itxfm_neon.S index 7582081bd8..81027202f8 100644 --- a/libavcodec/aarch64/vp9itxfm_neon.S +++ b/libavcodec/aarch64/vp9itxfm_neon.S @@ -41,8 +41,8 @@ const iadst16_coeffs, align=4 .short 11003, 12140, 8423, 14053, 5520, 15426, 2404, 16207 endconst -// out1 = ((in1 + in2) * d0[0] + (1 << 13)) >> 14 -// out2 = ((in1 - in2) * d0[0] + (1 << 13)) >> 14 +// out1 = ((in1 + in2) * v0[0] + (1 << 13)) >> 14 +// out2 = ((in1 - in2) * v0[0] + (1 << 13)) >> 14 // in/out are .8h registers; this can do with 4 temp registers, but is // more efficient if 6 temp registers are available. .macro dmbutterfly0 out1, out2, in1, in2, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, neg=0 ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] aarch64: vp9itxfm: Share instructions for loading idct coeffs in the 8x8 function
ffmpeg | branch: master | Martin Storsjö| Tue Jan 3 16:39:41 2017 +0200| [4da4b2b87f08a1331650c7e36eb7d4029a160776] | committer: Martin Storsjö aarch64: vp9itxfm: Share instructions for loading idct coeffs in the 8x8 function Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4da4b2b87f08a1331650c7e36eb7d4029a160776 --- libavcodec/aarch64/vp9itxfm_neon.S | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavcodec/aarch64/vp9itxfm_neon.S b/libavcodec/aarch64/vp9itxfm_neon.S index c954d1a5e1..a9c7626e65 100644 --- a/libavcodec/aarch64/vp9itxfm_neon.S +++ b/libavcodec/aarch64/vp9itxfm_neon.S @@ -379,12 +379,11 @@ function ff_vp9_\txfm1\()_\txfm2\()_8x8_add_neon, export=1 // idct, so those always need to be loaded. .ifc \txfm1\()_\txfm2,idct_idct movrel x4, idct_coeffs -ld1 {v0.8h}, [x4] .else movrel x4, iadst8_coeffs ld1 {v1.8h}, [x4], #16 -ld1 {v0.8h}, [x4] .endif +ld1 {v0.8h}, [x4] moviv2.16b, #0 moviv3.16b, #0 ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] arm: vp9itxfm: Share instructions for loading idct coeffs in the 8x8 function
ffmpeg | branch: master | Martin Storsjö| Tue Jan 3 16:38:56 2017 +0200| [3933b86bb93aca47f29fbd493075b0f110c1e3f5] | committer: Martin Storsjö arm: vp9itxfm: Share instructions for loading idct coeffs in the 8x8 function Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3933b86bb93aca47f29fbd493075b0f110c1e3f5 --- libavcodec/arm/vp9itxfm_neon.S | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavcodec/arm/vp9itxfm_neon.S b/libavcodec/arm/vp9itxfm_neon.S index 167d5178e4..3d0b0fab2e 100644 --- a/libavcodec/arm/vp9itxfm_neon.S +++ b/libavcodec/arm/vp9itxfm_neon.S @@ -412,13 +412,12 @@ function ff_vp9_\txfm1\()_\txfm2\()_8x8_add_neon, export=1 .ifc \txfm1\()_\txfm2,idct_idct movrel r12, idct_coeffs vpush {q4-q5} -vld1.16 {q0}, [r12,:128] .else movrel r12, iadst8_coeffs vld1.16 {q1}, [r12,:128]! vpush {q4-q7} -vld1.16 {q0}, [r12,:128] .endif +vld1.16 {q0}, [r12,:128] vmov.i16q2, #0 vmov.i16q3, #0 ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] aarch64: vp9itxfm: Use the right lane sizes in 8x8 for improved readability
ffmpeg | branch: master | Martin Storsjö| Tue Jan 3 16:46:17 2017 +0200| [3dd7827258ddaa2e51085d0c677d6f3b1be3572f] | committer: Martin Storsjö aarch64: vp9itxfm: Use the right lane sizes in 8x8 for improved readability Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3dd7827258ddaa2e51085d0c677d6f3b1be3572f --- libavcodec/aarch64/vp9itxfm_neon.S | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libavcodec/aarch64/vp9itxfm_neon.S b/libavcodec/aarch64/vp9itxfm_neon.S index e7b88364f1..7582081bd8 100644 --- a/libavcodec/aarch64/vp9itxfm_neon.S +++ b/libavcodec/aarch64/vp9itxfm_neon.S @@ -385,10 +385,10 @@ function ff_vp9_\txfm1\()_\txfm2\()_8x8_add_neon, export=1 .endif ld1 {v0.8h}, [x4] -moviv2.16b, #0 -moviv3.16b, #0 -moviv4.16b, #0 -moviv5.16b, #0 +moviv2.8h, #0 +moviv3.8h, #0 +moviv4.8h, #0 +moviv5.8h, #0 .ifc \txfm1\()_\txfm2,idct_idct cmp w3, #1 @@ -411,11 +411,11 @@ function ff_vp9_\txfm1\()_\txfm2\()_8x8_add_neon, export=1 b 2f .endif 1: -ld1 {v16.16b,v17.16b,v18.16b,v19.16b}, [x2], #64 -ld1 {v20.16b,v21.16b,v22.16b,v23.16b}, [x2], #64 +ld1 {v16.8h,v17.8h,v18.8h,v19.8h}, [x2], #64 +ld1 {v20.8h,v21.8h,v22.8h,v23.8h}, [x2], #64 sub x2, x2, #128 -st1 {v2.16b,v3.16b,v4.16b,v5.16b}, [x2], #64 -st1 {v2.16b,v3.16b,v4.16b,v5.16b}, [x2], #64 +st1 {v2.8h,v3.8h,v4.8h,v5.8h}, [x2], #64 +st1 {v2.8h,v3.8h,v4.8h,v5.8h}, [x2], #64 \txfm1\()8 ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] arm: vp9itxfm: Make the larger core transforms standalone functions
ffmpeg | branch: master | Martin Storsjö| Wed Nov 23 10:56:12 2016 +0200| [0331c3f5e8cb6e6b53fab7893e91d1be1bfa979c] | committer: Martin Storsjö arm: vp9itxfm: Make the larger core transforms standalone functions This work is sponsored by, and copyright, Google. This reduces the code size of libavcodec/arm/vp9itxfm_neon.o from 15324 to 12388 bytes. This gives a small slowdown of a couple tens of cycles, up to around 150 cycles for the full case of the largest transform, but makes it more feasible to add more optimized versions of these transforms. Before: Cortex A7 A8 A9 A53 vp9_inv_dct_dct_16x16_sub4_add_neon:2063.4 1516.0 1719.5 1245.1 vp9_inv_dct_dct_16x16_sub16_add_neon: 3279.3 2454.5 2525.2 1982.3 vp9_inv_dct_dct_32x32_sub4_add_neon: 10750.0 7955.4 8525.6 6754.2 vp9_inv_dct_dct_32x32_sub32_add_neon: 18574.0 17108.4 14216.7 12010.2 After: vp9_inv_dct_dct_16x16_sub4_add_neon:2060.8 1608.5 1735.7 1262.0 vp9_inv_dct_dct_16x16_sub16_add_neon: 3211.2 2443.5 2546.1 1999.5 vp9_inv_dct_dct_32x32_sub4_add_neon: 10682.0 8043.8 8581.3 6810.1 vp9_inv_dct_dct_32x32_sub32_add_neon: 18522.4 17277.4 14286.7 12087.9 Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0331c3f5e8cb6e6b53fab7893e91d1be1bfa979c --- libavcodec/arm/vp9itxfm_neon.S | 43 +- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/libavcodec/arm/vp9itxfm_neon.S b/libavcodec/arm/vp9itxfm_neon.S index 49b993ffe3..fd53a20a73 100644 --- a/libavcodec/arm/vp9itxfm_neon.S +++ b/libavcodec/arm/vp9itxfm_neon.S @@ -534,7 +534,7 @@ function idct16x16_dc_add_neon endfunc .ltorg -.macro idct16 +function idct16 mbutterfly0 d16, d24, d16, d24, d4, d6, q2, q3 @ d16 = t0a, d24 = t1a mbutterfly d20, d28, d0[1], d0[2], q2, q3 @ d20 = t2a, d28 = t3a mbutterfly d18, d30, d0[3], d1[0], q2, q3 @ d18 = t4a, d30 = t7a @@ -580,9 +580,10 @@ endfunc vmovd4, d21 @ d4 = t10a butterfly d20, d27, d6, d27 @ d20 = out[4], d27 = out[11] butterfly d21, d26, d26, d4@ d21 = out[5], d26 = out[10] -.endm +bx lr +endfunc -.macro iadst16 +function iadst16 movrel r12, iadst16_coeffs vld1.16 {q0-q1}, [r12,:128] @@ -653,7 +654,8 @@ endfunc vmovd16, d2 vmovd30, d4 -.endm +bx lr +endfunc .macro itxfm16_1d_funcs txfm @ Read a vertical 4x16 slice out of a 16x16 matrix, do a transform on it, @@ -662,6 +664,8 @@ endfunc @ r1 = slice offset @ r2 = src function \txfm\()16_1d_4x16_pass1_neon +push{lr} + mov r12, #32 vmov.s16q2, #0 .irp i, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 @@ -669,7 +673,7 @@ function \txfm\()16_1d_4x16_pass1_neon vst1.16 {d4}, [r2,:64], r12 .endr -\txfm\()16 +bl \txfm\()16 @ Do four 4x4 transposes. Originally, d16-d31 contain the @ 16 rows. Afterwards, d16-d19, d20-d23, d24-d27, d28-d31 @@ -682,7 +686,7 @@ function \txfm\()16_1d_4x16_pass1_neon .irp i, 16, 20, 24, 28, 17, 21, 25, 29, 18, 22, 26, 30, 19, 23, 27, 31 vst1.16 {d\i}, [r0,:64]! .endr -bx lr +pop {pc} 1: @ Special case: For the last input column (r1 == 12), @ which would be stored as the last row in the temp buffer, @@ -709,7 +713,7 @@ function \txfm\()16_1d_4x16_pass1_neon vmovd29, d17 vmovd30, d18 vmovd31, d19 -bx lr +pop {pc} endfunc @ Read a vertical 4x16 slice out of a 16x16 matrix, do a transform on it, @@ -719,6 +723,7 @@ endfunc @ r2 = src (temp buffer) @ r3 = slice offset function \txfm\()16_1d_4x16_pass2_neon +push{lr} mov r12, #32 .irp i, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27 vld1.16 {d\i}, [r2,:64], r12 @@ -732,7 +737,7 @@ function \txfm\()16_1d_4x16_pass2_neon add r3, r0, r1 lsl r1, r1, #1 -\txfm\()16 +bl \txfm\()16 .macro load_add_store coef0, coef1, coef2, coef3 vrshr.s16 \coef0, \coef0, #6 @@ -773,7 +778,7 @@ function \txfm\()16_1d_4x16_pass2_neon load_add_store q12, q13, q14, q15 .purgem load_add_store -bx lr +pop {pc} endfunc .endm @@ -908,7 +913,7 @@ function idct32x32_dc_add_neon bx lr endfunc -.macro idct32_odd +function idct32_odd movrel r12, idct_coeffs add
[FFmpeg-cvslog] arm: vp9itxfm: Move the load_add_store macro out from the itxfm16 pass2 function
ffmpeg | branch: master | Martin Storsjö| Sun Feb 5 22:55:20 2017 +0200| [47b3c2c18d1897f3c753ba0cec4b2d7aa24526af] | committer: Martin Storsjö arm: vp9itxfm: Move the load_add_store macro out from the itxfm16 pass2 function This allows reusing the macro for a separate implementation of the pass2 function. Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=47b3c2c18d1897f3c753ba0cec4b2d7aa24526af --- libavcodec/arm/vp9itxfm_neon.S | 72 +- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/libavcodec/arm/vp9itxfm_neon.S b/libavcodec/arm/vp9itxfm_neon.S index fd53a20a73..b3188bc711 100644 --- a/libavcodec/arm/vp9itxfm_neon.S +++ b/libavcodec/arm/vp9itxfm_neon.S @@ -657,6 +657,42 @@ function iadst16 bx lr endfunc +.macro load_add_store coef0, coef1, coef2, coef3 +vrshr.s16 \coef0, \coef0, #6 +vrshr.s16 \coef1, \coef1, #6 + +vld1.32 {d4[]}, [r0,:32], r1 +vld1.32 {d4[1]}, [r3,:32], r1 +vrshr.s16 \coef2, \coef2, #6 +vrshr.s16 \coef3, \coef3, #6 +vld1.32 {d5[]}, [r0,:32], r1 +vld1.32 {d5[1]}, [r3,:32], r1 +vaddw.u8\coef0, \coef0, d4 +vld1.32 {d6[]}, [r0,:32], r1 +vld1.32 {d6[1]}, [r3,:32], r1 +vaddw.u8\coef1, \coef1, d5 +vld1.32 {d7[]}, [r0,:32], r1 +vld1.32 {d7[1]}, [r3,:32], r1 + +vqmovun.s16 d4, \coef0 +vqmovun.s16 d5, \coef1 +sub r0, r0, r1, lsl #2 +sub r3, r3, r1, lsl #2 +vaddw.u8\coef2, \coef2, d6 +vaddw.u8\coef3, \coef3, d7 +vst1.32 {d4[0]}, [r0,:32], r1 +vst1.32 {d4[1]}, [r3,:32], r1 +vqmovun.s16 d6, \coef2 +vst1.32 {d5[0]}, [r0,:32], r1 +vst1.32 {d5[1]}, [r3,:32], r1 +vqmovun.s16 d7, \coef3 + +vst1.32 {d6[0]}, [r0,:32], r1 +vst1.32 {d6[1]}, [r3,:32], r1 +vst1.32 {d7[0]}, [r0,:32], r1 +vst1.32 {d7[1]}, [r3,:32], r1 +.endm + .macro itxfm16_1d_funcs txfm @ Read a vertical 4x16 slice out of a 16x16 matrix, do a transform on it, @ transpose into a horizontal 16x4 slice and store. @@ -739,44 +775,8 @@ function \txfm\()16_1d_4x16_pass2_neon lsl r1, r1, #1 bl \txfm\()16 -.macro load_add_store coef0, coef1, coef2, coef3 -vrshr.s16 \coef0, \coef0, #6 -vrshr.s16 \coef1, \coef1, #6 - -vld1.32 {d4[]}, [r0,:32], r1 -vld1.32 {d4[1]}, [r3,:32], r1 -vrshr.s16 \coef2, \coef2, #6 -vrshr.s16 \coef3, \coef3, #6 -vld1.32 {d5[]}, [r0,:32], r1 -vld1.32 {d5[1]}, [r3,:32], r1 -vaddw.u8\coef0, \coef0, d4 -vld1.32 {d6[]}, [r0,:32], r1 -vld1.32 {d6[1]}, [r3,:32], r1 -vaddw.u8\coef1, \coef1, d5 -vld1.32 {d7[]}, [r0,:32], r1 -vld1.32 {d7[1]}, [r3,:32], r1 - -vqmovun.s16 d4, \coef0 -vqmovun.s16 d5, \coef1 -sub r0, r0, r1, lsl #2 -sub r3, r3, r1, lsl #2 -vaddw.u8\coef2, \coef2, d6 -vaddw.u8\coef3, \coef3, d7 -vst1.32 {d4[0]}, [r0,:32], r1 -vst1.32 {d4[1]}, [r3,:32], r1 -vqmovun.s16 d6, \coef2 -vst1.32 {d5[0]}, [r0,:32], r1 -vst1.32 {d5[1]}, [r3,:32], r1 -vqmovun.s16 d7, \coef3 - -vst1.32 {d6[0]}, [r0,:32], r1 -vst1.32 {d6[1]}, [r3,:32], r1 -vst1.32 {d7[0]}, [r0,:32], r1 -vst1.32 {d7[1]}, [r3,:32], r1 -.endm load_add_store q8, q9, q10, q11 load_add_store q12, q13, q14, q15 -.purgem load_add_store pop {pc} endfunc ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] arm: vp9itxfm: Do a simpler half/quarter idct16/idct32 when possible
ffmpeg | branch: master | Martin Storsjö| Tue Nov 22 11:07:38 2016 +0200| [5eb5aec475aabc884d083566f902876ecbc072cb] | committer: Martin Storsjö arm: vp9itxfm: Do a simpler half/quarter idct16/idct32 when possible This work is sponsored by, and copyright, Google. This avoids loading and calculating coefficients that we know will be zero, and avoids filling the temp buffer with zeros in places where we know the second pass won't read. This gives a pretty substantial speedup for the smaller subpartitions. The code size increases from 12388 bytes to 19784 bytes. The idct16/32_end macros are moved above the individual functions; the instructions themselves are unchanged, but since new functions are added at the same place where the code is moved from, the diff looks rather messy. Before: Cortex A7 A8 A9 A53 vp9_inv_dct_dct_16x16_sub1_add_neon: 273.0189.5212.0235.8 vp9_inv_dct_dct_16x16_sub2_add_neon:2102.1 1521.7 1736.2 1265.8 vp9_inv_dct_dct_16x16_sub4_add_neon:2104.5 1533.0 1736.6 1265.5 vp9_inv_dct_dct_16x16_sub8_add_neon:2484.8 1828.7 2014.4 1506.5 vp9_inv_dct_dct_16x16_sub12_add_neon: 2851.2 2117.8 2294.8 1753.2 vp9_inv_dct_dct_16x16_sub16_add_neon: 3239.4 2408.3 2543.5 1994.9 vp9_inv_dct_dct_32x32_sub1_add_neon: 758.3456.7864.5553.9 vp9_inv_dct_dct_32x32_sub2_add_neon: 10776.7 7949.8 8567.7 6819.7 vp9_inv_dct_dct_32x32_sub4_add_neon: 10865.6 8131.5 8589.6 6816.3 vp9_inv_dct_dct_32x32_sub8_add_neon: 12053.9 9271.3 9387.7 7564.0 vp9_inv_dct_dct_32x32_sub12_add_neon: 13328.3 10463.2 10217.0 8321.3 vp9_inv_dct_dct_32x32_sub16_add_neon: 14176.4 11509.5 11018.7 9062.3 vp9_inv_dct_dct_32x32_sub20_add_neon: 15301.5 12999.9 11855.1 9828.2 vp9_inv_dct_dct_32x32_sub24_add_neon: 16482.7 14931.5 12650.1 10575.0 vp9_inv_dct_dct_32x32_sub28_add_neon: 17589.5 15811.9 13482.8 11333.4 vp9_inv_dct_dct_32x32_sub32_add_neon: 18696.2 17049.2 14355.6 12089.7 After: vp9_inv_dct_dct_16x16_sub1_add_neon: 273.0189.5211.7235.8 vp9_inv_dct_dct_16x16_sub2_add_neon:1203.5998.2 1035.3763.0 vp9_inv_dct_dct_16x16_sub4_add_neon:1203.5998.1 1035.5760.8 vp9_inv_dct_dct_16x16_sub8_add_neon:1926.1 1610.6 1722.1 1271.7 vp9_inv_dct_dct_16x16_sub12_add_neon: 2873.2 2129.7 2285.1 1757.3 vp9_inv_dct_dct_16x16_sub16_add_neon: 3221.4 2520.3 2557.6 2002.1 vp9_inv_dct_dct_32x32_sub1_add_neon: 753.0457.5866.6554.6 vp9_inv_dct_dct_32x32_sub2_add_neon:7554.6 5652.4 6048.4 4920.2 vp9_inv_dct_dct_32x32_sub4_add_neon:7549.9 5685.0 6046.9 4925.7 vp9_inv_dct_dct_32x32_sub8_add_neon:8336.9 6704.5 6604.0 5478.0 vp9_inv_dct_dct_32x32_sub12_add_neon: 10914.0 9777.2 9240.4 7416.9 vp9_inv_dct_dct_32x32_sub16_add_neon: 11859.2 11223.3 9966.3 8095.1 vp9_inv_dct_dct_32x32_sub20_add_neon: 15237.1 13029.4 11838.3 9829.4 vp9_inv_dct_dct_32x32_sub24_add_neon: 16293.2 14379.8 12644.9 10572.0 vp9_inv_dct_dct_32x32_sub28_add_neon: 17424.3 15734.7 13473.0 11326.9 vp9_inv_dct_dct_32x32_sub32_add_neon: 18531.3 17457.0 14298.6 12080.0 Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5eb5aec475aabc884d083566f902876ecbc072cb --- libavcodec/arm/vp9itxfm_neon.S | 591 + 1 file changed, 537 insertions(+), 54 deletions(-) diff --git a/libavcodec/arm/vp9itxfm_neon.S b/libavcodec/arm/vp9itxfm_neon.S index b3188bc711..167d5178e4 100644 --- a/libavcodec/arm/vp9itxfm_neon.S +++ b/libavcodec/arm/vp9itxfm_neon.S @@ -74,6 +74,14 @@ endconst vrshrn.s32 \out2, \tmpq4, #14 .endm +@ Same as mbutterfly0 above, but treating the input in in2 as zero, +@ writing the same output into both out1 and out2. +.macro mbutterfly0_h out1, out2, in1, in2, tmpd1, tmpd2, tmpq3, tmpq4 +vmull.s16 \tmpq3, \in1, d0[0] +vrshrn.s32 \out1, \tmpq3, #14 +vrshrn.s32 \out2, \tmpq3, #14 +.endm + @ out1,out2 = ((in1 + in2) * d0[0] + (1 << 13)) >> 14 @ out3,out4 = ((in1 - in2) * d0[0] + (1 << 13)) >> 14 @ Same as mbutterfly0, but with input being 2 q registers, output @@ -137,6 +145,23 @@ endconst vrshrn.s32 \inout2, \tmp2, #14 .endm +@ Same as mbutterfly above, but treating the input in inout2 as zero +.macro mbutterfly_h1 inout1, inout2, coef1, coef2, tmp1, tmp2 +vmull.s16 \tmp1, \inout1, \coef1 +vmull.s16 \tmp2, \inout1, \coef2 +vrshrn.s32 \inout1, \tmp1, #14 +vrshrn.s32 \inout2, \tmp2, #14 +.endm + +@ Same as mbutterfly above, but treating the input in inout1 as zero +.macro mbutterfly_h2 inout1, inout2, coef1, coef2, tmp1, tmp2 +vmull.s16 \tmp1, \inout2, \coef2 +vmull.s16 \tmp2, \inout2, \coef1 +
[FFmpeg-cvslog] aarch64: vp9itxfm: Make the larger core transforms standalone functions
ffmpeg | branch: master | Martin Storsjö| Wed Nov 23 14:03:05 2016 +0200| [115476018d2c97df7e9b4445fe8f6cc7420ab91f] | committer: Martin Storsjö aarch64: vp9itxfm: Make the larger core transforms standalone functions This work is sponsored by, and copyright, Google. This reduces the code size of libavcodec/aarch64/vp9itxfm_neon.o from 19496 to 14740 bytes. This gives a small slowdown of a couple of tens of cycles, but makes it more feasible to add more optimized versions of these transforms. Before: vp9_inv_dct_dct_16x16_sub4_add_neon:1036.7 vp9_inv_dct_dct_16x16_sub16_add_neon: 1372.2 vp9_inv_dct_dct_32x32_sub4_add_neon:5180.0 vp9_inv_dct_dct_32x32_sub32_add_neon: 8095.7 After: vp9_inv_dct_dct_16x16_sub4_add_neon:1051.0 vp9_inv_dct_dct_16x16_sub16_add_neon: 1390.1 vp9_inv_dct_dct_32x32_sub4_add_neon:5199.9 vp9_inv_dct_dct_32x32_sub32_add_neon: 8125.8 Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=115476018d2c97df7e9b4445fe8f6cc7420ab91f --- libavcodec/aarch64/vp9itxfm_neon.S | 42 +++--- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/libavcodec/aarch64/vp9itxfm_neon.S b/libavcodec/aarch64/vp9itxfm_neon.S index c14c5f9ded..729860ca1f 100644 --- a/libavcodec/aarch64/vp9itxfm_neon.S +++ b/libavcodec/aarch64/vp9itxfm_neon.S @@ -463,7 +463,7 @@ function idct16x16_dc_add_neon ret endfunc -.macro idct16 +function idct16 dmbutterfly0v16, v24, v16, v24, v2, v3, v4, v5, v6, v7 // v16 = t0a, v24 = t1a dmbutterfly v20, v28, v0.h[1], v0.h[2], v2, v3, v4, v5 // v20 = t2a, v28 = t3a dmbutterfly v18, v30, v0.h[3], v0.h[4], v2, v3, v4, v5 // v18 = t4a, v30 = t7a @@ -506,9 +506,10 @@ endfunc butterfly_8hv19, v28, v5, v28 // v19 = out[3], v28 = out[12] butterfly_8hv20, v27, v6, v27 // v20 = out[4], v27 = out[11] butterfly_8hv21, v26, v26, v3// v21 = out[5], v26 = out[10] -.endm +ret +endfunc -.macro iadst16 +function iadst16 ld1 {v0.8h,v1.8h}, [x11] dmbutterfly_l v6, v7, v4, v5, v31, v16, v0.h[1], v0.h[0] // v6,v7 = t1, v4,v5 = t0 @@ -577,7 +578,8 @@ endfunc mov v16.16b, v2.16b mov v30.16b, v4.16b -.endm +ret +endfunc // Helper macros; we can't use these expressions directly within // e.g. .irp due to the extra concatenation \(). Therefore wrap @@ -604,12 +606,14 @@ endfunc // x9 = input stride .macro itxfm16_1d_funcs txfm function \txfm\()16_1d_8x16_pass1_neon +mov x14, x30 + moviv2.8h, #0 .irp i, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 load_clear \i, x2, x9 .endr -\txfm\()16 +bl \txfm\()16 // Do two 8x8 transposes. Originally, v16-v31 contain the // 16 rows. Afterwards, v16-v23 and v24-v31 contain the two @@ -623,7 +627,7 @@ function \txfm\()16_1d_8x16_pass1_neon .irp i, 16, 24, 17, 25, 18, 26, 19, 27, 20, 28, 21, 29, 22, 30, 23, 31 store \i, x0, #16 .endr -ret +br x14 1: // Special case: For the last input column (x1 == 8), // which would be stored as the last row in the temp buffer, @@ -642,7 +646,7 @@ function \txfm\()16_1d_8x16_pass1_neon mov v29.16b, v21.16b mov v30.16b, v22.16b mov v31.16b, v23.16b -ret +br x14 endfunc // Read a vertical 8x16 slice out of a 16x16 matrix, do a transform on it, @@ -653,6 +657,7 @@ endfunc // x3 = slice offset // x9 = temp buffer stride function \txfm\()16_1d_8x16_pass2_neon +mov x14, x30 .irp i, 16, 17, 18, 19, 20, 21, 22, 23 load\i, x2, x9 .endr @@ -664,7 +669,7 @@ function \txfm\()16_1d_8x16_pass2_neon add x3, x0, x1 lsl x1, x1, #1 -\txfm\()16 +bl \txfm\()16 .macro load_add_store coef0, coef1, coef2, coef3, coef4, coef5, coef6, coef7, tmp1, tmp2 srshr \coef0, \coef0, #6 @@ -714,7 +719,7 @@ function \txfm\()16_1d_8x16_pass2_neon load_add_store v24.8h, v25.8h, v26.8h, v27.8h, v28.8h, v29.8h, v30.8h, v31.8h, v16.8b, v17.8b .purgem load_add_store -ret +br x14 endfunc .endm @@ -843,7 +848,7 @@ function idct32x32_dc_add_neon ret endfunc -.macro idct32_odd +function idct32_odd ld1 {v0.8h,v1.8h}, [x11] dmbutterfly v16, v31, v0.h[0], v0.h[1], v4, v5, v6, v7 // v16 = t16a, v31 = t31a @@ -898,7 +903,8 @@ endfunc dmbutterfly0v26, v21, v26, v21, v2, v3, v4, v5, v6, v7 // v26 = t26a, v21 = t21a dmbutterfly0v25,
[FFmpeg-cvslog] lavc/v4l2: Add missing header include
ffmpeg | branch: master | Mark Thompson| Wed Sep 27 23:06:49 2017 +0100| [da53c424b96f57d7471767d99072d35efe15a8e0] | committer: Mark Thompson lavc/v4l2: Add missing header include Fixes checkheaders. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=da53c424b96f57d7471767d99072d35efe15a8e0 --- libavcodec/v4l2_buffers.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/v4l2_buffers.h b/libavcodec/v4l2_buffers.h index 5d25a87750..b16f694b98 100644 --- a/libavcodec/v4l2_buffers.h +++ b/libavcodec/v4l2_buffers.h @@ -26,6 +26,8 @@ #include +#include "avcodec.h" + enum V4L2Buffer_status { V4L2BUF_AVAILABLE, V4L2BUF_IN_DRIVER, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] configure: Correctly recurse in do_check_deps()
ffmpeg | branch: master | Diego Biurrun| Wed Feb 8 18:06:34 2017 +0100| [c546147db07d16a76c2fb698d2e8a3057f393475] | committer: Diego Biurrun configure: Correctly recurse in do_check_deps() Fixes all sorts of configuration problems introducec by dad7a9c7c0ae on non-Linux or non-vanilla configs. Also removes a line made redundant in that commit. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c546147db07d16a76c2fb698d2e8a3057f393475 --- configure | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/configure b/configure index 7d39acab37..9ebc3bf894 100755 --- a/configure +++ b/configure @@ -612,7 +612,6 @@ is_in(){ do_check_deps(){ for cfg; do -cfg="${cfg#!}" enabled ${cfg}_checking && die "Circular dependency for $cfg." disabled ${cfg}_checking && continue enable ${cfg}_checking @@ -627,7 +626,7 @@ do_check_deps(){ eval dep_ifn="\$${cfg}_if_any" pushvar cfg dep_all dep_any dep_con dep_sel dep_sgs dep_ifa dep_ifn -check_deps $dep_all $dep_any $dep_con $dep_sel $dep_sgs $dep_ifa $dep_ifn +do_check_deps $dep_all $dep_any $dep_con $dep_sel $dep_sgs $dep_ifa $dep_ifn popvar cfg dep_all dep_any dep_con dep_sel dep_sgs dep_ifa dep_ifn [ -n "$dep_ifa" ] && { enabled_all $dep_ifa && enable_weak $cfg; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'c546147db07d16a76c2fb698d2e8a3057f393475'
ffmpeg | branch: master | James Almer| Wed Sep 27 19:08:19 2017 -0300| [57db1faf7a47223b471924845f2c37178d3ebf33] | committer: James Almer Merge commit 'c546147db07d16a76c2fb698d2e8a3057f393475' * commit 'c546147db07d16a76c2fb698d2e8a3057f393475': configure: Correctly recurse in do_check_deps() See 7659f35638e2ca7a8b202cb3007ca5473b108fa4. Merged-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=57db1faf7a47223b471924845f2c37178d3ebf33 --- configure | 1 - 1 file changed, 1 deletion(-) diff --git a/configure b/configure index 0af8f3c7e5..c7d73325db 100755 --- a/configure +++ b/configure @@ -734,7 +734,6 @@ is_in(){ do_check_deps(){ for cfg; do -cfg="${cfg#!}" enabled ${cfg}_checking && die "Circular dependency for $cfg." disabled ${cfg}_checking && continue enable ${cfg}_checking == ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '57ec83e4246b21c2f0c068b9151d806737d4497f'
ffmpeg | branch: master | James Almer| Wed Sep 27 19:06:12 2017 -0300| [f1cdfd29590c8f4246692b7f8dba65890b4128e1] | committer: James Almer Merge commit '57ec83e4246b21c2f0c068b9151d806737d4497f' * commit '57ec83e4246b21c2f0c068b9151d806737d4497f': omx: Use the EOS flag to handle flushing at the end Merged-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f1cdfd29590c8f4246692b7f8dba65890b4128e1 --- libavcodec/omx.c | 30 +++--- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/libavcodec/omx.c b/libavcodec/omx.c index 19b4f33836..466e0be9fe 100644 --- a/libavcodec/omx.c +++ b/libavcodec/omx.c @@ -220,7 +220,7 @@ typedef struct OMXCodecContext { int mutex_cond_inited; -int num_in_frames, num_out_frames; +int eos_sent, got_eos; uint8_t *output_buf; int output_buf_size; @@ -808,17 +808,35 @@ static int omx_encode_frame(AVCodecContext *avctx, AVPacket *pkt, av_log(avctx, AV_LOG_ERROR, "OMX_EmptyThisBuffer failed: %x\n", err); return AVERROR_UNKNOWN; } -s->num_in_frames++; +} else if (!s->eos_sent) { +buffer = get_buffer(>input_mutex, >input_cond, +>num_free_in_buffers, s->free_in_buffers, 1); + +buffer->nFilledLen = 0; +buffer->nFlags = OMX_BUFFERFLAG_EOS; +buffer->pAppPrivate = buffer->pOutputPortPrivate = NULL; +err = OMX_EmptyThisBuffer(s->handle, buffer); +if (err != OMX_ErrorNone) { +append_buffer(>input_mutex, >input_cond, >num_free_in_buffers, s->free_in_buffers, buffer); +av_log(avctx, AV_LOG_ERROR, "OMX_EmptyThisBuffer failed: %x\n", err); +return AVERROR_UNKNOWN; +} +s->eos_sent = 1; } -while (!*got_packet && ret == 0) { -// Only wait for output if flushing and not all frames have been output +while (!*got_packet && ret == 0 && !s->got_eos) { +// If not flushing, just poll the queue if there's finished packets. +// If flushing, do a blocking wait until we either get a completed +// packet, or get EOS. buffer = get_buffer(>output_mutex, >output_cond, >num_done_out_buffers, s->done_out_buffers, -!frame && s->num_out_frames < s->num_in_frames); +!frame); if (!buffer) break; +if (buffer->nFlags & OMX_BUFFERFLAG_EOS) +s->got_eos = 1; + if (buffer->nFlags & OMX_BUFFERFLAG_CODECCONFIG && avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) { if ((ret = av_reallocp(>extradata, avctx->extradata_size + buffer->nFilledLen + AV_INPUT_BUFFER_PADDING_SIZE)) < 0) { avctx->extradata_size = 0; @@ -828,8 +846,6 @@ static int omx_encode_frame(AVCodecContext *avctx, AVPacket *pkt, avctx->extradata_size += buffer->nFilledLen; memset(avctx->extradata + avctx->extradata_size, 0, AV_INPUT_BUFFER_PADDING_SIZE); } else { -if (buffer->nFlags & OMX_BUFFERFLAG_ENDOFFRAME) -s->num_out_frames++; if (!(buffer->nFlags & OMX_BUFFERFLAG_ENDOFFRAME) || !pkt->data) { // If the output packet isn't preallocated, just concatenate everything in our // own buffer == ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] omx: Use the EOS flag to handle flushing at the end
ffmpeg | branch: master | Martin Storsjö| Tue Feb 7 00:25:19 2017 +0200| [57ec83e4246b21c2f0c068b9151d806737d4497f] | committer: Martin Storsjö omx: Use the EOS flag to handle flushing at the end This avoids having to count the number of frames sent to the codec and the number of output packets received; instead just wait until the encoder returns a buffer with the EOS flag set. Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=57ec83e4246b21c2f0c068b9151d806737d4497f --- libavcodec/omx.c | 30 +++--- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/libavcodec/omx.c b/libavcodec/omx.c index 05c874323c..f43e92ae88 100644 --- a/libavcodec/omx.c +++ b/libavcodec/omx.c @@ -220,7 +220,7 @@ typedef struct OMXCodecContext { int mutex_cond_inited; -int num_in_frames, num_out_frames; +int eos_sent, got_eos; uint8_t *output_buf; int output_buf_size; @@ -791,17 +791,35 @@ static int omx_encode_frame(AVCodecContext *avctx, AVPacket *pkt, av_log(avctx, AV_LOG_ERROR, "OMX_EmptyThisBuffer failed: %x\n", err); return AVERROR_UNKNOWN; } -s->num_in_frames++; +} else if (!s->eos_sent) { +buffer = get_buffer(>input_mutex, >input_cond, +>num_free_in_buffers, s->free_in_buffers, 1); + +buffer->nFilledLen = 0; +buffer->nFlags = OMX_BUFFERFLAG_EOS; +buffer->pAppPrivate = buffer->pOutputPortPrivate = NULL; +err = OMX_EmptyThisBuffer(s->handle, buffer); +if (err != OMX_ErrorNone) { +append_buffer(>input_mutex, >input_cond, >num_free_in_buffers, s->free_in_buffers, buffer); +av_log(avctx, AV_LOG_ERROR, "OMX_EmptyThisBuffer failed: %x\n", err); +return AVERROR_UNKNOWN; +} +s->eos_sent = 1; } -while (!*got_packet && ret == 0) { -// Only wait for output if flushing and not all frames have been output +while (!*got_packet && ret == 0 && !s->got_eos) { +// If not flushing, just poll the queue if there's finished packets. +// If flushing, do a blocking wait until we either get a completed +// packet, or get EOS. buffer = get_buffer(>output_mutex, >output_cond, >num_done_out_buffers, s->done_out_buffers, -!frame && s->num_out_frames < s->num_in_frames); +!frame); if (!buffer) break; +if (buffer->nFlags & OMX_BUFFERFLAG_EOS) +s->got_eos = 1; + if (buffer->nFlags & OMX_BUFFERFLAG_CODECCONFIG && avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) { if ((ret = av_reallocp(>extradata, avctx->extradata_size + buffer->nFilledLen + AV_INPUT_BUFFER_PADDING_SIZE)) < 0) { avctx->extradata_size = 0; @@ -811,8 +829,6 @@ static int omx_encode_frame(AVCodecContext *avctx, AVPacket *pkt, avctx->extradata_size += buffer->nFilledLen; memset(avctx->extradata + avctx->extradata_size, 0, AV_INPUT_BUFFER_PADDING_SIZE); } else { -if (buffer->nFlags & OMX_BUFFERFLAG_ENDOFFRAME) -s->num_out_frames++; if (!(buffer->nFlags & OMX_BUFFERFLAG_ENDOFFRAME) || !pkt->data) { // If the output packet isn't preallocated, just concatenate everything in our // own buffer ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'dad7a9c7c0ae8ebc56f2e3a24e6fa4da5c2cd491'
ffmpeg | branch: master | James Almer| Wed Sep 27 18:56:08 2017 -0300| [7659f35638e2ca7a8b202cb3007ca5473b108fa4] | committer: James Almer Merge commit 'dad7a9c7c0ae8ebc56f2e3a24e6fa4da5c2cd491' * commit 'dad7a9c7c0ae8ebc56f2e3a24e6fa4da5c2cd491': configure: Rework dependency handling for conflicting components Includes an important fix made by c546147db07d16a76c2fb698d2e8a3057f393475 as well. Merged-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7659f35638e2ca7a8b202cb3007ca5473b108fa4 --- configure | 25 +++-- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/configure b/configure index 44c5637ea5..0af8f3c7e5 100755 --- a/configure +++ b/configure @@ -742,19 +742,21 @@ do_check_deps(){ eval dep_all="\$${cfg}_deps" eval dep_any="\$${cfg}_deps_any" +eval dep_con="\$${cfg}_conflict" eval dep_sel="\$${cfg}_select" eval dep_sgs="\$${cfg}_suggest" eval dep_ifa="\$${cfg}_if" eval dep_ifn="\$${cfg}_if_any" -pushvar cfg dep_all dep_any dep_sel dep_sgs dep_ifa dep_ifn -do_check_deps $dep_all $dep_any $dep_sel $dep_sgs $dep_ifa $dep_ifn -popvar cfg dep_all dep_any dep_sel dep_sgs dep_ifa dep_ifn +pushvar cfg dep_all dep_any dep_con dep_sel dep_sgs dep_ifa dep_ifn +do_check_deps $dep_all $dep_any $dep_con $dep_sel $dep_sgs $dep_ifa $dep_ifn +popvar cfg dep_all dep_any dep_con dep_sel dep_sgs dep_ifa dep_ifn [ -n "$dep_ifa" ] && { enabled_all $dep_ifa && enable_weak $cfg; } [ -n "$dep_ifn" ] && { enabled_any $dep_ifn && enable_weak $cfg; } enabled_all $dep_all || { disable $cfg && requested $cfg && die "ERROR: $cfg requested, but not all dependencies are satisfied: $dep_all"; } enabled_any $dep_any || { disable $cfg && requested $cfg && die "ERROR: $cfg requested, but not any dependency is satisfied: $dep_any"; } +disabled_all $dep_con || { disable $cfg && requested $cfg && die "ERROR: $cfg requested, but some conflicting dependencies are unsatisfied: $dep_con"; } disabled_any $dep_sel && { disable $cfg && requested $cfg && die "ERROR: $cfg requested, but some selected dependency is unsatisfied: $dep_sel"; } if enabled $cfg; then @@ -2379,7 +2381,8 @@ simd_align_32_if_any="avx" # system capabilities symver_if_any="symver_asm_label symver_gnu_asm" -valgrind_backtrace_deps="!optimizations valgrind_valgrind_h" +valgrind_backtrace_conflict="optimizations" +valgrind_backtrace_deps="valgrind_valgrind_h" # threading support atomics_gcc_if="sync_val_compare_and_swap" @@ -3119,10 +3122,10 @@ xv_outdev_extralibs="-lXv -lX11 -lXext" # protocols async_protocol_deps="threads" bluray_protocol_deps="libbluray" -ffrtmpcrypt_protocol_deps="!librtmp_protocol" +ffrtmpcrypt_protocol_conflict="librtmp_protocol" ffrtmpcrypt_protocol_deps_any="gcrypt gmp openssl" ffrtmpcrypt_protocol_select="tcp_protocol" -ffrtmphttp_protocol_deps="!librtmp_protocol" +ffrtmphttp_protocol_conflict="librtmp_protocol" ffrtmphttp_protocol_select="http_protocol" ftp_protocol_select="tcp_protocol" gopher_protocol_select="network" @@ -3139,10 +3142,10 @@ libsmbclient_protocol_deps="libsmbclient gplv3" libssh_protocol_deps="libssh" mmsh_protocol_select="http_protocol" mmst_protocol_select="network" -rtmp_protocol_deps="!librtmp_protocol" +rtmp_protocol_conflict="librtmp_protocol" rtmp_protocol_select="tcp_protocol" rtmpe_protocol_select="ffrtmpcrypt_protocol" -rtmps_protocol_deps="!librtmp_protocol" +rtmps_protocol_conflict="librtmp_protocol" rtmps_protocol_select="tls_protocol" rtmpt_protocol_select="ffrtmphttp_protocol" rtmpte_protocol_select="ffrtmpcrypt_protocol ffrtmphttp_protocol" @@ -3152,9 +3155,11 @@ sctp_protocol_deps="struct_sctp_event_subscribe struct_msghdr_msg_flags" sctp_protocol_select="network" srtp_protocol_select="rtp_protocol srtp" tcp_protocol_select="network" -tls_gnutls_protocol_deps="gnutls !tls_schannel_protocol !tls_securetransport_protocol" +tls_gnutls_protocol_conflict="tls_schannel_protocol tls_securetransport_protocol" +tls_gnutls_protocol_deps="gnutls" tls_gnutls_protocol_select="tcp_protocol" -tls_openssl_protocol_deps="openssl !tls_schannel_protocol !tls_securetransport_protocol !tls_gnutls_protocol" +tls_openssl_protocol_conflict="tls_schannel_protocol tls_securetransport_protocol tls_gnutls_protocol" +tls_openssl_protocol_deps="openssl" tls_openssl_protocol_select="tcp_protocol" tls_schannel_protocol_deps="schannel" tls_schannel_protocol_select="tcp_protocol" == diff --cc configure index 44c5637ea5,7d39acab37..0af8f3c7e5 --- a/configure +++ b/configure @@@ -747,15 -626,16 +748,16 @@@ do_check_deps() eval dep_ifa="\$${cfg}_if" eval dep_ifn="\$${cfg}_if_any" - pushvar cfg dep_all dep_any dep_sel
[FFmpeg-cvslog] configure: Rework dependency handling for conflicting components
ffmpeg | branch: master | Diego Biurrun| Fri Jan 20 17:17:16 2017 +0100| [dad7a9c7c0ae8ebc56f2e3a24e6fa4da5c2cd491] | committer: Diego Biurrun configure: Rework dependency handling for conflicting components This makes the feature more visible and obvious. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dad7a9c7c0ae8ebc56f2e3a24e6fa4da5c2cd491 --- configure | 22 +- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/configure b/configure index 376ac148c8..7d39acab37 100755 --- a/configure +++ b/configure @@ -620,19 +620,21 @@ do_check_deps(){ eval dep_all="\$${cfg}_deps" eval dep_any="\$${cfg}_deps_any" +eval dep_con="\$${cfg}_conflict" eval dep_sel="\$${cfg}_select" eval dep_sgs="\$${cfg}_suggest" eval dep_ifa="\$${cfg}_if" eval dep_ifn="\$${cfg}_if_any" -pushvar cfg dep_all dep_any dep_sel dep_sgs dep_ifa dep_ifn -do_check_deps $dep_all $dep_any $dep_sel $dep_sgs $dep_ifa $dep_ifn -popvar cfg dep_all dep_any dep_sel dep_sgs dep_ifa dep_ifn +pushvar cfg dep_all dep_any dep_con dep_sel dep_sgs dep_ifa dep_ifn +check_deps $dep_all $dep_any $dep_con $dep_sel $dep_sgs $dep_ifa $dep_ifn +popvar cfg dep_all dep_any dep_con dep_sel dep_sgs dep_ifa dep_ifn [ -n "$dep_ifa" ] && { enabled_all $dep_ifa && enable_weak $cfg; } [ -n "$dep_ifn" ] && { enabled_any $dep_ifn && enable_weak $cfg; } enabled_all $dep_all || disable $cfg enabled_any $dep_any || disable $cfg +disabled_all $dep_con || disable $cfg disabled_any $dep_sel && disable $cfg if enabled $cfg; then @@ -1922,7 +1924,8 @@ simd_align_32_if_any="avx" # system capabilities symver_if_any="symver_asm_label symver_gnu_asm" -valgrind_backtrace_deps="!optimizations valgrind_valgrind_h" +valgrind_backtrace_conflict="optimizations" +valgrind_backtrace_deps="valgrind_valgrind_h" # threading support atomics_gcc_if="sync_val_compare_and_swap" @@ -2422,10 +2425,10 @@ xcbgrab_indev_deps="libxcb" xcbgrab_indev_suggest="libxcb_shm libxcb_xfixes" # protocols -ffrtmpcrypt_protocol_deps="!librtmp_protocol" +ffrtmpcrypt_protocol_conflict="librtmp_protocol" ffrtmpcrypt_protocol_deps_any="gmp openssl" ffrtmpcrypt_protocol_select="tcp_protocol" -ffrtmphttp_protocol_deps="!librtmp_protocol" +ffrtmphttp_protocol_conflict="librtmp_protocol" ffrtmphttp_protocol_select="http_protocol" gopher_protocol_select="network" http_protocol_select="tcp_protocol" @@ -2439,10 +2442,10 @@ librtmpt_protocol_deps="librtmp" librtmpte_protocol_deps="librtmp" mmsh_protocol_select="http_protocol" mmst_protocol_select="network" -rtmp_protocol_deps="!librtmp_protocol" +rtmp_protocol_conflict="librtmp_protocol" rtmp_protocol_select="tcp_protocol" rtmpe_protocol_select="ffrtmpcrypt_protocol" -rtmps_protocol_deps="!librtmp_protocol" +rtmps_protocol_conflict="librtmp_protocol" rtmps_protocol_select="tls_protocol" rtmpt_protocol_select="ffrtmphttp_protocol" rtmpte_protocol_select="ffrtmpcrypt_protocol ffrtmphttp_protocol" @@ -2454,7 +2457,8 @@ srtp_protocol_select="rtp_protocol srtp" tcp_protocol_select="network" tls_gnutls_protocol_deps="gnutls" tls_gnutls_protocol_select="tcp_protocol" -tls_openssl_protocol_deps="openssl !tls_gnutls_protocol" +tls_openssl_protocol_conflict="tls_gnutls_protocol" +tls_openssl_protocol_deps="openssl" tls_openssl_protocol_select="tcp_protocol" tls_protocol_deps_any="tls_gnutls_protocol tls_openssl_protocol" udp_protocol_select="network" ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavc: Add support for RockChip Media Process Platform
ffmpeg | branch: master | Lionel CHAZALLON| Sun Sep 24 05:39:45 2017 +| [f3aefb3e1c3c6afeaca889d4fd2648458fd74dfe] | committer: Mark Thompson lavc: Add support for RockChip Media Process Platform This adds hardware decoding for H.264 / HEVC / VP8 / VP9 using the MPP Rockchip API. It returns frames holding an AVDRMFrameDescriptor struct in buf[0] that allows drm / dmabuf usage. Tested on RK3288 (TinkerBoard) and RK3328. Signed-off-by: Mark Thompson > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f3aefb3e1c3c6afeaca889d4fd2648458fd74dfe --- Changelog | 1 + configure | 15 ++ libavcodec/Makefile| 4 + libavcodec/allcodecs.c | 4 + libavcodec/rkmppdec.c | 596 + libavcodec/version.h | 2 +- 6 files changed, 621 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index 678dcdadc7..c64cef4c89 100644 --- a/Changelog +++ b/Changelog @@ -50,6 +50,7 @@ version : - KMS screen grabber - CUDA thumbnail filter - V4L2 mem2mem HW assisted codecs +- Rockchip MPP hardware decoding version 3.3: diff --git a/configure b/configure index 548f766e79..44c5637ea5 100755 --- a/configure +++ b/configure @@ -316,6 +316,7 @@ External library support: --disable-nvenc disable Nvidia video encoding code [autodetect] --enable-omx enable OpenMAX IL code [no] --enable-omx-rpi enable OpenMAX IL code for Raspberry Pi [no] + --enable-rkmpp enable Rockchip Media Process Platform code [no] --disable-vaapi disable Video Acceleration API (mainly Unix/Intel) code [autodetect] --disable-vdadisable Apple Video Decode Acceleration code [autodetect] --disable-vdpau disable Nvidia Video Decode and Presentation API for Unix code [autodetect] @@ -1567,6 +1568,7 @@ EXTERNAL_LIBRARY_VERSION3_LIST=" libopencore_amrnb libopencore_amrwb libvo_amrwbenc +rkmpp " EXTERNAL_LIBRARY_GPLV3_LIST=" @@ -2801,6 +2803,8 @@ h264_qsv_decoder_deps="libmfx" h264_qsv_decoder_select="h264_mp4toannexb_bsf h264_parser qsvdec h264_qsv_hwaccel" h264_qsv_encoder_deps="libmfx" h264_qsv_encoder_select="qsvenc" +h264_rkmpp_decoder_deps="rkmpp" +h264_rkmpp_decoder_select="h264_mp4toannexb_bsf" h264_vaapi_encoder_deps="VAEncPictureParameterBufferH264" h264_vaapi_encoder_select="vaapi_encode golomb" h264_vda_decoder_deps="vda" @@ -2818,6 +2822,8 @@ hevc_qsv_decoder_deps="libmfx" hevc_qsv_decoder_select="hevc_mp4toannexb_bsf hevc_parser qsvdec hevc_qsv_hwaccel" hevc_qsv_encoder_deps="libmfx" hevc_qsv_encoder_select="hevcparse qsvenc" +hevc_rkmpp_decoder_deps="rkmpp" +hevc_rkmpp_decoder_select="hevc_mp4toannexb_bsf" hevc_vaapi_encoder_deps="VAEncPictureParameterBufferHEVC" hevc_vaapi_encoder_select="vaapi_encode golomb" hevc_v4l2m2m_decoder_deps="v4l2_m2m hevc_v4l2_m2m" @@ -2864,12 +2870,14 @@ vp8_cuvid_decoder_deps="cuda cuvid" vp8_mediacodec_decoder_deps="mediacodec" vp8_qsv_decoder_deps="libmfx" vp8_qsv_decoder_select="qsvdec vp8_qsv_hwaccel vp8_parser" +vp8_rkmpp_decoder_deps="rkmpp" vp8_vaapi_encoder_deps="VAEncPictureParameterBufferVP8" vp8_vaapi_encoder_select="vaapi_encode" vp8_v4l2m2m_decoder_deps="v4l2_m2m vp8_v4l2_m2m" vp8_v4l2m2m_encoder_deps="v4l2_m2m vp8_v4l2_m2m" vp9_cuvid_decoder_deps="cuda cuvid" vp9_mediacodec_decoder_deps="mediacodec" +vp9_rkmpp_decoder_deps="rkmpp" vp9_vaapi_encoder_deps="VAEncPictureParameterBufferVP9" vp9_vaapi_encoder_select="vaapi_encode" vp9_v4l2m2m_decoder_deps="v4l2_m2m vp9_v4l2_m2m" @@ -6066,6 +6074,13 @@ enabled openssl && { use_pkg_config "" openssl openssl/ssl.h OPENSSL_i check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 || check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 || die "ERROR: openssl not found"; } +enabled rkmpp && { { require_pkg_config rockchip_mpp rockchip_mpp rockchip/rk_mpi.h mpp_create || + die "ERROR : Rockchip MPP was not found."; } && + { check_func_headers rockchip/rk_mpi_cmd.h "MPP_DEC_GET_FREE_PACKET_SLOT_COUNT" || + die "ERROR: Rockchip MPP is outdated, please get a more recent one."; } && + { enabled libdrm || + die "ERROR: rkmpp requires --enable-libdrm"; } + } if enabled gcrypt; then GCRYPT_CONFIG="${cross_prefix}libgcrypt-config" diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 1b17c27408..c4ec09b1c4 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -341,6 +341,7 @@ OBJS-$(CONFIG_H264_VDA_DECODER)+= vda_h264_dec.o OBJS-$(CONFIG_H264_OMX_ENCODER)+= omx.o OBJS-$(CONFIG_H264_QSV_DECODER)+=
[FFmpeg-cvslog] Merge commit '9127ac5ebc941d5e54828a91e5072c876be8ec42'
ffmpeg | branch: master | James Almer| Wed Sep 27 16:45:32 2017 -0300| [d1256750e896d03179c262473e9bd25eb6259e82] | committer: James Almer Merge commit '9127ac5ebc941d5e54828a91e5072c876be8ec42' * commit '9127ac5ebc941d5e54828a91e5072c876be8ec42': configure: Add name parameter to require_pkg_config() helper function Merged-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d1256750e896d03179c262473e9bd25eb6259e82 --- configure | 106 -- 1 file changed, 55 insertions(+), 51 deletions(-) diff --git a/configure b/configure index a4baeb3b2a..548f766e79 100755 --- a/configure +++ b/configure @@ -1389,14 +1389,18 @@ require_cpp_condition(){ use_pkg_config(){ log use_pkg_config "$@" -pkg="$1" +name="$1" +shift +pkg_version="$1" +pkg="${1%% *}" +test "$name" = "" && name=$pkg check_pkg_config "$@" || return 1 add_cflags$(get_safe "${pkg}_cflags") add_extralibs $(get_safe "${pkg}_extralibs") } require_pkg_config(){ -use_pkg_config "$@" || die "ERROR: $pkg not found using pkg-config$pkg_config_fail_message" +use_pkg_config "$@" || die "ERROR: $pkg_version not found using pkg-config$pkg_config_fail_message" } hostcc_e(){ @@ -5693,7 +5697,7 @@ case "$custom_allocator" in require libjemalloc jemalloc/jemalloc.h malloc -ljemalloc ;; tcmalloc) -require_pkg_config libtcmalloc gperftools/tcmalloc.h tc_malloc +require_pkg_config "" libtcmalloc gperftools/tcmalloc.h tc_malloc malloc_prefix=tc_ ;; esac @@ -5893,44 +5897,44 @@ enabled decklink && { require_header DeckLinkAPI.h && enabled libndi_newtek && require_header Processing.NDI.Lib.h enabled frei0r&& require_header frei0r.h enabled gmp && require gmp gmp.h mpz_export -lgmp -enabled gnutls&& require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init +enabled gnutls&& require_pkg_config "" gnutls gnutls/gnutls.h gnutls_global_init enabled jni && { [ $target_os = "android" ] && check_header jni.h && enabled pthreads || die "ERROR: jni not found"; } enabled ladspa&& require_header ladspa.h enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883 -enabled libass&& require_pkg_config libass ass/ass.h ass_library_init -enabled libbluray && require_pkg_config libbluray libbluray/bluray.h bd_open -enabled libbs2b && require_pkg_config libbs2b bs2b.h bs2b_open +enabled libass&& require_pkg_config "" libass ass/ass.h ass_library_init +enabled libbluray && require_pkg_config "" libbluray libbluray/bluray.h bd_open +enabled libbs2b && require_pkg_config "" libbs2b bs2b.h bs2b_open enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 && { check_lib libcelt celt/celt.h celt_decoder_create_custom -lcelt0 || die "ERROR: libcelt must be installed and version must be >= 0.11.0."; } -enabled libcaca && require_pkg_config caca caca.h caca_create_canvas -enabled libdc1394 && require_pkg_config libdc1394-2 dc1394/dc1394.h dc1394_new -enabled libdrm&& require_pkg_config libdrm xf86drm.h drmGetVersion -enabled libfdk_aac&& { use_pkg_config fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen || +enabled libcaca && require_pkg_config libcaca caca caca.h caca_create_canvas +enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new +enabled libdrm&& require_pkg_config "" libdrm xf86drm.h drmGetVersion +enabled libfdk_aac&& { use_pkg_config libfdk_aac fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen || { require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac && warn "using libfdk without pkg-config"; } } flite_extralibs="-lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal -lflite_cmu_us_kal16 -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish -lflite_cmulex -lflite" enabled libflite && require libflite "flite/flite.h" flite_init $flite_extralibs enabled fontconfig&& enable libfontconfig -enabled libfontconfig && require_pkg_config fontconfig "fontconfig/fontconfig.h" FcInit -enabled libfreetype && require_pkg_config freetype2 "ft2build.h FT_FREETYPE_H" FT_Init_FreeType -enabled libfribidi&& require_pkg_config fribidi fribidi.h fribidi_version_info -enabled libgme&& { use_pkg_config libgme gme/gme.h gme_new_emu || +enabled libfontconfig && require_pkg_config libfontconfig fontconfig "fontconfig/fontconfig.h" FcInit +enabled libfreetype && require_pkg_config libfreetype2 freetype2
[FFmpeg-cvslog] configure: Add name parameter to require_pkg_config() helper function
ffmpeg | branch: master | Diego Biurrun| Mon Jan 23 11:57:14 2017 +0100| [9127ac5ebc941d5e54828a91e5072c876be8ec42] | committer: Diego Biurrun configure: Add name parameter to require_pkg_config() helper function This allows distinguishing between the internal variable name for external libraries and the pkg-config package name. Having both names available avoids special-casing outside the helper function when the two identifiers do not match. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9127ac5ebc941d5e54828a91e5072c876be8ec42 --- configure | 53 - 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/configure b/configure index c2580a3650..376ac148c8 100755 --- a/configure +++ b/configure @@ -1134,8 +1134,11 @@ require_cpp_condition(){ require_pkg_config(){ log require_pkg_config "$@" +name="$1" +shift pkg_version="$1" pkg="${1%% *}" +test "$name" = "" && name=$pkg check_pkg_config "$@" || die "ERROR: $pkg_version not found" add_cflags$(get_safe "${pkg}_cflags") add_extralibs $(get_safe "${pkg}_extralibs") @@ -4513,7 +4516,7 @@ case "$custom_allocator" in require libjemalloc jemalloc/jemalloc.h malloc -ljemalloc ;; tcmalloc) -require_pkg_config libtcmalloc gperftools/tcmalloc.h tc_malloc +require_pkg_config "" libtcmalloc gperftools/tcmalloc.h tc_malloc malloc_prefix=tc_ ;; esac @@ -4649,41 +4652,41 @@ enabled avisynth && require_header avisynth/avisynth_c.h enabled avxsynth && require avxsynth "avxsynth/avxsynth_c.h dlfcn.h" dlopen -ldl enabled cuda && require cuda cuda.h cuInit -lcuda enabled frei0r&& require_header frei0r.h -enabled gnutls&& require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init -enabled libbs2b && require_pkg_config libbs2b bs2b.h bs2b_open -enabled libdc1394 && require_pkg_config libdc1394-2 dc1394/dc1394.h dc1394_new +enabled gnutls&& require_pkg_config "" gnutls gnutls/gnutls.h gnutls_global_init +enabled libbs2b && require_pkg_config "" libbs2b bs2b.h bs2b_open +enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new enabled libdcadec && require libdcadec libdcadec/dca_context.h dcadec_context_create -ldcadec enabled libfaac && require libfaac "stdint.h faac.h" faacEncGetVersion -lfaac -enabled libfdk_aac&& require_pkg_config fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen -enabled libfontconfig && require_pkg_config fontconfig "fontconfig/fontconfig.h" FcInit -enabled libfreetype && require_pkg_config freetype2 "ft2build.h FT_FREETYPE_H" FT_Init_FreeType +enabled libfdk_aac&& require_pkg_config libfdk_aac fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen +enabled libfontconfig && require_pkg_config libfontconfig fontconfig "fontconfig/fontconfig.h" FcInit +enabled libfreetype && require_pkg_config libfreetype freetype2 "ft2build.h FT_FREETYPE_H" FT_Init_FreeType enabled libgsm&& { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do check_lib libgsm "${gsm_hdr}" gsm_create -lgsm && break; done || die "ERROR: libgsm not found"; } -enabled libhdcd && require_pkg_config libhdcd "hdcd/hdcd_simple.h" hdcd_new +enabled libhdcd && require_pkg_config "" libhdcd "hdcd/hdcd_simple.h" hdcd_new enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc -enabled libkvazaar&& require_pkg_config "kvazaar >= 0.8.1" kvazaar.h kvz_api_get -enabled libmfx&& require_pkg_config libmfx "mfx/mfxvideo.h" MFXInit +enabled libkvazaar&& require_pkg_config libkvazaar "kvazaar >= 0.8.1" kvazaar.h kvz_api_get +enabled libmfx&& require_pkg_config "" libmfx "mfx/mfxvideo.h" MFXInit enabled libmp3lame&& require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame enabled libnpp&& require libnpp npp.h nppGetLibVersion -lnppi -lnppc enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb -enabled libopencv && require_pkg_config opencv opencv/cv.h cvCreateImageHeader -enabled libopenh264 && require_pkg_config openh264 wels/codec_api.h WelsGetCodecVersion +enabled libopencv && require_pkg_config libopencv opencv opencv/cv.h cvCreateImageHeader +enabled libopenh264 && require_pkg_config libopenh264 openh264 wels/codec_api.h WelsGetCodecVersion enabled libopenjpeg && { check_lib libopenjpeg openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC || - require_pkg_config libopenjpeg1 openjpeg.h
[FFmpeg-cvslog] avcodec/mips: Improve avc chroma vert mc msa functions
ffmpeg | branch: master | Kaustubh Raste| Tue Sep 26 11:14:27 2017 +0530| [b8854e2439c3db73e0d63b838763702d14a61767] | committer: Michael Niedermayer avcodec/mips: Improve avc chroma vert mc msa functions Replace generic with block size specific function. Signed-off-by: Kaustubh Raste Reviewed-by: Manojkumar Bhosale Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b8854e2439c3db73e0d63b838763702d14a61767 --- libavcodec/mips/h264chroma_msa.c | 237 ++- 1 file changed, 112 insertions(+), 125 deletions(-) diff --git a/libavcodec/mips/h264chroma_msa.c b/libavcodec/mips/h264chroma_msa.c index c27830d760..16e2fe4ec7 100644 --- a/libavcodec/mips/h264chroma_msa.c +++ b/libavcodec/mips/h264chroma_msa.c @@ -302,8 +302,7 @@ static void avc_chroma_hz_8w_msa(uint8_t *src, uint8_t *dst, int32_t stride, } } -static void avc_chroma_vt_2x2_msa(uint8_t *src, int32_t src_stride, - uint8_t *dst, int32_t dst_stride, +static void avc_chroma_vt_2x2_msa(uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1) { uint16_t out0, out1; @@ -315,7 +314,7 @@ static void avc_chroma_vt_2x2_msa(uint8_t *src, int32_t src_stride, v16i8 coeff_vec1 = __msa_fill_b(coeff1); v16u8 coeff_vec = (v16u8) __msa_ilvr_b(coeff_vec0, coeff_vec1); -LD_SB3(src, src_stride, src0, src1, src2); +LD_SB3(src, stride, src0, src1, src2); ILVR_B2_UB(src1, src0, src2, src1, tmp0, tmp1); @@ -331,12 +330,11 @@ static void avc_chroma_vt_2x2_msa(uint8_t *src, int32_t src_stride, out1 = __msa_copy_u_h(res, 2); SH(out0, dst); -dst += dst_stride; +dst += stride; SH(out1, dst); } -static void avc_chroma_vt_2x4_msa(uint8_t *src, int32_t src_stride, - uint8_t *dst, int32_t dst_stride, +static void avc_chroma_vt_2x4_msa(uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1) { v16u8 src0, src1, src2, src3, src4; @@ -347,39 +345,7 @@ static void avc_chroma_vt_2x4_msa(uint8_t *src, int32_t src_stride, v16i8 coeff_vec1 = __msa_fill_b(coeff1); v16u8 coeff_vec = (v16u8) __msa_ilvr_b(coeff_vec0, coeff_vec1); -LD_UB5(src, src_stride, src0, src1, src2, src3, src4); -ILVR_B4_UB(src1, src0, src2, src1, src3, src2, src4, src3, - tmp0, tmp1, tmp2, tmp3); -ILVR_W2_UB(tmp1, tmp0, tmp3, tmp2, tmp0, tmp2); - -tmp0 = (v16u8) __msa_ilvr_d((v2i64) tmp2, (v2i64) tmp0); - -res_r = __msa_dotp_u_h(tmp0, coeff_vec); -res_r <<= 3; -res_r = (v8u16) __msa_srari_h((v8i16) res_r, 6); -res_r = __msa_sat_u_h(res_r, 7); - -res = (v8i16) __msa_pckev_b((v16i8) res_r, (v16i8) res_r); - -ST2x4_UB(res, 0, dst, dst_stride); -} - -static void avc_chroma_vt_2x8_msa(uint8_t *src, int32_t src_stride, - uint8_t *dst, int32_t dst_stride, - uint32_t coeff0, uint32_t coeff1) -{ -v16u8 src0, src1, src2, src3, src4, src5, src6, src7, src8; -v16u8 tmp0, tmp1, tmp2, tmp3; -v8i16 res; -v8u16 res_r; -v16i8 coeff_vec0 = __msa_fill_b(coeff0); -v16i8 coeff_vec1 = __msa_fill_b(coeff1); -v16u8 coeff_vec = (v16u8) __msa_ilvr_b(coeff_vec0, coeff_vec1); - -LD_UB5(src, src_stride, src0, src1, src2, src3, src4); -src += (5 * src_stride); -LD_UB4(src, src_stride, src5, src6, src7, src8); - +LD_UB5(src, stride, src0, src1, src2, src3, src4); ILVR_B4_UB(src1, src0, src2, src1, src3, src2, src4, src3, tmp0, tmp1, tmp2, tmp3); ILVR_W2_UB(tmp1, tmp0, tmp3, tmp2, tmp0, tmp2); @@ -393,42 +359,21 @@ static void avc_chroma_vt_2x8_msa(uint8_t *src, int32_t src_stride, res = (v8i16) __msa_pckev_b((v16i8) res_r, (v16i8) res_r); -ST2x4_UB(res, 0, dst, dst_stride); -dst += (4 * dst_stride); - -ILVR_B4_UB(src5, src4, src6, src5, src7, src6, src8, src7, - tmp0, tmp1, tmp2, tmp3); -ILVR_W2_UB(tmp1, tmp0, tmp3, tmp2, tmp0, tmp2); - -tmp0 = (v16u8) __msa_ilvr_d((v2i64) tmp2, (v2i64) tmp0); - -res_r = __msa_dotp_u_h(tmp0, coeff_vec); -res_r <<= 3; -res_r = (v8u16) __msa_srari_h((v8i16) res_r, 6); -res_r = __msa_sat_u_h(res_r, 7); - -res = (v8i16) __msa_pckev_b((v16i8) res_r, (v16i8) res_r); - -ST2x4_UB(res, 0, dst, dst_stride); -dst += (4 * dst_stride); +ST2x4_UB(res, 0, dst, stride); } -static void avc_chroma_vt_2w_msa(uint8_t *src, int32_t src_stride, - uint8_t *dst, int32_t dst_stride, +static void avc_chroma_vt_2w_msa(uint8_t *src, uint8_t *dst, int32_t stride, uint32_t coeff0, uint32_t coeff1, int32_t height) { if (2
[FFmpeg-cvslog] avcodec/mips: Improve avc put mc 20, 01 and 03 msa functions
ffmpeg | branch: master | Kaustubh Raste| Tue Sep 26 13:38:23 2017 +0530| [6796a1dd8c14843b77925cb83a3ef88706ae1dd0] | committer: Michael Niedermayer avcodec/mips: Improve avc put mc 20, 01 and 03 msa functions Remove loops and unroll as block sizes are known. Signed-off-by: Kaustubh Raste Reviewed-by: Manojkumar Bhosale Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6796a1dd8c14843b77925cb83a3ef88706ae1dd0 --- libavcodec/mips/h264qpel_msa.c | 441 - 1 file changed, 432 insertions(+), 9 deletions(-) diff --git a/libavcodec/mips/h264qpel_msa.c b/libavcodec/mips/h264qpel_msa.c index b7f6c3d589..0b42bc4f72 100644 --- a/libavcodec/mips/h264qpel_msa.c +++ b/libavcodec/mips/h264qpel_msa.c @@ -148,6 +148,17 @@ static const uint8_t luma_mask_arr[16 * 8] = { hz_out_m;\ } ) +#define AVC_DOT_SH3_SH(in0, in1, in2, coeff0, coeff1, coeff2) \ +( { \ +v8i16 out0_m; \ +\ +out0_m = __msa_dotp_s_h((v16i8) in0, (v16i8) coeff0); \ +out0_m = __msa_dpadd_s_h(out0_m, (v16i8) in1, (v16i8) coeff1); \ +out0_m = __msa_dpadd_s_h(out0_m, (v16i8) in2, (v16i8) coeff2); \ +\ +out0_m; \ +} ) + static void avc_luma_hz_4w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, int32_t height) @@ -3373,55 +3384,467 @@ void ff_put_h264_qpel4_mc30_msa(uint8_t *dst, const uint8_t *src, void ff_put_h264_qpel16_mc20_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride) { -avc_luma_hz_16w_msa(src - 2, stride, dst, stride, 16); +uint32_t loop_cnt; +v16i8 src0, src1, src2, src3, src4, src5, src6, src7, mask0, mask1, mask2; +v16i8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7, vec8, vec9, vec10; +v16i8 vec11; +v8i16 res0, res1, res2, res3, res4, res5, res6, res7; +v16i8 minus5b = __msa_ldi_b(-5); +v16i8 plus20b = __msa_ldi_b(20); + +LD_SB3(_mask_arr[0], 16, mask0, mask1, mask2); +src -= 2; + +for (loop_cnt = 4; loop_cnt--;) { +LD_SB2(src, 8, src0, src1); +src += stride; +LD_SB2(src, 8, src2, src3); +src += stride; +LD_SB2(src, 8, src4, src5); +src += stride; +LD_SB2(src, 8, src6, src7); +src += stride; + +XORI_B8_128_SB(src0, src1, src2, src3, src4, src5, src6, src7); +VSHF_B2_SB(src0, src0, src1, src1, mask0, mask0, vec0, vec3); +VSHF_B2_SB(src2, src2, src3, src3, mask0, mask0, vec6, vec9); +VSHF_B2_SB(src0, src0, src1, src1, mask1, mask1, vec1, vec4); +VSHF_B2_SB(src2, src2, src3, src3, mask1, mask1, vec7, vec10); +VSHF_B2_SB(src0, src0, src1, src1, mask2, mask2, vec2, vec5); +VSHF_B2_SB(src2, src2, src3, src3, mask2, mask2, vec8, vec11); +HADD_SB4_SH(vec0, vec3, vec6, vec9, res0, res1, res2, res3); +DPADD_SB4_SH(vec1, vec4, vec7, vec10, minus5b, minus5b, minus5b, + minus5b, res0, res1, res2, res3); +DPADD_SB4_SH(vec2, vec5, vec8, vec11, plus20b, plus20b, plus20b, + plus20b, res0, res1, res2, res3); +VSHF_B2_SB(src4, src4, src5, src5, mask0, mask0, vec0, vec3); +VSHF_B2_SB(src6, src6, src7, src7, mask0, mask0, vec6, vec9); +VSHF_B2_SB(src4, src4, src5, src5, mask1, mask1, vec1, vec4); +VSHF_B2_SB(src6, src6, src7, src7, mask1, mask1, vec7, vec10); +VSHF_B2_SB(src4, src4, src5, src5, mask2, mask2, vec2, vec5); +VSHF_B2_SB(src6, src6, src7, src7, mask2, mask2, vec8, vec11); +HADD_SB4_SH(vec0, vec3, vec6, vec9, res4, res5, res6, res7); +DPADD_SB4_SH(vec1, vec4, vec7, vec10, minus5b, minus5b, minus5b, + minus5b, res4, res5, res6, res7); +DPADD_SB4_SH(vec2, vec5, vec8, vec11, plus20b, plus20b, plus20b, + plus20b, res4, res5, res6, res7); +SRARI_H4_SH(res0, res1, res2, res3, 5); +SRARI_H4_SH(res4, res5, res6, res7, 5); +SAT_SH4_SH(res0, res1, res2, res3, 7); +SAT_SH4_SH(res4, res5, res6, res7, 7); +PCKEV_B4_SB(res1, res0, res3, res2, res5, res4, res7, res6, vec0, vec1, +vec2, vec3); +XORI_B4_128_SB(vec0, vec1, vec2, vec3); +ST_SB4(vec0, vec1, vec2, vec3, dst, stride); +dst += (4 * stride); +} } void ff_put_h264_qpel8_mc20_msa(uint8_t *dst, const uint8_t *src,
[FFmpeg-cvslog] avcodec/mips: Removed generic function call in avc intra msa functions
ffmpeg | branch: master | Kaustubh Raste| Tue Sep 26 10:58:14 2017 +0530| [ed1586b921d72ac4231a3e92e41411563123845b] | committer: Michael Niedermayer avcodec/mips: Removed generic function call in avc intra msa functions Signed-off-by: Kaustubh Raste Reviewed-by: Manojkumar Bhosale Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ed1586b921d72ac4231a3e92e41411563123845b --- libavcodec/mips/h264pred_msa.c | 215 ++--- 1 file changed, 92 insertions(+), 123 deletions(-) diff --git a/libavcodec/mips/h264pred_msa.c b/libavcodec/mips/h264pred_msa.c index c297aec879..b9990c13f0 100644 --- a/libavcodec/mips/h264pred_msa.c +++ b/libavcodec/mips/h264pred_msa.c @@ -106,115 +106,6 @@ static void intra_predict_horiz_16x16_msa(uint8_t *src, int32_t src_stride, dst, dst_stride); } -static void intra_predict_dc_8x8_msa(uint8_t *src_top, uint8_t *src_left, - int32_t src_stride_left, - uint8_t *dst, int32_t dst_stride, - uint8_t is_above, uint8_t is_left) -{ -uint32_t row; -uint32_t out, addition = 0; -v16u8 src_above, store; -v8u16 sum_above; -v4u32 sum_top; -v2u64 sum; - -if (is_left && is_above) { -src_above = LD_UB(src_top); - -sum_above = __msa_hadd_u_h(src_above, src_above); -sum_top = __msa_hadd_u_w(sum_above, sum_above); -sum = __msa_hadd_u_d(sum_top, sum_top); -addition = __msa_copy_u_w((v4i32) sum, 0); - -for (row = 0; row < 8; row++) { -addition += src_left[row * src_stride_left]; -} - -addition = (addition + 8) >> 4; -store = (v16u8) __msa_fill_b(addition); -} else if (is_left) { -for (row = 0; row < 8; row++) { -addition += src_left[row * src_stride_left]; -} - -addition = (addition + 4) >> 3; -store = (v16u8) __msa_fill_b(addition); -} else if (is_above) { -src_above = LD_UB(src_top); - -sum_above = __msa_hadd_u_h(src_above, src_above); -sum_top = __msa_hadd_u_w(sum_above, sum_above); -sum = __msa_hadd_u_d(sum_top, sum_top); -sum = (v2u64) __msa_srari_d((v2i64) sum, 3); -store = (v16u8) __msa_splati_b((v16i8) sum, 0); -} else { -store = (v16u8) __msa_ldi_b(128); -} - -out = __msa_copy_u_w((v4i32) store, 0); - -for (row = 8; row--;) { -SW(out, dst); -SW(out, (dst + 4)); -dst += dst_stride; -} -} - -static void intra_predict_dc_16x16_msa(uint8_t *src_top, uint8_t *src_left, - int32_t src_stride_left, - uint8_t *dst, int32_t dst_stride, - uint8_t is_above, uint8_t is_left) -{ -uint32_t row; -uint32_t addition = 0; -v16u8 src_above, store; -v8u16 sum_above; -v4u32 sum_top; -v2u64 sum; - -if (is_left && is_above) { -src_above = LD_UB(src_top); - -sum_above = __msa_hadd_u_h(src_above, src_above); -sum_top = __msa_hadd_u_w(sum_above, sum_above); -sum = __msa_hadd_u_d(sum_top, sum_top); -sum_top = (v4u32) __msa_pckev_w((v4i32) sum, (v4i32) sum); -sum = __msa_hadd_u_d(sum_top, sum_top); -addition = __msa_copy_u_w((v4i32) sum, 0); - -for (row = 0; row < 16; row++) { -addition += src_left[row * src_stride_left]; -} - -addition = (addition + 16) >> 5; -store = (v16u8) __msa_fill_b(addition); -} else if (is_left) { -for (row = 0; row < 16; row++) { -addition += src_left[row * src_stride_left]; -} - -addition = (addition + 8) >> 4; -store = (v16u8) __msa_fill_b(addition); -} else if (is_above) { -src_above = LD_UB(src_top); - -sum_above = __msa_hadd_u_h(src_above, src_above); -sum_top = __msa_hadd_u_w(sum_above, sum_above); -sum = __msa_hadd_u_d(sum_top, sum_top); -sum_top = (v4u32) __msa_pckev_w((v4i32) sum, (v4i32) sum); -sum = __msa_hadd_u_d(sum_top, sum_top); -sum = (v2u64) __msa_srari_d((v2i64) sum, 4); -store = (v16u8) __msa_splati_b((v16i8) sum, 0); -} else { -store = (v16u8) __msa_ldi_b(128); -} - -for (row = 16; row--;) { -ST_UB(store, dst); -dst += dst_stride; -} -} - #define INTRA_PREDICT_VALDC_8X8_MSA(val) \ static void intra_predict_##val##dc_8x8_msa(uint8_t *dst, int32_t dst_stride) \ { \ @@ -646,8 +537,42 @@ void ff_h264_intra_pred_dc_16x16_msa(uint8_t *src, ptrdiff_t stride) uint8_t *src_top = src - stride;
[FFmpeg-cvslog] avcodec/mips: Improve avc weighted mc msa functions
ffmpeg | branch: master | Kaustubh Raste| Tue Sep 26 11:09:12 2017 +0530| [10ab5534e0438cb3bcbf43852010c67b0063f204] | committer: Michael Niedermayer avcodec/mips: Improve avc weighted mc msa functions Replace generic with block size specific function. Signed-off-by: Kaustubh Raste Reviewed-by: Manojkumar Bhosale Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=10ab5534e0438cb3bcbf43852010c67b0063f204 --- libavcodec/mips/h264dsp_msa.c | 423 +++- libavutil/mips/generic_macros_msa.h | 36 +++ 2 files changed, 306 insertions(+), 153 deletions(-) diff --git a/libavcodec/mips/h264dsp_msa.c b/libavcodec/mips/h264dsp_msa.c index 422703d03d..5b06bd934b 100644 --- a/libavcodec/mips/h264dsp_msa.c +++ b/libavcodec/mips/h264dsp_msa.c @@ -25,187 +25,201 @@ static void avc_wgt_4x2_msa(uint8_t *data, int32_t stride, int32_t log2_denom, int32_t src_weight, int32_t offset_in) { -uint32_t data0, data1; +uint32_t tp0, tp1, offset_val; v16u8 zero = { 0 }; -v16u8 src0, src1; -v4i32 res0, res1; -v8i16 temp0, temp1, vec0, vec1, wgt, denom, offset; -v8u16 out0, out1; +v16u8 src0 = { 0 }; +v8i16 src0_r, tmp0, wgt, denom, offset; -offset_in <<= (log2_denom); - -if (log2_denom) { -offset_in += (1 << (log2_denom - 1)); -} +offset_val = (unsigned) offset_in << log2_denom; wgt = __msa_fill_h(src_weight); -offset = __msa_fill_h(offset_in); +offset = __msa_fill_h(offset_val); denom = __msa_fill_h(log2_denom); -data0 = LW(data); -data1 = LW(data + stride); - -src0 = (v16u8) __msa_fill_w(data0); -src1 = (v16u8) __msa_fill_w(data1); +LW2(data, stride, tp0, tp1); +INSERT_W2_UB(tp0, tp1, src0); +src0_r = (v8i16) __msa_ilvr_b((v16i8) zero, (v16i8) src0); +tmp0 = wgt * src0_r; +tmp0 = __msa_adds_s_h(tmp0, offset); +tmp0 = __msa_maxi_s_h(tmp0, 0); +tmp0 = __msa_srlr_h(tmp0, denom); +tmp0 = (v8i16) __msa_sat_u_h((v8u16) tmp0, 7); +src0 = (v16u8) __msa_pckev_b((v16i8) tmp0, (v16i8) tmp0); +ST4x2_UB(src0, data, stride); +} -ILVR_B2_SH(zero, src0, zero, src1, vec0, vec1); -MUL2(wgt, vec0, wgt, vec1, temp0, temp1); -ADDS_SH2_SH(temp0, offset, temp1, offset, temp0, temp1); -MAXI_SH2_SH(temp0, temp1, 0); +static void avc_wgt_4x4_msa(uint8_t *data, int32_t stride, int32_t log2_denom, +int32_t src_weight, int32_t offset_in) +{ +uint32_t tp0, tp1, tp2, tp3, offset_val; +v16u8 src0 = { 0 }; +v8i16 src0_r, src1_r, tmp0, tmp1, wgt, denom, offset; -out0 = (v8u16) __msa_srl_h(temp0, denom); -out1 = (v8u16) __msa_srl_h(temp1, denom); +offset_val = (unsigned) offset_in << log2_denom; -SAT_UH2_UH(out0, out1, 7); -PCKEV_B2_SW(out0, out0, out1, out1, res0, res1); +wgt = __msa_fill_h(src_weight); +offset = __msa_fill_h(offset_val); +denom = __msa_fill_h(log2_denom); -data0 = __msa_copy_u_w(res0, 0); -data1 = __msa_copy_u_w(res1, 0); -SW(data0, data); -data += stride; -SW(data1, data); +LW4(data, stride, tp0, tp1, tp2, tp3); +INSERT_W4_UB(tp0, tp1, tp2, tp3, src0); +UNPCK_UB_SH(src0, src0_r, src1_r); +MUL2(wgt, src0_r, wgt, src1_r, tmp0, tmp1); +ADDS_SH2_SH(tmp0, offset, tmp1, offset, tmp0, tmp1); +MAXI_SH2_SH(tmp0, tmp1, 0); +tmp0 = __msa_srlr_h(tmp0, denom); +tmp1 = __msa_srlr_h(tmp1, denom); +SAT_UH2_SH(tmp0, tmp1, 7); +src0 = (v16u8) __msa_pckev_b((v16i8) tmp1, (v16i8) tmp0); +ST4x4_UB(src0, src0, 0, 1, 2, 3, data, stride); } -static void avc_wgt_4x4multiple_msa(uint8_t *data, int32_t stride, -int32_t height, int32_t log2_denom, -int32_t src_weight, int32_t offset_in) +static void avc_wgt_4x8_msa(uint8_t *data, int32_t stride, int32_t log2_denom, +int32_t src_weight, int32_t offset_in) { -uint8_t cnt; -uint32_t data0, data1, data2, data3; -v16u8 zero = { 0 }; -v16u8 src0, src1, src2, src3; -v8u16 temp0, temp1, temp2, temp3, wgt; -v8i16 denom, offset; +uint32_t tp0, tp1, tp2, tp3, offset_val; +v16u8 src0 = { 0 }, src1 = { 0 }; +v8i16 src0_r, src1_r, src2_r, src3_r, tmp0, tmp1, tmp2, tmp3; +v8i16 wgt, denom, offset; -offset_in <<= (log2_denom); +offset_val = (unsigned) offset_in << log2_denom; -if (log2_denom) { -offset_in += (1 << (log2_denom - 1)); -} - -wgt = (v8u16) __msa_fill_h(src_weight); -offset = __msa_fill_h(offset_in); +wgt = __msa_fill_h(src_weight); +offset = __msa_fill_h(offset_val); denom = __msa_fill_h(log2_denom); -for (cnt = height / 4; cnt--;) { -LW4(data, stride, data0, data1, data2,
[FFmpeg-cvslog] avcodec/mips: preload data in hevc sao edge 45 degree filter msa functions
ffmpeg | branch: master | Kaustubh Raste| Mon Sep 25 18:26:35 2017 +0530| [deeaaba1ab1e7476ef8c9e17851eb6bf49d69682] | committer: Michael Niedermayer avcodec/mips: preload data in hevc sao edge 45 degree filter msa functions Signed-off-by: Kaustubh Raste Reviewed-by: Manojkumar Bhosale Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=deeaaba1ab1e7476ef8c9e17851eb6bf49d69682 --- libavcodec/mips/hevc_lpf_sao_msa.c | 197 + 1 file changed, 135 insertions(+), 62 deletions(-) diff --git a/libavcodec/mips/hevc_lpf_sao_msa.c b/libavcodec/mips/hevc_lpf_sao_msa.c index 39c647ed79..c192265e85 100644 --- a/libavcodec/mips/hevc_lpf_sao_msa.c +++ b/libavcodec/mips/hevc_lpf_sao_msa.c @@ -1878,23 +1878,25 @@ static void hevc_sao_edge_filter_45degree_4width_msa(uint8_t *dst, int32_t height) { uint8_t *src_orig; -int32_t h_cnt; uint32_t dst_val0, dst_val1; -v8i16 edge_idx = { 1, 2, 0, 3, 4, 0, 0, 0 }; +v16i8 edge_idx = { 1, 2, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; v16u8 const1 = (v16u8) __msa_ldi_b(1); -v16i8 zero = { 0 }; +v16i8 offset, sao_offset = LD_SB(sao_offset_val); v16u8 cmp_minus10, diff_minus10, src_minus10, cmp_minus11, diff_minus11; v16u8 src_minus11, src10, src11; v16i8 src_plus0, src_zero0, src_plus1, src_zero1, dst0; -v8i16 sao_offset, src00, src01, offset_mask0, offset_mask1; +v8i16 offset_mask0, offset_mask1; -sao_offset = LD_SH(sao_offset_val); +sao_offset = __msa_pckev_b(sao_offset, sao_offset); src_orig = src - 1; + +/* load in advance */ LD_UB2(src_orig - src_stride, src_stride, src_minus10, src_minus11); +LD_UB2(src_orig + src_stride, src_stride, src10, src11); -for (h_cnt = (height >> 1); h_cnt--;) { -LD_UB2(src_orig + src_stride, src_stride, src10, src11); +for (height -= 2; height; height -= 2) { +src_orig += (src_stride << 1); SLDI_B2_0_SB(src_minus11, src10, src_zero0, src_zero1, 1); SLDI_B2_0_SB(src10, src11, src_plus0, src_plus1, 2); @@ -1917,20 +1919,22 @@ static void hevc_sao_edge_filter_45degree_4width_msa(uint8_t *dst, offset_mask0 = (v8i16) (__msa_hadd_u_h(diff_minus10, diff_minus10) + 2); offset_mask1 = (v8i16) (__msa_hadd_u_h(diff_minus11, diff_minus11) + 2); -VSHF_H2_SH(edge_idx, edge_idx, sao_offset, sao_offset, offset_mask0, - offset_mask0, offset_mask0, offset_mask0); -VSHF_H2_SH(edge_idx, edge_idx, sao_offset, sao_offset, offset_mask1, - offset_mask1, offset_mask1, offset_mask1); -ILVEV_B2_SH(src_zero0, zero, src_zero1, zero, src00, src01); -ADD2(offset_mask0, src00, offset_mask1, src01, offset_mask0, - offset_mask1); -CLIP_SH2_0_255(offset_mask0, offset_mask1); +offset = __msa_pckev_b((v16i8) offset_mask1, (v16i8) offset_mask0); +dst0 = __msa_pckev_b((v16i8) src_zero1, (v16i8) src_zero0); -dst0 = __msa_pckev_b((v16i8) offset_mask1, (v16i8) offset_mask0); +VSHF_B2_SB(edge_idx, edge_idx, sao_offset, sao_offset, offset, + offset, offset, offset); + +dst0 = (v16i8) __msa_xori_b((v16u8) dst0, 128); +dst0 = __msa_adds_s_b(dst0, offset); +dst0 = (v16i8) __msa_xori_b((v16u8) dst0, 128); src_minus10 = src10; src_minus11 = src11; +/* load in advance */ +LD_UB2(src_orig + src_stride, src_stride, src10, src11); + dst_val0 = __msa_copy_u_w((v4i32) dst0, 0); dst_val1 = __msa_copy_u_w((v4i32) dst0, 2); SW(dst_val0, dst); @@ -1938,8 +1942,44 @@ static void hevc_sao_edge_filter_45degree_4width_msa(uint8_t *dst, SW(dst_val1, dst); dst += dst_stride; -src_orig += (src_stride << 1); } + +SLDI_B2_0_SB(src_minus11, src10, src_zero0, src_zero1, 1); +SLDI_B2_0_SB(src10, src11, src_plus0, src_plus1, 2); + +ILVR_B2_UB(src_plus0, src_minus10, src_plus1, src_minus11, src_minus10, + src_minus11); +ILVR_B2_SB(src_zero0, src_zero0, src_zero1, src_zero1, src_zero0, + src_zero1); + +cmp_minus10 = ((v16u8) src_zero0 == src_minus10); +diff_minus10 = __msa_nor_v(cmp_minus10, cmp_minus10); +cmp_minus10 = (src_minus10 < (v16u8) src_zero0); +diff_minus10 = __msa_bmnz_v(diff_minus10, const1, cmp_minus10); + +cmp_minus11 = ((v16u8) src_zero1 == src_minus11); +diff_minus11 = __msa_nor_v(cmp_minus11, cmp_minus11); +cmp_minus11 = (src_minus11 < (v16u8) src_zero1); +diff_minus11 = __msa_bmnz_v(diff_minus11, const1, cmp_minus11); + +offset_mask0 = (v8i16) (__msa_hadd_u_h(diff_minus10, diff_minus10) + 2); +offset_mask1 = (v8i16) (__msa_hadd_u_h(diff_minus11,
[FFmpeg-cvslog] Revert "Merge commit 'a97563c889fefd81ad6b3758471434d8c2e2e550'"
ffmpeg | branch: master | James Almer| Wed Sep 27 15:01:58 2017 -0300| [55cc0bccf357ca13d124472822477c172cd06336] | committer: James Almer Revert "Merge commit 'a97563c889fefd81ad6b3758471434d8c2e2e550'" This reverts commit 1985071e41f4df8fc693a564e25758676bba164a, reversing changes made to a901869c19ed14c7d3647901468bd1297c9f98c0. We autodetect libxcb, so this is not necessary. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=55cc0bccf357ca13d124472822477c172cd06336 --- configure | 1 - 1 file changed, 1 deletion(-) diff --git a/configure b/configure index a168feea23..a4baeb3b2a 100755 --- a/configure +++ b/configure @@ -3101,7 +3101,6 @@ v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h" v4l2_outdev_deps_any="linux_videodev2_h sys_videoio_h" vfwcap_indev_deps="vfw32 vfwcap_defines" xcbgrab_indev_deps="libxcb" -xcbgrab_indev_suggest="libxcb_shm libxcb_shape libxcb_xfixes" xv_outdev_deps="X11_extensions_Xvlib_h XvGetPortAttribute" xv_outdev_extralibs="-lXv -lX11 -lXext" ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavf/version: Bump minor after dv1394 removal.
ffmpeg | branch: master | Carl Eugen Hoyos| Wed Sep 27 19:48:26 2017 +0200| [dc522cfa07896239d737e9fa37ee4163bce7f0d0] | committer: Carl Eugen Hoyos lavf/version: Bump minor after dv1394 removal. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dc522cfa07896239d737e9fa37ee4163bce7f0d0 --- libavdevice/version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavdevice/version.h b/libavdevice/version.h index 358b6ff969..da43e55c32 100644 --- a/libavdevice/version.h +++ b/libavdevice/version.h @@ -28,8 +28,8 @@ #include "libavutil/version.h" #define LIBAVDEVICE_VERSION_MAJOR 57 -#define LIBAVDEVICE_VERSION_MINOR 8 -#define LIBAVDEVICE_VERSION_MICRO 101 +#define LIBAVDEVICE_VERSION_MINOR 9 +#define LIBAVDEVICE_VERSION_MICRO 100 #define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \ LIBAVDEVICE_VERSION_MINOR, \ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavd: remove deprecated dv1394 device
ffmpeg | branch: master | Josh de Kock| Tue Sep 26 15:49:18 2017 +0100| [56d2154b72fba96a65b806ecf4a6f85c3f69b021] | committer: Josh de Kock lavd: remove deprecated dv1394 device Support for this device has been removed in kernel since v2.6.37. dv1394 has been superseded by libiec61883 which is functionally equivalent. Signed-off-by: Josh de Kock Signed-off-by: wm4 > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=56d2154b72fba96a65b806ecf4a6f85c3f69b021 --- configure| 3 - doc/indevs.texi | 25 libavdevice/Makefile | 1 - libavdevice/alldevices.c | 1 - libavdevice/dv1394.c | 239 --- libavdevice/dv1394.h | 357 --- 6 files changed, 626 deletions(-) diff --git a/configure b/configure index 2cd727ea2f..a168feea23 100755 --- a/configure +++ b/configure @@ -3075,8 +3075,6 @@ libndi_newtek_outdev_deps="libndi_newtek" libndi_newtek_outdev_extralibs="-lndi" dshow_indev_deps="IBaseFilter" dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid -loleaut32 -lshlwapi" -dv1394_indev_deps="dv1394" -dv1394_indev_select="dv_demuxer" fbdev_indev_deps="linux_fb_h" fbdev_outdev_deps="linux_fb_h" gdigrab_indev_deps="CreateDIBSection" @@ -5062,7 +5060,6 @@ case $target_os in add_cppflags -U__STRICT_ANSI__ ;; linux) -enable dv1394 enable section_data_rel_ro enabled_any arm aarch64 && enable_weak linux_perf ;; diff --git a/doc/indevs.texi b/doc/indevs.texi index 30b7ac2380..776e563160 100644 --- a/doc/indevs.texi +++ b/doc/indevs.texi @@ -641,31 +641,6 @@ $ ffmpeg -f dshow -show_video_device_dialog true -crossbar_video_input_pin_numbe @end itemize -@section dv1394 - -Linux DV 1394 input device. - -@subsection Options - -@table @option - -@item framerate -Set the frame rate. Default is 25. - -@item standard - -Available values are: -@table @samp -@item pal - -@item ntsc - -@end table - -Default value is @code{ntsc}. - -@end table - @section fbdev Linux framebuffer input device. diff --git a/libavdevice/Makefile b/libavdevice/Makefile index f40f4d5298..8228d62147 100644 --- a/libavdevice/Makefile +++ b/libavdevice/Makefile @@ -24,7 +24,6 @@ OBJS-$(CONFIG_LIBNDI_NEWTEK_INDEV) += libndi_newtek_dec.o OBJS-$(CONFIG_DSHOW_INDEV) += dshow_crossbar.o dshow.o dshow_enummediatypes.o \ dshow_enumpins.o dshow_filter.o \ dshow_pin.o dshow_common.o -OBJS-$(CONFIG_DV1394_INDEV) += dv1394.o OBJS-$(CONFIG_FBDEV_INDEV) += fbdev_dec.o \ fbdev_common.o OBJS-$(CONFIG_FBDEV_OUTDEV) += fbdev_enc.o \ diff --git a/libavdevice/alldevices.c b/libavdevice/alldevices.c index b31558bcb5..b767b6a718 100644 --- a/libavdevice/alldevices.c +++ b/libavdevice/alldevices.c @@ -48,7 +48,6 @@ static void register_all(void) REGISTER_INOUTDEV(DECKLINK, decklink); REGISTER_INOUTDEV(LIBNDI_NEWTEK,libndi_newtek); REGISTER_INDEV (DSHOW,dshow); -REGISTER_INDEV (DV1394, dv1394); REGISTER_INOUTDEV(FBDEV,fbdev); REGISTER_INDEV (GDIGRAB, gdigrab); REGISTER_INDEV (IEC61883, iec61883); diff --git a/libavdevice/dv1394.c b/libavdevice/dv1394.c deleted file mode 100644 index c3483010fa..00 --- a/libavdevice/dv1394.c +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Linux DV1394 interface - * Copyright (c) 2003 Max Krasnyansky - * - * 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 "config.h" -#include -#include -#include -#include -#include -#include - -#include "libavutil/internal.h" -#include "libavutil/log.h" -#include "libavutil/opt.h" -#include "avdevice.h" -#include "libavformat/dv.h" -#include "dv1394.h" - -struct dv1394_data { -AVClass *class; -int fd; -int channel; -int format; - -uint8_t *ring; /* Ring buffer */ -int index; /* Current frame index */ -int avail; /* Number of frames available for reading */ -int done;