[FFmpeg-cvslog] avcodec/shorten: properly handle bitshift > 31
ffmpeg | branch: master | Paul B Mahol | Mon Apr 11 13:06:10 2016 +0200| [b62ed56e25c8894a39352c82c7dadd2ebb9191f9] | committer: Paul B Mahol avcodec/shorten: properly handle bitshift > 31 Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b62ed56e25c8894a39352c82c7dadd2ebb9191f9 --- libavcodec/shorten.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c index b3b6d2a..061a74b 100644 --- a/libavcodec/shorten.c +++ b/libavcodec/shorten.c @@ -164,9 +164,13 @@ static void fix_bitshift(ShortenContext *s, int32_t *buffer) { int i; -if (s->bitshift != 0) +if (s->bitshift == 32) { +for (i = 0; i < s->blocksize; i++) +buffer[i] = 0; +} else if (s->bitshift != 0) { for (i = 0; i < s->blocksize; i++) buffer[i] <<= s->bitshift; +} } static int init_offset(ShortenContext *s) @@ -602,7 +606,7 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data, break; case FN_BITSHIFT: { unsigned bitshift = get_ur_golomb_shorten(&s->gb, BITSHIFTSIZE); -if (bitshift > 31) { +if (bitshift > 32) { av_log(avctx, AV_LOG_ERROR, "bitshift %d is invalid\n", bitshift); return AVERROR_INVALIDDATA; @@ -680,7 +684,7 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data, if (s->version < 2) s->offset[channel][s->nmean - 1] = sum / s->blocksize; else -s->offset[channel][s->nmean - 1] = (sum / s->blocksize) << s->bitshift; +s->offset[channel][s->nmean - 1] = s->bitshift == 32 ? 0 : (sum / s->blocksize) << s->bitshift; } /* copy wrap samples for use with next block */ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '9897d9f4e074cdc6c7f2409885ddefe300f18dc7'
ffmpeg | branch: master | Derek Buitenhuis | Mon Apr 11 14:06:43 2016 +0100| [d76972b58156fc09d0caf26d4bd6462c22be51f1] | committer: Derek Buitenhuis Merge commit '9897d9f4e074cdc6c7f2409885ddefe300f18dc7' * commit '9897d9f4e074cdc6c7f2409885ddefe300f18dc7': examples/output: convert to codecpar Merged-by: Derek Buitenhuis > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d76972b58156fc09d0caf26d4bd6462c22be51f1 --- doc/examples/muxing.c | 46 +- 1 file changed, 33 insertions(+), 13 deletions(-) diff --git a/doc/examples/muxing.c b/doc/examples/muxing.c index d4dac5c..2fbc89b 100644 --- a/doc/examples/muxing.c +++ b/doc/examples/muxing.c @@ -52,6 +52,7 @@ // a wrapper around a single output AVStream typedef struct OutputStream { AVStream *st; +AVCodecContext *enc; /* pts of the next frame that will be generated */ int64_t next_pts; @@ -104,13 +105,18 @@ static void add_stream(OutputStream *ost, AVFormatContext *oc, exit(1); } -ost->st = avformat_new_stream(oc, *codec); +ost->st = avformat_new_stream(oc, NULL); if (!ost->st) { fprintf(stderr, "Could not allocate stream\n"); exit(1); } ost->st->id = oc->nb_streams-1; -c = ost->st->codec; +c = avcodec_alloc_context3(*codec); +if (!c) { +fprintf(stderr, "Could not alloc an encoding context\n"); +exit(1); +} +ost->enc = c; switch ((*codec)->type) { case AVMEDIA_TYPE_AUDIO: @@ -213,7 +219,7 @@ static void open_audio(AVFormatContext *oc, AVCodec *codec, OutputStream *ost, A int ret; AVDictionary *opt = NULL; -c = ost->st->codec; +c = ost->enc; /* open it */ av_dict_copy(&opt, opt_arg, 0); @@ -240,6 +246,13 @@ static void open_audio(AVFormatContext *oc, AVCodec *codec, OutputStream *ost, A ost->tmp_frame = alloc_audio_frame(AV_SAMPLE_FMT_S16, c->channel_layout, c->sample_rate, nb_samples); +/* copy the stream parameters to the muxer */ +ret = avcodec_parameters_from_context(ost->st->codecpar, c); +if (ret < 0) { +fprintf(stderr, "Could not copy the stream parameters\n"); +exit(1); +} + /* create resampler context */ ost->swr_ctx = swr_alloc(); if (!ost->swr_ctx) { @@ -271,13 +284,13 @@ static AVFrame *get_audio_frame(OutputStream *ost) int16_t *q = (int16_t*)frame->data[0]; /* check if we want to generate more frames */ -if (av_compare_ts(ost->next_pts, ost->st->codec->time_base, +if (av_compare_ts(ost->next_pts, ost->enc->time_base, STREAM_DURATION, (AVRational){ 1, 1 }) >= 0) return NULL; for (j = 0; j nb_samples; j++) { v = (int)(sin(ost->t) * 1); -for (i = 0; i < ost->st->codec->channels; i++) +for (i = 0; i < ost->enc->channels; i++) *q++ = v; ost->t += ost->tincr; ost->tincr += ost->tincr2; @@ -303,7 +316,7 @@ static int write_audio_frame(AVFormatContext *oc, OutputStream *ost) int dst_nb_samples; av_init_packet(&pkt); -c = ost->st->codec; +c = ost->enc; frame = get_audio_frame(ost); @@ -383,7 +396,7 @@ static AVFrame *alloc_picture(enum AVPixelFormat pix_fmt, int width, int height) static void open_video(AVFormatContext *oc, AVCodec *codec, OutputStream *ost, AVDictionary *opt_arg) { int ret; -AVCodecContext *c = ost->st->codec; +AVCodecContext *c = ost->enc; AVDictionary *opt = NULL; av_dict_copy(&opt, opt_arg, 0); @@ -414,6 +427,13 @@ static void open_video(AVFormatContext *oc, AVCodec *codec, OutputStream *ost, A exit(1); } } + +/* copy the stream parameters to the muxer */ +ret = avcodec_parameters_from_context(ost->st->codecpar, c); +if (ret < 0) { +fprintf(stderr, "Could not copy the stream parameters\n"); +exit(1); +} } /* Prepare a dummy image. */ @@ -448,10 +468,10 @@ static void fill_yuv_image(AVFrame *pict, int frame_index, static AVFrame *get_video_frame(OutputStream *ost) { -AVCodecContext *c = ost->st->codec; +AVCodecContext *c = ost->enc; /* check if we want to generate more frames */ -if (av_compare_ts(ost->next_pts, ost->st->codec->time_base, +if (av_compare_ts(ost->next_pts, c->time_base, STREAM_DURATION, (AVRational){ 1, 1 }) >= 0) return NULL; @@ -495,7 +515,7 @@ static int write_video_frame(AVFormatContext *oc, OutputStream *ost) int got_packet = 0; AVPacket pkt = { 0 }; -c = ost->st->codec; +c = ost->enc; frame = get_video_frame(ost); @@ -524,7 +544,7 @@ static int write_video_frame(AVFormatContext *oc, OutputStream *ost) static void close_stream(AVFormatContext *oc, OutputStream *ost) { -avcodec_close(ost->st->codec); +avcodec_free_context(&ost->enc); av_frame
[FFmpeg-cvslog] examples/output: convert to codecpar
ffmpeg | branch: master | Anton Khirnov | Wed Feb 10 14:13:39 2016 +0100| [9897d9f4e074cdc6c7f2409885ddefe300f18dc7] | committer: Anton Khirnov examples/output: convert to codecpar > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9897d9f4e074cdc6c7f2409885ddefe300f18dc7 --- doc/examples/output.c | 60 +++-- 1 file changed, 43 insertions(+), 17 deletions(-) diff --git a/doc/examples/output.c b/doc/examples/output.c index c883429..cc2cbb1 100644 --- a/doc/examples/output.c +++ b/doc/examples/output.c @@ -52,6 +52,7 @@ // a wrapper around a single output AVStream typedef struct OutputStream { AVStream *st; +AVCodecContext *enc; /* pts of the next frame that will be generated */ int64_t next_pts; @@ -85,13 +86,18 @@ static void add_audio_stream(OutputStream *ost, AVFormatContext *oc, exit(1); } -ost->st = avformat_new_stream(oc, codec); +ost->st = avformat_new_stream(oc, NULL); if (!ost->st) { fprintf(stderr, "Could not alloc stream\n"); exit(1); } -c = ost->st->codec; +c = avcodec_alloc_context3(codec); +if (!c) { +fprintf(stderr, "Could not alloc an encoding context\n"); +exit(1); +} +ost->enc = c; /* put sample parameters */ c->sample_fmt = codec->sample_fmts ? codec->sample_fmts[0] : AV_SAMPLE_FMT_S16; @@ -162,9 +168,9 @@ static AVFrame *alloc_audio_frame(enum AVSampleFormat sample_fmt, static void open_audio(AVFormatContext *oc, OutputStream *ost) { AVCodecContext *c; -int nb_samples; +int nb_samples, ret; -c = ost->st->codec; +c = ost->enc; /* open it */ if (avcodec_open2(c, NULL, NULL) < 0) { @@ -187,6 +193,13 @@ static void open_audio(AVFormatContext *oc, OutputStream *ost) c->sample_rate, nb_samples); ost->tmp_frame = alloc_audio_frame(AV_SAMPLE_FMT_S16, AV_CH_LAYOUT_STEREO, 44100, nb_samples); + +/* copy the stream parameters to the muxer */ +ret = avcodec_parameters_from_context(ost->st->codecpar, c); +if (ret < 0) { +fprintf(stderr, "Could not copy the stream parameters\n"); +exit(1); +} } /* Prepare a 16 bit dummy audio frame of 'frame_size' samples and @@ -198,14 +211,14 @@ static AVFrame *get_audio_frame(OutputStream *ost) int16_t *q = (int16_t*)frame->data[0]; /* check if we want to generate more frames */ -if (av_compare_ts(ost->next_pts, ost->st->codec->time_base, +if (av_compare_ts(ost->next_pts, ost->enc->time_base, STREAM_DURATION, (AVRational){ 1, 1 }) >= 0) return NULL; for (j = 0; j < frame->nb_samples; j++) { v = (int)(sin(ost->t) * 1); -for (i = 0; i < ost->st->codec->channels; i++) +for (i = 0; i < ost->enc->channels; i++) *q++ = v; ost->t += ost->tincr; ost->tincr += ost->tincr2; @@ -224,12 +237,12 @@ static int encode_audio_frame(AVFormatContext *oc, OutputStream *ost, int got_packet; av_init_packet(&pkt); -avcodec_encode_audio2(ost->st->codec, &pkt, frame, &got_packet); +avcodec_encode_audio2(ost->enc, &pkt, frame, &got_packet); if (got_packet) { pkt.stream_index = ost->st->index; -av_packet_rescale_ts(&pkt, ost->st->codec->time_base, ost->st->time_base); +av_packet_rescale_ts(&pkt, ost->enc->time_base, ost->st->time_base); /* Write the compressed frame to the media file. */ if (av_interleaved_write_frame(oc, &pkt) != 0) { @@ -324,13 +337,18 @@ static void add_video_stream(OutputStream *ost, AVFormatContext *oc, exit(1); } -ost->st = avformat_new_stream(oc, codec); +ost->st = avformat_new_stream(oc, NULL); if (!ost->st) { fprintf(stderr, "Could not alloc stream\n"); exit(1); } -c = ost->st->codec; +c = avcodec_alloc_context3(codec); +if (!c) { +fprintf(stderr, "Could not alloc an encoding context\n"); +exit(1); +} +ost->enc = c; /* Put sample parameters. */ c->bit_rate = 40; @@ -387,8 +405,9 @@ static AVFrame *alloc_picture(enum AVPixelFormat pix_fmt, int width, int height) static void open_video(AVFormatContext *oc, OutputStream *ost) { AVCodecContext *c; +int ret; -c = ost->st->codec; +c = ost->enc; /* open the codec */ if (avcodec_open2(c, NULL, NULL) < 0) { @@ -414,6 +433,13 @@ static void open_video(AVFormatContext *oc, OutputStream *ost) exit(1); } } + +/* copy the stream parameters to the muxer */ +ret = avcodec_parameters_from_context(ost->st->codecpar, c); +if (ret < 0) { +fprintf(stderr, "Could not copy the stream parameters\n"); +exit(1); +} } /* Prepare a dummy image. */ @@ -448,10 +474,10 @@ static vo
[FFmpeg-cvslog] Merge commit 'a9e1f2cc61cbd5606a087a60565e87923c39de5a'
ffmpeg | branch: master | Derek Buitenhuis | Mon Apr 11 14:07:34 2016 +0100| [030e69b4dcb92f3b0372c9af1cefba60e9135010] | committer: Derek Buitenhuis Merge commit 'a9e1f2cc61cbd5606a087a60565e87923c39de5a' * commit 'a9e1f2cc61cbd5606a087a60565e87923c39de5a': examples/qsvdec: convert to codecpar Merged-by: Derek Buitenhuis > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=030e69b4dcb92f3b0372c9af1cefba60e9135010 --- doc/examples/qsvdec.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/examples/qsvdec.c b/doc/examples/qsvdec.c index fd934be..aaecd81 100644 --- a/doc/examples/qsvdec.c +++ b/doc/examples/qsvdec.c @@ -352,7 +352,7 @@ int main(int argc, char **argv) for (i = 0; i < input_ctx->nb_streams; i++) { AVStream *st = input_ctx->streams[i]; -if (st->codec->codec_id == AV_CODEC_ID_H264 && !video_st) +if (st->codecpar->codec_id == AV_CODEC_ID_H264 && !video_st) video_st = st; else st->discard = AVDISCARD_ALL; @@ -404,16 +404,16 @@ int main(int argc, char **argv) goto finish; } decoder_ctx->codec_id = AV_CODEC_ID_H264; -if (video_st->codec->extradata_size) { -decoder_ctx->extradata = av_mallocz(video_st->codec->extradata_size + +if (video_st->codecpar->extradata_size) { +decoder_ctx->extradata = av_mallocz(video_st->codecpar->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE); if (!decoder_ctx->extradata) { ret = AVERROR(ENOMEM); goto finish; } -memcpy(decoder_ctx->extradata, video_st->codec->extradata, - video_st->codec->extradata_size); -decoder_ctx->extradata_size = video_st->codec->extradata_size; +memcpy(decoder_ctx->extradata, video_st->codecpar->extradata, + video_st->codecpar->extradata_size); +decoder_ctx->extradata_size = video_st->codecpar->extradata_size; } decoder_ctx->refcounted_frames = 1; == ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] examples/qsvdec: convert to codecpar
ffmpeg | branch: master | Anton Khirnov | Wed Feb 10 14:17:21 2016 +0100| [a9e1f2cc61cbd5606a087a60565e87923c39de5a] | committer: Anton Khirnov examples/qsvdec: convert to codecpar > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a9e1f2cc61cbd5606a087a60565e87923c39de5a --- doc/examples/qsvdec.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/examples/qsvdec.c b/doc/examples/qsvdec.c index fd934be..aaecd81 100644 --- a/doc/examples/qsvdec.c +++ b/doc/examples/qsvdec.c @@ -352,7 +352,7 @@ int main(int argc, char **argv) for (i = 0; i < input_ctx->nb_streams; i++) { AVStream *st = input_ctx->streams[i]; -if (st->codec->codec_id == AV_CODEC_ID_H264 && !video_st) +if (st->codecpar->codec_id == AV_CODEC_ID_H264 && !video_st) video_st = st; else st->discard = AVDISCARD_ALL; @@ -404,16 +404,16 @@ int main(int argc, char **argv) goto finish; } decoder_ctx->codec_id = AV_CODEC_ID_H264; -if (video_st->codec->extradata_size) { -decoder_ctx->extradata = av_mallocz(video_st->codec->extradata_size + +if (video_st->codecpar->extradata_size) { +decoder_ctx->extradata = av_mallocz(video_st->codecpar->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE); if (!decoder_ctx->extradata) { ret = AVERROR(ENOMEM); goto finish; } -memcpy(decoder_ctx->extradata, video_st->codec->extradata, - video_st->codec->extradata_size); -decoder_ctx->extradata_size = video_st->codec->extradata_size; +memcpy(decoder_ctx->extradata, video_st->codecpar->extradata, + video_st->codecpar->extradata_size); +decoder_ctx->extradata_size = video_st->codecpar->extradata_size; } decoder_ctx->refcounted_frames = 1; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'ac6d53589f3631ae08467c784fb371a15c957f01'
ffmpeg | branch: master | Derek Buitenhuis | Mon Apr 11 14:15:28 2016 +0100| [6bc5ef37cbf6628dd4f4c9dae9d8b3009fc81408] | committer: Derek Buitenhuis Merge commit 'ac6d53589f3631ae08467c784fb371a15c957f01' * commit 'ac6d53589f3631ae08467c784fb371a15c957f01': examples/transcode_aac: convert to codecpar Merged-by: Derek Buitenhuis > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6bc5ef37cbf6628dd4f4c9dae9d8b3009fc81408 --- doc/examples/transcode_aac.c | 66 +++--- 1 file changed, 49 insertions(+), 17 deletions(-) diff --git a/doc/examples/transcode_aac.c b/doc/examples/transcode_aac.c index 486e54c..9b3ee67 100644 --- a/doc/examples/transcode_aac.c +++ b/doc/examples/transcode_aac.c @@ -62,6 +62,7 @@ static int open_input_file(const char *filename, AVFormatContext **input_format_context, AVCodecContext **input_codec_context) { +AVCodecContext *avctx; AVCodec *input_codec; int error; @@ -91,23 +92,39 @@ static int open_input_file(const char *filename, } /** Find a decoder for the audio stream. */ -if (!(input_codec = avcodec_find_decoder((*input_format_context)->streams[0]->codec->codec_id))) { +if (!(input_codec = avcodec_find_decoder((*input_format_context)->streams[0]->codecpar->codec_id))) { fprintf(stderr, "Could not find input codec\n"); avformat_close_input(input_format_context); return AVERROR_EXIT; } +/** allocate a new decoding context */ +avctx = avcodec_alloc_context3(input_codec); +if (!avctx) { +fprintf(stderr, "Could not allocate a decoding context\n"); +avformat_close_input(input_format_context); +return AVERROR(ENOMEM); +} + +/** initialize the stream parameters with demuxer information */ +error = avcodec_parameters_to_context(avctx, (*input_format_context)->streams[0]->codecpar); +if (error < 0) { +avformat_close_input(input_format_context); +avcodec_free_context(&avctx); +return error; +} + /** Open the decoder for the audio stream to use it later. */ -if ((error = avcodec_open2((*input_format_context)->streams[0]->codec, - input_codec, NULL)) < 0) { +if ((error = avcodec_open2(avctx, input_codec, NULL)) < 0) { fprintf(stderr, "Could not open input codec (error '%s')\n", get_error_text(error)); +avcodec_free_context(&avctx); avformat_close_input(input_format_context); return error; } /** Save the decoder context for easier access later. */ -*input_codec_context = (*input_format_context)->streams[0]->codec; +*input_codec_context = avctx; return 0; } @@ -122,6 +139,7 @@ static int open_output_file(const char *filename, AVFormatContext **output_format_context, AVCodecContext **output_codec_context) { +AVCodecContext *avctx = NULL; AVIOContext *output_io_context = NULL; AVStream *stream = NULL; AVCodec *output_codec = NULL; @@ -161,27 +179,31 @@ static int open_output_file(const char *filename, } /** Create a new audio stream in the output file container. */ -if (!(stream = avformat_new_stream(*output_format_context, output_codec))) { +if (!(stream = avformat_new_stream(*output_format_context, NULL))) { fprintf(stderr, "Could not create new stream\n"); error = AVERROR(ENOMEM); goto cleanup; } -/** Save the encoder context for easier access later. */ -*output_codec_context = stream->codec; +avctx = avcodec_alloc_context3(output_codec); +if (!avctx) { +fprintf(stderr, "Could not allocate an encoding context\n"); +error = AVERROR(ENOMEM); +goto cleanup; +} /** * Set the basic encoder parameters. * The input file's sample rate is used to avoid a sample rate conversion. */ -(*output_codec_context)->channels = OUTPUT_CHANNELS; -(*output_codec_context)->channel_layout = av_get_default_channel_layout(OUTPUT_CHANNELS); -(*output_codec_context)->sample_rate= input_codec_context->sample_rate; -(*output_codec_context)->sample_fmt = output_codec->sample_fmts[0]; -(*output_codec_context)->bit_rate = OUTPUT_BIT_RATE; +avctx->channels = OUTPUT_CHANNELS; +avctx->channel_layout = av_get_default_channel_layout(OUTPUT_CHANNELS); +avctx->sample_rate= input_codec_context->sample_rate; +avctx->sample_fmt = output_codec->sample_fmts[0]; +avctx->bit_rate = OUTPUT_BIT_RATE; /** Allow the use of the experimental AAC encoder */ -(*output_codec_context)->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL; +avctx->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL; /** Set the sample rate for the contai
[FFmpeg-cvslog] examples/transcode_aac: convert to codecpar
ffmpeg | branch: master | Anton Khirnov | Wed Feb 10 14:17:21 2016 +0100| [ac6d53589f3631ae08467c784fb371a15c957f01] | committer: Anton Khirnov examples/transcode_aac: convert to codecpar > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ac6d53589f3631ae08467c784fb371a15c957f01 --- doc/examples/transcode_aac.c | 66 +++--- 1 file changed, 49 insertions(+), 17 deletions(-) diff --git a/doc/examples/transcode_aac.c b/doc/examples/transcode_aac.c index 3eebfb9..be86fe5 100644 --- a/doc/examples/transcode_aac.c +++ b/doc/examples/transcode_aac.c @@ -61,6 +61,7 @@ static int open_input_file(const char *filename, AVFormatContext **input_format_context, AVCodecContext **input_codec_context) { +AVCodecContext *avctx; AVCodec *input_codec; int error; @@ -90,23 +91,39 @@ static int open_input_file(const char *filename, } /** Find a decoder for the audio stream. */ -if (!(input_codec = avcodec_find_decoder((*input_format_context)->streams[0]->codec->codec_id))) { +if (!(input_codec = avcodec_find_decoder((*input_format_context)->streams[0]->codecpar->codec_id))) { fprintf(stderr, "Could not find input codec\n"); avformat_close_input(input_format_context); return AVERROR_EXIT; } +/** allocate a new decoding context */ +avctx = avcodec_alloc_context3(input_codec); +if (!avctx) { +fprintf(stderr, "Could not allocate a decoding context\n"); +avformat_close_input(input_format_context); +return AVERROR(ENOMEM); +} + +/** initialize the stream parameters with demuxer information */ +error = avcodec_parameters_to_context(avctx, (*input_format_context)->streams[0]->codecpar); +if (error < 0) { +avformat_close_input(input_format_context); +avcodec_free_context(&avctx); +return error; +} + /** Open the decoder for the audio stream to use it later. */ -if ((error = avcodec_open2((*input_format_context)->streams[0]->codec, - input_codec, NULL)) < 0) { +if ((error = avcodec_open2(avctx, input_codec, NULL)) < 0) { fprintf(stderr, "Could not open input codec (error '%s')\n", get_error_text(error)); +avcodec_free_context(&avctx); avformat_close_input(input_format_context); return error; } /** Save the decoder context for easier access later. */ -*input_codec_context = (*input_format_context)->streams[0]->codec; +*input_codec_context = avctx; return 0; } @@ -121,6 +138,7 @@ static int open_output_file(const char *filename, AVFormatContext **output_format_context, AVCodecContext **output_codec_context) { +AVCodecContext *avctx = NULL; AVIOContext *output_io_context = NULL; AVStream *stream = NULL; AVCodec *output_codec = NULL; @@ -160,27 +178,31 @@ static int open_output_file(const char *filename, } /** Create a new audio stream in the output file container. */ -if (!(stream = avformat_new_stream(*output_format_context, output_codec))) { +if (!(stream = avformat_new_stream(*output_format_context, NULL))) { fprintf(stderr, "Could not create new stream\n"); error = AVERROR(ENOMEM); goto cleanup; } -/** Save the encoder context for easier access later. */ -*output_codec_context = stream->codec; +avctx = avcodec_alloc_context3(output_codec); +if (!avctx) { +fprintf(stderr, "Could not allocate an encoding context\n"); +error = AVERROR(ENOMEM); +goto cleanup; +} /** * Set the basic encoder parameters. * The input file's sample rate is used to avoid a sample rate conversion. */ -(*output_codec_context)->channels = OUTPUT_CHANNELS; -(*output_codec_context)->channel_layout = av_get_default_channel_layout(OUTPUT_CHANNELS); -(*output_codec_context)->sample_rate= input_codec_context->sample_rate; -(*output_codec_context)->sample_fmt = output_codec->sample_fmts[0]; -(*output_codec_context)->bit_rate = OUTPUT_BIT_RATE; +avctx->channels = OUTPUT_CHANNELS; +avctx->channel_layout = av_get_default_channel_layout(OUTPUT_CHANNELS); +avctx->sample_rate= input_codec_context->sample_rate; +avctx->sample_fmt = output_codec->sample_fmts[0]; +avctx->bit_rate = OUTPUT_BIT_RATE; /** Allow the use of the experimental AAC encoder */ -(*output_codec_context)->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL; +avctx->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL; /** Set the sample rate for the container. */ stream->time_base.den = input_codec_context->sample_rate; @@ -191,18 +213,28 @@ static int open_output_file(const char *filename,
[FFmpeg-cvslog] qsvenc: store the sync point in heap memory
ffmpeg | branch: master | Maxym Dmytrychenko | Mon Feb 22 10:39:02 2016 +0100| [a1335149fd610b16459d9281b611282cac51c950] | committer: Anton Khirnov qsvenc: store the sync point in heap memory The QSV runtime expects the sync point address passed to MFXVideoENCODE_EncodeFrameAsync() to be valid until MFXVideoCORE_SyncOperation(). Signed-off-by: Anton Khirnov > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a1335149fd610b16459d9281b611282cac51c950 --- libavcodec/qsvenc.c | 25 ++--- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index 453301c..473a180 100644 --- a/libavcodec/qsvenc.c +++ b/libavcodec/qsvenc.c @@ -662,7 +662,7 @@ int ff_qsv_enc_init(AVCodecContext *avctx, QSVEncContext *q) q->param.AsyncDepth = q->async_depth; q->async_fifo = av_fifo_alloc((1 + q->async_depth) * - (sizeof(AVPacket) + sizeof(mfxSyncPoint) + sizeof(mfxBitstream*))); + (sizeof(AVPacket) + sizeof(mfxSyncPoint*) + sizeof(mfxBitstream*))); if (!q->async_fifo) return AVERROR(ENOMEM); @@ -876,7 +876,7 @@ static int encode_frame(AVCodecContext *avctx, QSVEncContext *q, mfxBitstream *bs; mfxFrameSurface1 *surf = NULL; -mfxSyncPoint sync = NULL; +mfxSyncPoint *sync = NULL; int ret; if (frame) { @@ -901,8 +901,15 @@ static int encode_frame(AVCodecContext *avctx, QSVEncContext *q, bs->Data = new_pkt.data; bs->MaxLength = new_pkt.size; +sync = av_mallocz(sizeof(*sync)); +if (!sync) { +av_freep(&bs); +av_packet_unref(&new_pkt); +return AVERROR(ENOMEM); +} + do { -ret = MFXVideoENCODE_EncodeFrameAsync(q->session, NULL, surf, bs, &sync); +ret = MFXVideoENCODE_EncodeFrameAsync(q->session, NULL, surf, bs, sync); if (ret == MFX_WRN_DEVICE_BUSY) av_usleep(1); } while (ret > 0); @@ -910,17 +917,19 @@ static int encode_frame(AVCodecContext *avctx, QSVEncContext *q, if (ret < 0) { av_packet_unref(&new_pkt); av_freep(&bs); +av_freep(&sync); return (ret == MFX_ERR_MORE_DATA) ? 0 : ff_qsv_error(ret); } if (ret == MFX_WRN_INCOMPATIBLE_VIDEO_PARAM && frame->interlaced_frame) print_interlace_msg(avctx, q); -if (sync) { +if (*sync) { av_fifo_generic_write(q->async_fifo, &new_pkt, sizeof(new_pkt), NULL); av_fifo_generic_write(q->async_fifo, &sync,sizeof(sync),NULL); av_fifo_generic_write(q->async_fifo, &bs, sizeof(bs),NULL); } else { +av_freep(&sync); av_packet_unref(&new_pkt); av_freep(&bs); } @@ -941,14 +950,14 @@ int ff_qsv_encode(AVCodecContext *avctx, QSVEncContext *q, (!frame && av_fifo_size(q->async_fifo))) { AVPacket new_pkt; mfxBitstream *bs; -mfxSyncPoint sync; +mfxSyncPoint *sync; av_fifo_generic_read(q->async_fifo, &new_pkt, sizeof(new_pkt), NULL); av_fifo_generic_read(q->async_fifo, &sync,sizeof(sync),NULL); av_fifo_generic_read(q->async_fifo, &bs, sizeof(bs), NULL); do { -ret = MFXVideoCORE_SyncOperation(q->session, sync, 1000); +ret = MFXVideoCORE_SyncOperation(q->session, *sync, 1000); } while (ret == MFX_WRN_IN_EXECUTION); new_pkt.dts = av_rescale_q(bs->DecodeTimeStamp, (AVRational){1, 9}, avctx->time_base); @@ -971,6 +980,7 @@ FF_ENABLE_DEPRECATION_WARNINGS #endif av_freep(&bs); +av_freep(&sync); if (pkt->data) { if (pkt->size < new_pkt.size) { @@ -1017,13 +1027,14 @@ int ff_qsv_enc_close(AVCodecContext *avctx, QSVEncContext *q) while (q->async_fifo && av_fifo_size(q->async_fifo)) { AVPacket pkt; -mfxSyncPoint sync; +mfxSyncPoint *sync; mfxBitstream *bs; av_fifo_generic_read(q->async_fifo, &pkt, sizeof(pkt), NULL); av_fifo_generic_read(q->async_fifo, &sync, sizeof(sync), NULL); av_fifo_generic_read(q->async_fifo, &bs, sizeof(bs), NULL); +av_freep(&sync); av_freep(&bs); av_packet_unref(&pkt); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'a1335149fd610b16459d9281b611282cac51c950'
ffmpeg | branch: master | Derek Buitenhuis | Mon Apr 11 14:45:57 2016 +0100| [acc155ac55baa95d1c16c0364b02244bc04d83a8] | committer: Derek Buitenhuis Merge commit 'a1335149fd610b16459d9281b611282cac51c950' * commit 'a1335149fd610b16459d9281b611282cac51c950': qsvenc: store the sync point in heap memory Merged-by: Derek Buitenhuis > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=acc155ac55baa95d1c16c0364b02244bc04d83a8 --- libavcodec/qsvenc.c | 22 -- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index be54bf9..132cf47 100644 --- a/libavcodec/qsvenc.c +++ b/libavcodec/qsvenc.c @@ -682,7 +682,7 @@ int ff_qsv_enc_init(AVCodecContext *avctx, QSVEncContext *q) q->param.AsyncDepth = q->async_depth; q->async_fifo = av_fifo_alloc((1 + q->async_depth) * - (sizeof(AVPacket) + sizeof(mfxSyncPoint) + sizeof(mfxBitstream*))); + (sizeof(AVPacket) + sizeof(mfxSyncPoint*) + sizeof(mfxBitstream*))); if (!q->async_fifo) return AVERROR(ENOMEM); @@ -926,7 +926,7 @@ static int encode_frame(AVCodecContext *avctx, QSVEncContext *q, mfxBitstream *bs; mfxFrameSurface1 *surf = NULL; -mfxSyncPoint sync = NULL; +mfxSyncPoint *sync = NULL; QSVFrame *qsv_frame = NULL; mfxEncodeCtrl* enc_ctrl = NULL; int ret; @@ -961,8 +961,15 @@ static int encode_frame(AVCodecContext *avctx, QSVEncContext *q, q->set_encode_ctrl_cb(avctx, frame, &qsv_frame->enc_ctrl); } +sync = av_mallocz(sizeof(*sync)); +if (!sync) { +av_freep(&bs); +av_packet_unref(&new_pkt); +return AVERROR(ENOMEM); +} + do { -ret = MFXVideoENCODE_EncodeFrameAsync(q->session, enc_ctrl, surf, bs, &sync); +ret = MFXVideoENCODE_EncodeFrameAsync(q->session, enc_ctrl, surf, bs, sync); if (ret == MFX_WRN_DEVICE_BUSY) { av_usleep(500); continue; @@ -991,6 +998,7 @@ static int encode_frame(AVCodecContext *avctx, QSVEncContext *q, av_fifo_generic_write(q->async_fifo, &sync,sizeof(sync),NULL); av_fifo_generic_write(q->async_fifo, &bs, sizeof(bs),NULL); } else { +av_freep(&sync); av_packet_unref(&new_pkt); av_freep(&bs); } @@ -1011,14 +1019,14 @@ int ff_qsv_encode(AVCodecContext *avctx, QSVEncContext *q, (!frame && av_fifo_size(q->async_fifo))) { AVPacket new_pkt; mfxBitstream *bs; -mfxSyncPoint sync; +mfxSyncPoint *sync; av_fifo_generic_read(q->async_fifo, &new_pkt, sizeof(new_pkt), NULL); av_fifo_generic_read(q->async_fifo, &sync,sizeof(sync),NULL); av_fifo_generic_read(q->async_fifo, &bs, sizeof(bs), NULL); do { -ret = MFXVideoCORE_SyncOperation(q->session, sync, 1000); +ret = MFXVideoCORE_SyncOperation(q->session, *sync, 1000); } while (ret == MFX_WRN_IN_EXECUTION); new_pkt.dts = av_rescale_q(bs->DecodeTimeStamp, (AVRational){1, 9}, avctx->time_base); @@ -1041,6 +1049,7 @@ FF_ENABLE_DEPRECATION_WARNINGS #endif av_freep(&bs); +av_freep(&sync); if (pkt->data) { if (pkt->size < new_pkt.size) { @@ -1087,13 +1096,14 @@ int ff_qsv_enc_close(AVCodecContext *avctx, QSVEncContext *q) while (q->async_fifo && av_fifo_size(q->async_fifo)) { AVPacket pkt; -mfxSyncPoint sync; +mfxSyncPoint *sync; mfxBitstream *bs; av_fifo_generic_read(q->async_fifo, &pkt, sizeof(pkt), NULL); av_fifo_generic_read(q->async_fifo, &sync, sizeof(sync), NULL); av_fifo_generic_read(q->async_fifo, &bs, sizeof(bs), NULL); +av_freep(&sync); av_freep(&bs); av_packet_unref(&pkt); } == diff --cc libavcodec/qsvenc.c index be54bf9,473a180..132cf47 --- a/libavcodec/qsvenc.c +++ b/libavcodec/qsvenc.c @@@ -926,9 -876,7 +926,9 @@@ static int encode_frame(AVCodecContext mfxBitstream *bs; mfxFrameSurface1 *surf = NULL; - mfxSyncPoint sync = NULL; -mfxSyncPoint *sync = NULL; ++mfxSyncPoint *sync = NULL; +QSVFrame *qsv_frame = NULL; +mfxEncodeCtrl* enc_ctrl = NULL; int ret; if (frame) { @@@ -957,18 -901,18 +957,25 @@@ bs->Data = new_pkt.data; bs->MaxLength = new_pkt.size; +if (q->set_encode_ctrl_cb) { +q->set_encode_ctrl_cb(avctx, frame, &qsv_frame->enc_ctrl); +} + + sync = av_mallocz(sizeof(*sync)); + if (!sync) { + av_freep(&bs); + av_packet_unref(&new_pkt); + return AVERROR(ENOMEM); + } + do { - ret = MFXVideoENCODE_EncodeFrameAsync(q->session, enc_ctrl, surf, bs, &sync); -ret = MFXVid
[FFmpeg-cvslog] Merge commit '1138eb5509d3db7f6d565cb45f137a786d22beb9'
ffmpeg | branch: master | Derek Buitenhuis | Mon Apr 11 14:42:30 2016 +0100| [8cae006c5646a08fd73cf62c46bb16598be6c7b4] | committer: Derek Buitenhuis Merge commit '1138eb5509d3db7f6d565cb45f137a786d22beb9' * commit '1138eb5509d3db7f6d565cb45f137a786d22beb9': vsrc_movie: convert to codecpar Merged-by: Derek Buitenhuis > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8cae006c5646a08fd73cf62c46bb16598be6c7b4 --- libavfilter/src_movie.c | 59 +++ 1 file changed, 34 insertions(+), 25 deletions(-) diff --git a/libavfilter/src_movie.c b/libavfilter/src_movie.c index eab2458..0bdcad4 100644 --- a/libavfilter/src_movie.c +++ b/libavfilter/src_movie.c @@ -46,6 +46,7 @@ typedef struct MovieStream { AVStream *st; +AVCodecContext *codec_ctx; int done; } MovieStream; @@ -133,11 +134,11 @@ static AVStream *find_stream(void *log, AVFormatContext *avf, const char *spec) "did not match any stream"); return NULL; } -if (found->codec->codec_type != AVMEDIA_TYPE_VIDEO && -found->codec->codec_type != AVMEDIA_TYPE_AUDIO) { +if (found->codecpar->codec_type != AVMEDIA_TYPE_VIDEO && +found->codecpar->codec_type != AVMEDIA_TYPE_AUDIO) { av_log(log, AV_LOG_ERROR, "Stream specifier \"%s\" matched a %s stream," "currently unsupported by libavfilter\n", spec, - av_get_media_type_string(found->codec->codec_type)); + av_get_media_type_string(found->codecpar->codec_type)); return NULL; } return found; @@ -148,15 +149,23 @@ static int open_stream(void *log, MovieStream *st) AVCodec *codec; int ret; -codec = avcodec_find_decoder(st->st->codec->codec_id); +codec = avcodec_find_decoder(st->st->codecpar->codec_id); if (!codec) { av_log(log, AV_LOG_ERROR, "Failed to find any codec\n"); return AVERROR(EINVAL); } -st->st->codec->refcounted_frames = 1; +st->codec_ctx = avcodec_alloc_context3(codec); +if (!st->codec_ctx) +return AVERROR(ENOMEM); + +ret = avcodec_parameters_to_context(st->codec_ctx, st->st->codecpar); +if (ret < 0) +return ret; + +st->codec_ctx->refcounted_frames = 1; -if ((ret = avcodec_open2(st->st->codec, codec, NULL)) < 0) { +if ((ret = avcodec_open2(st->codec_ctx, codec, NULL)) < 0) { av_log(log, AV_LOG_ERROR, "Failed to open codec\n"); return ret; } @@ -166,24 +175,24 @@ static int open_stream(void *log, MovieStream *st) static int guess_channel_layout(MovieStream *st, int st_index, void *log_ctx) { -AVCodecContext *dec_ctx = st->st->codec; +AVCodecParameters *dec_par = st->st->codecpar; char buf[256]; -int64_t chl = av_get_default_channel_layout(dec_ctx->channels); +int64_t chl = av_get_default_channel_layout(dec_par->channels); if (!chl) { av_log(log_ctx, AV_LOG_ERROR, "Channel layout is not set in stream %d, and could not " "be guessed from the number of channels (%d)\n", - st_index, dec_ctx->channels); + st_index, dec_par->channels); return AVERROR(EINVAL); } -av_get_channel_layout_string(buf, sizeof(buf), dec_ctx->channels, chl); +av_get_channel_layout_string(buf, sizeof(buf), dec_par->channels, chl); av_log(log_ctx, AV_LOG_WARNING, "Channel layout is not set in output stream %d, " "guessed channel layout is '%s'\n", st_index, buf); -dec_ctx->channel_layout = chl; +dec_par->channel_layout = chl; return 0; } @@ -287,7 +296,7 @@ static av_cold int movie_common_init(AVFilterContext *ctx) AVFilterPad pad = { 0 }; movie->out_index[movie->st[i].st->index] = i; snprintf(name, sizeof(name), "out%d", i); -pad.type = movie->st[i].st->codec->codec_type; +pad.type = movie->st[i].st->codecpar->codec_type; pad.name = av_strdup(name); if (!pad.name) return AVERROR(ENOMEM); @@ -297,8 +306,8 @@ static av_cold int movie_common_init(AVFilterContext *ctx) ret = open_stream(ctx, &movie->st[i]); if (ret < 0) return ret; -if ( movie->st[i].st->codec->codec->type == AVMEDIA_TYPE_AUDIO && -!movie->st[i].st->codec->channel_layout) { +if ( movie->st[i].st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO && +!movie->st[i].st->codecpar->channel_layout) { ret = guess_channel_layout(&movie->st[i], i, ctx); if (ret < 0) return ret; @@ -320,7 +329,7 @@ static av_cold void movie_uninit(AVFilterContext *ctx) for (i = 0; i < ctx->nb_outputs; i++) { av_freep(&ctx->output_pads[i].name); if (movie->st[i].st) -avcodec_close(movie->st[i].st->codec); +avcodec_free_context(&movie->st[i].cod
[FFmpeg-cvslog] vsrc_movie: convert to codecpar
ffmpeg | branch: master | Anton Khirnov | Wed Feb 10 14:17:21 2016 +0100| [1138eb5509d3db7f6d565cb45f137a786d22beb9] | committer: Anton Khirnov vsrc_movie: convert to codecpar > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1138eb5509d3db7f6d565cb45f137a786d22beb9 --- libavfilter/vsrc_movie.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/libavfilter/vsrc_movie.c b/libavfilter/vsrc_movie.c index 850788c..95ef4f1 100644 --- a/libavfilter/vsrc_movie.c +++ b/libavfilter/vsrc_movie.c @@ -86,6 +86,7 @@ static av_cold int movie_init(AVFilterContext *ctx) { MovieContext *movie = ctx->priv; AVInputFormat *iformat = NULL; +AVStream *st; AVCodec *codec; int ret; int64_t timestamp; @@ -132,18 +133,26 @@ static av_cold int movie_init(AVFilterContext *ctx) return ret; } movie->stream_index = ret; -movie->codec_ctx = movie->format_ctx->streams[movie->stream_index]->codec; +st = movie->format_ctx->streams[movie->stream_index]; /* * So now we've got a pointer to the so-called codec context for our video * stream, but we still have to find the actual codec and open it. */ -codec = avcodec_find_decoder(movie->codec_ctx->codec_id); +codec = avcodec_find_decoder(st->codecpar->codec_id); if (!codec) { av_log(ctx, AV_LOG_ERROR, "Failed to find any codec\n"); return AVERROR(EINVAL); } +movie->codec_ctx = avcodec_alloc_context3(codec); +if (!movie->codec_ctx) +return AVERROR(ENOMEM); + +ret = avcodec_parameters_to_context(movie->codec_ctx, st->codecpar); +if (ret < 0) +return ret; + movie->codec_ctx->refcounted_frames = 1; if ((ret = avcodec_open2(movie->codec_ctx, codec, NULL)) < 0) { @@ -174,8 +183,7 @@ static av_cold void uninit(AVFilterContext *ctx) { MovieContext *movie = ctx->priv; -if (movie->codec_ctx) -avcodec_close(movie->codec_ctx); +avcodec_free_context(&movie->codec_ctx); if (movie->format_ctx) avformat_close_input(&movie->format_ctx); av_frame_free(&movie->frame); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '3c53627ac17fc6bdea5029be57da1e03b32d265d'
ffmpeg | branch: master | Derek Buitenhuis | Mon Apr 11 14:56:27 2016 +0100| [d30cf57a7b2097b565db02ecfffbdc9c16423d0e] | committer: Derek Buitenhuis Merge commit '3c53627ac17fc6bdea5029be57da1e03b32d265d' * commit '3c53627ac17fc6bdea5029be57da1e03b32d265d': qsvdec: store the sync point in heap memory Merged-by: Derek Buitenhuis > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d30cf57a7b2097b565db02ecfffbdc9c16423d0e --- libavcodec/qsvdec.c | 34 -- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c index 9125700..c17606d 100644 --- a/libavcodec/qsvdec.c +++ b/libavcodec/qsvdec.c @@ -142,7 +142,7 @@ static int qsv_decode_init(AVCodecContext *avctx, QSVContext *q, AVPacket *avpkt */ if (!q->async_fifo) { q->async_fifo = av_fifo_alloc((1 + 16) * - (sizeof(mfxSyncPoint) + sizeof(QSVFrame*))); + (sizeof(mfxSyncPoint*) + sizeof(QSVFrame*))); if (!q->async_fifo) return AVERROR(ENOMEM); } @@ -297,6 +297,16 @@ static void close_decoder(QSVContext *q) if (q->session) MFXVideoDECODE_Close(q->session); +while (q->async_fifo && av_fifo_size(q->async_fifo)) { +QSVFrame *out_frame; +mfxSyncPoint *sync; + +av_fifo_generic_read(q->async_fifo, &out_frame, sizeof(out_frame), NULL); +av_fifo_generic_read(q->async_fifo, &sync, sizeof(sync), NULL); + +av_freep(&sync); +} + cur = q->work_frames; while (cur) { q->work_frames = cur->next; @@ -316,7 +326,7 @@ static int do_qsv_decode(AVCodecContext *avctx, QSVContext *q, QSVFrame *out_frame; mfxFrameSurface1 *insurf; mfxFrameSurface1 *outsurf; -mfxSyncPoint sync; +mfxSyncPoint *sync; mfxBitstream bs = { { { 0 } } }; int ret; int n_out_frames; @@ -349,13 +359,19 @@ static int do_qsv_decode(AVCodecContext *avctx, QSVContext *q, bs.TimeStamp = avpkt->pts; } +sync = av_mallocz(sizeof(*sync)); +if (!sync) { +av_freep(&sync); +return AVERROR(ENOMEM); +} + while (1) { ret = get_surface(avctx, q, &insurf); if (ret < 0) return ret; do { ret = MFXVideoDECODE_DecodeFrameAsync(q->session, flush ? NULL : &bs, - insurf, &outsurf, &sync); + insurf, &outsurf, sync); if (ret != MFX_WRN_DEVICE_BUSY) break; av_usleep(500); @@ -369,10 +385,11 @@ static int do_qsv_decode(AVCodecContext *avctx, QSVContext *q, continue; } -if (sync) { +if (*sync) { QSVFrame *out_frame = find_frame(q, outsurf); if (!out_frame) { +av_freep(&sync); av_log(avctx, AV_LOG_ERROR, "The returned surface does not correspond to any frame\n"); return AVERROR_BUG; @@ -383,6 +400,8 @@ static int do_qsv_decode(AVCodecContext *avctx, QSVContext *q, av_fifo_generic_write(q->async_fifo, &sync, sizeof(sync), NULL); continue; +} else { +av_freep(&sync); } if (MFX_ERR_MORE_SURFACE != ret && ret < 0) break; @@ -390,7 +409,7 @@ static int do_qsv_decode(AVCodecContext *avctx, QSVContext *q, /* make sure we do not enter an infinite loop if the SDK * did not consume any data and did not return anything */ -if (!sync && !bs.DataOffset && !flush) { +if (!*sync && !bs.DataOffset && !flush) { av_log(avctx, AV_LOG_WARNING, "A decode call did not consume any data\n"); bs.DataOffset = avpkt->size; } @@ -404,6 +423,7 @@ static int do_qsv_decode(AVCodecContext *avctx, QSVContext *q, } if (MFX_ERR_MORE_DATA!=ret && ret < 0) { +av_freep(&sync); av_log(avctx, AV_LOG_ERROR, "Error %d during QSV decoding.\n", ret); return ff_qsv_error(ret); } @@ -417,9 +437,11 @@ static int do_qsv_decode(AVCodecContext *avctx, QSVContext *q, out_frame->queued = 0; do { -ret = MFXVideoCORE_SyncOperation(q->session, sync, 1000); +ret = MFXVideoCORE_SyncOperation(q->session, *sync, 1000); } while (ret == MFX_WRN_IN_EXECUTION); +av_freep(&sync); + src_frame = out_frame->frame; ret = av_frame_ref(frame, src_frame); == diff --cc libavcodec/qsvdec.c index 9125700,1d59e72..c17606d --- a/libavcodec/qsvdec.c +++ b/libavcodec/qsvdec.c @@@ -129,37 -116,6 +129,37 @@@ static int qsv_decode_init(AVCodecConte return ff_qsv_error(ret); } +avctx->profile = param.mfx.CodecProfile; +avctx
[FFmpeg-cvslog] qsvdec: store the sync point in heap memory
ffmpeg | branch: master | Anton Khirnov | Mon Feb 22 10:48:34 2016 +0100| [3c53627ac17fc6bdea5029be57da1e03b32d265d] | committer: Anton Khirnov qsvdec: store the sync point in heap memory The reasoning is the same as for the corresponding qsvenc patch. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3c53627ac17fc6bdea5029be57da1e03b32d265d --- libavcodec/qsvdec.c | 34 -- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c index 3b0ede0..1d59e72 100644 --- a/libavcodec/qsvdec.c +++ b/libavcodec/qsvdec.c @@ -77,7 +77,7 @@ static int qsv_decode_init(AVCodecContext *avctx, QSVContext *q, mfxSession sess if (!q->async_fifo) { q->async_fifo = av_fifo_alloc((1 + q->async_depth) * - (sizeof(mfxSyncPoint) + sizeof(QSVFrame*))); + (sizeof(mfxSyncPoint*) + sizeof(QSVFrame*))); if (!q->async_fifo) return AVERROR(ENOMEM); } @@ -218,7 +218,7 @@ static int qsv_decode(AVCodecContext *avctx, QSVContext *q, QSVFrame *out_frame; mfxFrameSurface1 *insurf; mfxFrameSurface1 *outsurf; -mfxSyncPoint sync; +mfxSyncPoint *sync; mfxBitstream bs = { { { 0 } } }; int ret; @@ -229,13 +229,19 @@ static int qsv_decode(AVCodecContext *avctx, QSVContext *q, bs.TimeStamp = avpkt->pts; } +sync = av_mallocz(sizeof(*sync)); +if (!sync) { +av_freep(&sync); +return AVERROR(ENOMEM); +} + do { ret = get_surface(avctx, q, &insurf); if (ret < 0) return ret; ret = MFXVideoDECODE_DecodeFrameAsync(q->session, avpkt->size ? &bs : NULL, - insurf, &outsurf, &sync); + insurf, &outsurf, sync); if (ret == MFX_WRN_DEVICE_BUSY) av_usleep(1); @@ -246,28 +252,32 @@ static int qsv_decode(AVCodecContext *avctx, QSVContext *q, ret != MFX_WRN_VIDEO_PARAM_CHANGED && ret != MFX_ERR_MORE_SURFACE) { av_log(avctx, AV_LOG_ERROR, "Error during QSV decoding.\n"); +av_freep(&sync); return ff_qsv_error(ret); } /* make sure we do not enter an infinite loop if the SDK * did not consume any data and did not return anything */ -if (!sync && !bs.DataOffset) { +if (!*sync && !bs.DataOffset) { av_log(avctx, AV_LOG_WARNING, "A decode call did not consume any data\n"); bs.DataOffset = avpkt->size; } -if (sync) { +if (*sync) { QSVFrame *out_frame = find_frame(q, outsurf); if (!out_frame) { av_log(avctx, AV_LOG_ERROR, "The returned surface does not correspond to any frame\n"); +av_freep(&sync); return AVERROR_BUG; } out_frame->queued = 1; av_fifo_generic_write(q->async_fifo, &out_frame, sizeof(out_frame), NULL); av_fifo_generic_write(q->async_fifo, &sync, sizeof(sync), NULL); +} else { +av_freep(&sync); } if (!av_fifo_space(q->async_fifo) || @@ -279,9 +289,11 @@ static int qsv_decode(AVCodecContext *avctx, QSVContext *q, out_frame->queued = 0; do { -ret = MFXVideoCORE_SyncOperation(q->session, sync, 1000); +ret = MFXVideoCORE_SyncOperation(q->session, *sync, 1000); } while (ret == MFX_WRN_IN_EXECUTION); +av_freep(&sync); + src_frame = out_frame->frame; ret = av_frame_ref(frame, src_frame); @@ -314,6 +326,16 @@ int ff_qsv_decode_close(QSVContext *q) if (q->session) MFXVideoDECODE_Close(q->session); +while (q->async_fifo && av_fifo_size(q->async_fifo)) { +QSVFrame *out_frame; +mfxSyncPoint *sync; + +av_fifo_generic_read(q->async_fifo, &out_frame, sizeof(out_frame), NULL); +av_fifo_generic_read(q->async_fifo, &sync, sizeof(sync), NULL); + +av_freep(&sync); +} + while (cur) { q->work_frames = cur->next; av_frame_free(&cur->frame); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] idct: Only build prores IDCT if ProRes decoder is enabled
ffmpeg | branch: master | Diego Biurrun | Tue Feb 23 09:51:07 2016 +0100| [d6e49096c0c3c10ffb176761b0da150c93bedbf6] | committer: Diego Biurrun idct: Only build prores IDCT if ProRes decoder is enabled > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d6e49096c0c3c10ffb176761b0da150c93bedbf6 --- libavcodec/simple_idct.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/simple_idct.c b/libavcodec/simple_idct.c index f61e9e6..6ee1320 100644 --- a/libavcodec/simple_idct.c +++ b/libavcodec/simple_idct.c @@ -218,6 +218,7 @@ void ff_simple_idct44_add(uint8_t *dest, int line_size, int16_t *block) } } +#if CONFIG_PRORES_DECODER void ff_prores_idct(int16_t *block, const int16_t *qmat) { int i; @@ -231,3 +232,4 @@ void ff_prores_idct(int16_t *block, const int16_t *qmat) for (i = 0; i < 8; i++) idctSparseCol_10(block + i); } +#endif /* CONFIG_PRORES_DECODER */ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'd6e49096c0c3c10ffb176761b0da150c93bedbf6'
ffmpeg | branch: master | Derek Buitenhuis | Mon Apr 11 14:58:33 2016 +0100| [8a6cc30b04287adf30ef24a27362fa3d0275f02c] | committer: Derek Buitenhuis Merge commit 'd6e49096c0c3c10ffb176761b0da150c93bedbf6' This commit is a no-op. * commit 'd6e49096c0c3c10ffb176761b0da150c93bedbf6': idct: Only build prores IDCT if ProRes decoder is enabled Merged-by: Derek Buitenhuis > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8a6cc30b04287adf30ef24a27362fa3d0275f02c --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'fa55addd23c2f168163175aee17adb125c2c0710'
ffmpeg | branch: master | Derek Buitenhuis | Mon Apr 11 14:59:58 2016 +0100| [8a1c79024da48ef44cc0ba5252ec6fc28e62453b] | committer: Derek Buitenhuis Merge commit 'fa55addd23c2f168163175aee17adb125c2c0710' * commit 'fa55addd23c2f168163175aee17adb125c2c0710': img2: Drop av_ prefix for a static function Merged-by: Derek Buitenhuis > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8a1c79024da48ef44cc0ba5252ec6fc28e62453b --- libavformat/img2.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/img2.c b/libavformat/img2.c index 50352b5..0f6f75c 100644 --- a/libavformat/img2.c +++ b/libavformat/img2.c @@ -81,7 +81,7 @@ const IdStrMap ff_img_tags[] = { { AV_CODEC_ID_NONE, NULL } }; -static enum AVCodecID av_str2id(const IdStrMap *tags, const char *str) +static enum AVCodecID str2id(const IdStrMap *tags, const char *str) { str = strrchr(str, '.'); if (!str) @@ -99,5 +99,5 @@ static enum AVCodecID av_str2id(const IdStrMap *tags, const char *str) enum AVCodecID ff_guess_image2_codec(const char *filename) { -return av_str2id(ff_img_tags, filename); +return str2id(ff_img_tags, filename); } == diff --cc libavformat/img2.c index 50352b5,3cfc08e..0f6f75c --- a/libavformat/img2.c +++ b/libavformat/img2.c @@@ -99,5 -100,5 +99,5 @@@ static enum AVCodecID str2id(const IdSt enum AVCodecID ff_guess_image2_codec(const char *filename) { - return av_str2id(ff_img_tags, filename); -return str2id(img_tags, filename); ++return str2id(ff_img_tags, filename); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] img2: Drop av_ prefix for a static function
ffmpeg | branch: master | Vittorio Giovara | Tue Feb 23 19:44:18 2016 -0500| [fa55addd23c2f168163175aee17adb125c2c0710] | committer: Vittorio Giovara img2: Drop av_ prefix for a static function This prefix is reserved for public functions only. Signed-off-by: Vittorio Giovara > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fa55addd23c2f168163175aee17adb125c2c0710 --- libavformat/img2.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/img2.c b/libavformat/img2.c index 9f462d0..3cfc08e 100644 --- a/libavformat/img2.c +++ b/libavformat/img2.c @@ -82,7 +82,7 @@ static const IdStrMap img_tags[] = { { AV_CODEC_ID_NONE, NULL } }; -static enum AVCodecID av_str2id(const IdStrMap *tags, const char *str) +static enum AVCodecID str2id(const IdStrMap *tags, const char *str) { str = strrchr(str, '.'); if (!str) @@ -100,5 +100,5 @@ static enum AVCodecID av_str2id(const IdStrMap *tags, const char *str) enum AVCodecID ff_guess_image2_codec(const char *filename) { -return av_str2id(img_tags, filename); +return str2id(img_tags, filename); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '35b1cd343cd703c1b0fc926dc43a92141a357380'
ffmpeg | branch: master | Derek Buitenhuis | Mon Apr 11 15:00:46 2016 +0100| [e06f5c6f94835374fc34eb2be4fa3d338d6a7dce] | committer: Derek Buitenhuis Merge commit '35b1cd343cd703c1b0fc926dc43a92141a357380' * commit '35b1cd343cd703c1b0fc926dc43a92141a357380': vc1dec: Drop commented out cruft Merged-by: Derek Buitenhuis > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e06f5c6f94835374fc34eb2be4fa3d338d6a7dce --- libavcodec/vc1dec.c |8 1 file changed, 8 deletions(-) diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index f66afb9..9c49f6a 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -362,14 +362,6 @@ av_cold int ff_vc1_decode_init_alloc_tables(VC1Context *v) v->mv_f_next[0] = v->mv_f_next_base + s->b8_stride + 1; v->mv_f_next[1] = v->mv_f_next[0] + (s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2); -/* Init coded blocks info */ -if (v->profile == PROFILE_ADVANCED) { -//if (alloc_bitplane(&v->over_flags_plane, s->mb_width, s->mb_height) < 0) -//return -1; -//if (alloc_bitplane(&v->ac_pred_plane, s->mb_width, s->mb_height) < 0) -//return -1; -} - ff_intrax8_common_init(&v->x8,s); if (s->avctx->codec_id == AV_CODEC_ID_WMV3IMAGE || s->avctx->codec_id == AV_CODEC_ID_VC1IMAGE) { == ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] vc1dec: Drop commented out cruft
ffmpeg | branch: master | Vittorio Giovara | Wed Feb 24 14:40:16 2016 -0500| [35b1cd343cd703c1b0fc926dc43a92141a357380] | committer: Vittorio Giovara vc1dec: Drop commented out cruft > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=35b1cd343cd703c1b0fc926dc43a92141a357380 --- libavcodec/vc1dec.c |8 1 file changed, 8 deletions(-) diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index d65c68a..2cd7a03 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -352,14 +352,6 @@ av_cold int ff_vc1_decode_init_alloc_tables(VC1Context *v) v->mv_f_next[0] = v->mv_f_next_base + s->b8_stride + 1; v->mv_f_next[1] = v->mv_f_next[0] + (s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2); -/* Init coded blocks info */ -if (v->profile == PROFILE_ADVANCED) { -//if (alloc_bitplane(&v->over_flags_plane, s->mb_width, s->mb_height) < 0) -//return -1; -//if (alloc_bitplane(&v->ac_pred_plane, s->mb_width, s->mb_height) < 0) -//return -1; -} - ff_intrax8_common_init(&v->x8,s); if (s->avctx->codec_id == AV_CODEC_ID_WMV3IMAGE || s->avctx->codec_id == AV_CODEC_ID_VC1IMAGE) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] vc1dec: Properly call deinit function on error
ffmpeg | branch: master | Vittorio Giovara | Wed Feb 24 14:40:17 2016 -0500| [f91d94bdfc3f5f83ff0be4d19d10d0a35697386f] | committer: Vittorio Giovara vc1dec: Properly call deinit function on error > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f91d94bdfc3f5f83ff0be4d19d10d0a35697386f --- libavcodec/vc1dec.c | 16 +--- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 2cd7a03..2ccbbd5 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -362,20 +362,14 @@ av_cold int ff_vc1_decode_init_alloc_tables(VC1Context *v) if (!v->mv_type_mb_plane || !v->direct_mb_plane || !v->acpred_plane || !v->over_flags_plane || !v->block || !v->cbp_base || !v->ttblk_base || !v->is_intra_base || !v->luma_mv_base || !v->mb_type_base) { -av_freep(&v->mv_type_mb_plane); -av_freep(&v->direct_mb_plane); -av_freep(&v->acpred_plane); -av_freep(&v->over_flags_plane); -av_freep(&v->block); -av_freep(&v->cbp_base); -av_freep(&v->ttblk_base); -av_freep(&v->is_intra_base); -av_freep(&v->luma_mv_base); -av_freep(&v->mb_type_base); -return AVERROR(ENOMEM); +goto error; } return 0; + +error: +ff_vc1_decode_end(s->avctx); +return AVERROR(ENOMEM); } av_cold void ff_vc1_init_transposed_scantables(VC1Context *v) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'f91d94bdfc3f5f83ff0be4d19d10d0a35697386f'
ffmpeg | branch: master | Derek Buitenhuis | Mon Apr 11 15:01:33 2016 +0100| [015ca20030be077c4bc084244e3fc267e1b72e52] | committer: Derek Buitenhuis Merge commit 'f91d94bdfc3f5f83ff0be4d19d10d0a35697386f' * commit 'f91d94bdfc3f5f83ff0be4d19d10d0a35697386f': vc1dec: Properly call deinit function on error Merged-by: Derek Buitenhuis > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=015ca20030be077c4bc084244e3fc267e1b72e52 --- libavcodec/vc1dec.c | 16 +--- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 9c49f6a..4d83967 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -373,20 +373,14 @@ av_cold int ff_vc1_decode_init_alloc_tables(VC1Context *v) if (!v->mv_type_mb_plane || !v->direct_mb_plane || !v->acpred_plane || !v->over_flags_plane || !v->block || !v->cbp_base || !v->ttblk_base || !v->is_intra_base || !v->luma_mv_base || !v->mb_type_base) { -av_freep(&v->mv_type_mb_plane); -av_freep(&v->direct_mb_plane); -av_freep(&v->acpred_plane); -av_freep(&v->over_flags_plane); -av_freep(&v->block); -av_freep(&v->cbp_base); -av_freep(&v->ttblk_base); -av_freep(&v->is_intra_base); -av_freep(&v->luma_mv_base); -av_freep(&v->mb_type_base); -return AVERROR(ENOMEM); +goto error; } return 0; + +error: +ff_vc1_decode_end(s->avctx); +return AVERROR(ENOMEM); } av_cold void ff_vc1_init_transposed_scantables(VC1Context *v) == ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] vc1dec: Fix leak on error for array allocations
ffmpeg | branch: master | Vittorio Giovara | Wed Feb 24 14:40:18 2016 -0500| [01f0e6a0c9270f1d5bef08459a6f167cf55e0596] | committer: Vittorio Giovara vc1dec: Fix leak on error for array allocations The deinit function in the 'error' section will correctly free everything. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=01f0e6a0c9270f1d5bef08459a6f167cf55e0596 --- libavcodec/vc1dec.c |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 2ccbbd5..9d0f890 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -355,8 +355,11 @@ av_cold int ff_vc1_decode_init_alloc_tables(VC1Context *v) ff_intrax8_common_init(&v->x8,s); if (s->avctx->codec_id == AV_CODEC_ID_WMV3IMAGE || s->avctx->codec_id == AV_CODEC_ID_VC1IMAGE) { -for (i = 0; i < 4; i++) -if (!(v->sr_rows[i >> 1][i & 1] = av_malloc(v->output_width))) return -1; +for (i = 0; i < 4; i++) { +v->sr_rows[i >> 1][i & 1] = av_malloc(v->output_width); +if (!v->sr_rows[i >> 1][i & 1]) +goto error; +} } if (!v->mv_type_mb_plane || !v->direct_mb_plane || !v->acpred_plane || !v->over_flags_plane || ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '01f0e6a0c9270f1d5bef08459a6f167cf55e0596'
ffmpeg | branch: master | Derek Buitenhuis | Mon Apr 11 15:03:14 2016 +0100| [8cd1323103d3a287eeba5cac32e00cd7314c02bd] | committer: Derek Buitenhuis Merge commit '01f0e6a0c9270f1d5bef08459a6f167cf55e0596' This commit is a no-op. We already did this. * commit '01f0e6a0c9270f1d5bef08459a6f167cf55e0596': vc1dec: Fix leak on error for array allocations Merged-by: Derek Buitenhuis > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8cd1323103d3a287eeba5cac32e00cd7314c02bd --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] vc1dec: Check group allocations separatedly
ffmpeg | branch: master | Vittorio Giovara | Wed Feb 24 14:40:19 2016 -0500| [e66fa35392cd45d0a80774cd057fb765d60def43] | committer: Vittorio Giovara vc1dec: Check group allocations separatedly This avoids accessing NULL pointers in case of error. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e66fa35392cd45d0a80774cd057fb765d60def43 --- libavcodec/vc1dec.c | 25 +++-- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 9d0f890..ce55493 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -324,31 +324,50 @@ av_cold int ff_vc1_decode_init_alloc_tables(VC1Context *v) v->fieldtx_plane= av_mallocz(s->mb_stride * mb_height); v->acpred_plane = av_malloc (s->mb_stride * mb_height); v->over_flags_plane = av_malloc (s->mb_stride * mb_height); +if (!v->mv_type_mb_plane || !v->direct_mb_plane || !v->forward_mb_plane || +!v->fieldtx_plane || !v->acpred_plane || !v->over_flags_plane) +goto error; v->n_allocated_blks = s->mb_width + 2; v->block= av_malloc(sizeof(*v->block) * v->n_allocated_blks); v->cbp_base = av_malloc(sizeof(v->cbp_base[0]) * 2 * s->mb_stride); +if (!v->block || !v->cbp_base) +goto error; v->cbp = v->cbp_base + s->mb_stride; v->ttblk_base = av_malloc(sizeof(v->ttblk_base[0]) * 2 * s->mb_stride); +if (!v->ttblk_base) +goto error; v->ttblk= v->ttblk_base + s->mb_stride; v->is_intra_base= av_mallocz(sizeof(v->is_intra_base[0]) * 2 * s->mb_stride); +if (!v->is_intra_base) +goto error; v->is_intra = v->is_intra_base + s->mb_stride; v->luma_mv_base = av_malloc(sizeof(v->luma_mv_base[0]) * 2 * s->mb_stride); +if (!v->luma_mv_base) +goto error; v->luma_mv = v->luma_mv_base + s->mb_stride; /* allocate block type info in that way so it could be used with s->block_index[] */ v->mb_type_base = av_malloc(s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2); +if (!v->mb_type_base) +goto error; v->mb_type[0] = v->mb_type_base + s->b8_stride + 1; v->mb_type[1] = v->mb_type_base + s->b8_stride * (mb_height * 2 + 1) + s->mb_stride + 1; v->mb_type[2] = v->mb_type[1] + s->mb_stride * (mb_height + 1); /* allocate memory to store block level MV info */ v->blk_mv_type_base = av_mallocz( s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2); +if (!v->blk_mv_type_base) +goto error; v->blk_mv_type = v->blk_mv_type_base + s->b8_stride + 1; v->mv_f_base= av_mallocz(2 * (s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2)); +if (!v->mv_f_base) +goto error; v->mv_f[0] = v->mv_f_base + s->b8_stride + 1; v->mv_f[1] = v->mv_f[0] + (s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2); v->mv_f_next_base = av_mallocz(2 * (s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2)); +if (!v->mv_f_next_base) +goto error; v->mv_f_next[0] = v->mv_f_next_base + s->b8_stride + 1; v->mv_f_next[1] = v->mv_f_next[0] + (s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2); @@ -362,12 +381,6 @@ av_cold int ff_vc1_decode_init_alloc_tables(VC1Context *v) } } -if (!v->mv_type_mb_plane || !v->direct_mb_plane || !v->acpred_plane || !v->over_flags_plane || -!v->block || !v->cbp_base || !v->ttblk_base || !v->is_intra_base || !v->luma_mv_base || -!v->mb_type_base) { -goto error; -} - return 0; error: ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'e66fa35392cd45d0a80774cd057fb765d60def43'
ffmpeg | branch: master | Derek Buitenhuis | Mon Apr 11 15:06:18 2016 +0100| [3dec7ed3cf04985ae68b64c3b05ecf559f493518] | committer: Derek Buitenhuis Merge commit 'e66fa35392cd45d0a80774cd057fb765d60def43' * commit 'e66fa35392cd45d0a80774cd057fb765d60def43': vc1dec: Check group allocations separatedly Merged-by: Derek Buitenhuis > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3dec7ed3cf04985ae68b64c3b05ecf559f493518 --- libavcodec/vc1dec.c | 25 +++-- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 4d83967..75d069d 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -334,31 +334,50 @@ av_cold int ff_vc1_decode_init_alloc_tables(VC1Context *v) v->fieldtx_plane= av_mallocz(s->mb_stride * mb_height); v->acpred_plane = av_malloc (s->mb_stride * mb_height); v->over_flags_plane = av_malloc (s->mb_stride * mb_height); +if (!v->mv_type_mb_plane || !v->direct_mb_plane || !v->forward_mb_plane || +!v->fieldtx_plane || !v->acpred_plane || !v->over_flags_plane) +goto error; v->n_allocated_blks = s->mb_width + 2; v->block= av_malloc(sizeof(*v->block) * v->n_allocated_blks); v->cbp_base = av_malloc(sizeof(v->cbp_base[0]) * 2 * s->mb_stride); +if (!v->block || !v->cbp_base) +goto error; v->cbp = v->cbp_base + s->mb_stride; v->ttblk_base = av_malloc(sizeof(v->ttblk_base[0]) * 2 * s->mb_stride); +if (!v->ttblk_base) +goto error; v->ttblk= v->ttblk_base + s->mb_stride; v->is_intra_base= av_mallocz(sizeof(v->is_intra_base[0]) * 2 * s->mb_stride); +if (!v->is_intra_base) +goto error; v->is_intra = v->is_intra_base + s->mb_stride; v->luma_mv_base = av_mallocz(sizeof(v->luma_mv_base[0]) * 2 * s->mb_stride); +if (!v->luma_mv_base) +goto error; v->luma_mv = v->luma_mv_base + s->mb_stride; /* allocate block type info in that way so it could be used with s->block_index[] */ v->mb_type_base = av_malloc(s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2); +if (!v->mb_type_base) +goto error; v->mb_type[0] = v->mb_type_base + s->b8_stride + 1; v->mb_type[1] = v->mb_type_base + s->b8_stride * (mb_height * 2 + 1) + s->mb_stride + 1; v->mb_type[2] = v->mb_type[1] + s->mb_stride * (mb_height + 1); /* allocate memory to store block level MV info */ v->blk_mv_type_base = av_mallocz( s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2); +if (!v->blk_mv_type_base) +goto error; v->blk_mv_type = v->blk_mv_type_base + s->b8_stride + 1; v->mv_f_base= av_mallocz(2 * (s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2)); +if (!v->mv_f_base) +goto error; v->mv_f[0] = v->mv_f_base + s->b8_stride + 1; v->mv_f[1] = v->mv_f[0] + (s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2); v->mv_f_next_base = av_mallocz(2 * (s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2)); +if (!v->mv_f_next_base) +goto error; v->mv_f_next[0] = v->mv_f_next_base + s->b8_stride + 1; v->mv_f_next[1] = v->mv_f_next[0] + (s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2); @@ -370,12 +389,6 @@ av_cold int ff_vc1_decode_init_alloc_tables(VC1Context *v) return AVERROR(ENOMEM); } -if (!v->mv_type_mb_plane || !v->direct_mb_plane || !v->acpred_plane || !v->over_flags_plane || -!v->block || !v->cbp_base || !v->ttblk_base || !v->is_intra_base || !v->luma_mv_base || -!v->mb_type_base) { -goto error; -} - return 0; error: == diff --cc libavcodec/vc1dec.c index 4d83967,ce55493..75d069d --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@@ -338,12 -331,20 +341,20 @@@ av_cold int ff_vc1_decode_init_alloc_ta v->n_allocated_blks = s->mb_width + 2; v->block= av_malloc(sizeof(*v->block) * v->n_allocated_blks); v->cbp_base = av_malloc(sizeof(v->cbp_base[0]) * 2 * s->mb_stride); + if (!v->block || !v->cbp_base) + goto error; v->cbp = v->cbp_base + s->mb_stride; v->ttblk_base = av_malloc(sizeof(v->ttblk_base[0]) * 2 * s->mb_stride); + if (!v->ttblk_base) + goto error; v->ttblk= v->ttblk_base + s->mb_stride; v->is_intra_base= av_mallocz(sizeof(v->is_intra_base[0]) * 2 * s->mb_stride); + if (!v->is_intra_base) + goto error; v->is_intra = v->is_intra_base + s->mb_stride; -v->luma_mv_base = av_malloc(sizeof(v->luma_mv_base[0]) * 2 * s->mb_stride); +v->luma_mv_base
[FFmpeg-cvslog] lavf: add a missing bump and APIchanges for the codecpar switch
ffmpeg | branch: master | Anton Khirnov | Wed Feb 24 10:47:58 2016 +0100| [3e8fd93b6ab219221e17fa2b6243cc72cf2d69dc] | committer: Anton Khirnov lavf: add a missing bump and APIchanges for the codecpar switch > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3e8fd93b6ab219221e17fa2b6243cc72cf2d69dc --- doc/APIchanges|3 +++ libavformat/version.h |2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/APIchanges b/doc/APIchanges index 70fce18..2db39de 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -13,6 +13,9 @@ libavutil: 2015-08-28 API changes, most recent first: +2016-02-23 - 9200514 - lavf 57.5.0 - avformat.h + Add AVStream.codecpar, deprecate AVStream.codec. + 2016-xx-xx - lavc 57.14.0 - avcodec.h xxx - Add AVCodecParameters and its related API. xxx - Add av_get_audio_frame_duration2(). diff --git a/libavformat/version.h b/libavformat/version.h index 58544c9..f264076 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -30,7 +30,7 @@ #include "libavutil/version.h" #define LIBAVFORMAT_VERSION_MAJOR 57 -#define LIBAVFORMAT_VERSION_MINOR 4 +#define LIBAVFORMAT_VERSION_MINOR 5 #define LIBAVFORMAT_VERSION_MICRO 0 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '3e8fd93b6ab219221e17fa2b6243cc72cf2d69dc'
ffmpeg | branch: master | Derek Buitenhuis | Mon Apr 11 15:09:00 2016 +0100| [6586f62d1a7cbb14e449eb077b057dec6a64f23a] | committer: Derek Buitenhuis Merge commit '3e8fd93b6ab219221e17fa2b6243cc72cf2d69dc' * commit '3e8fd93b6ab219221e17fa2b6243cc72cf2d69dc': lavf: add a missing bump and APIchanges for the codecpar switch Merged-by: Derek Buitenhuis > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6586f62d1a7cbb14e449eb077b057dec6a64f23a --- doc/APIchanges|3 +++ libavformat/version.h |2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/APIchanges b/doc/APIchanges index e02097b..cc73528 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -15,6 +15,9 @@ libavutil: 2015-08-28 API changes, most recent first: +2016-04-11 - xxx - lavf 57.33.0 - avformat.h + Add AVStream.codecpar, deprecate AVStream.codec. + 2016-04-02 - xxx - lavu 55.20.100 - base64.h Add AV_BASE64_DECODE_SIZE(x) macro. diff --git a/libavformat/version.h b/libavformat/version.h index d3408eb..3575c5a 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -30,7 +30,7 @@ #include "libavutil/version.h" #define LIBAVFORMAT_VERSION_MAJOR 57 -#define LIBAVFORMAT_VERSION_MINOR 32 +#define LIBAVFORMAT_VERSION_MINOR 33 #define LIBAVFORMAT_VERSION_MICRO 100 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ == diff --cc doc/APIchanges index e02097b,2db39de..cc73528 --- a/doc/APIchanges +++ b/doc/APIchanges @@@ -15,10 -13,10 +15,13 @@@ libavutil: 2015-08-2 API changes, most recent first: -2016-02-23 - 9200514 - lavf 57.5.0 - avformat.h ++2016-04-11 - xxx - lavf 57.33.0 - avformat.h + Add AVStream.codecpar, deprecate AVStream.codec. + -2016-xx-xx - lavc 57.14.0 - avcodec.h +2016-04-02 - xxx - lavu 55.20.100 - base64.h + Add AV_BASE64_DECODE_SIZE(x) macro. + +2016-xx-xx - lavc 57.33.0 - avcodec.h xxx - Add AVCodecParameters and its related API. xxx - Add av_get_audio_frame_duration2(). diff --cc libavformat/version.h index d3408eb,f264076..3575c5a --- a/libavformat/version.h +++ b/libavformat/version.h @@@ -29,9 -29,9 +29,9 @@@ #include "libavutil/version.h" -#define LIBAVFORMAT_VERSION_MAJOR 57 -#define LIBAVFORMAT_VERSION_MINOR 5 -#define LIBAVFORMAT_VERSION_MICRO 0 +#define LIBAVFORMAT_VERSION_MAJOR 57 - #define LIBAVFORMAT_VERSION_MINOR 32 ++#define LIBAVFORMAT_VERSION_MINOR 33 +#define LIBAVFORMAT_VERSION_MICRO 100 #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] APIchanges: add missing hashes and dates
ffmpeg | branch: master | Anton Khirnov | Wed Feb 24 10:59:57 2016 +0100| [dc4983d78af2a666461654067d2e5d45b835358a] | committer: Anton Khirnov APIchanges: add missing hashes and dates Also, remove a stray line (apparently fallout from conflict resolution). > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dc4983d78af2a666461654067d2e5d45b835358a --- doc/APIchanges | 72 +++- 1 file changed, 35 insertions(+), 37 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index 2db39de..20fecb9 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -17,81 +17,79 @@ API changes, most recent first: Add AVStream.codecpar, deprecate AVStream.codec. 2016-xx-xx - lavc 57.14.0 - avcodec.h - xxx - Add AVCodecParameters and its related API. - xxx - Add av_get_audio_frame_duration2(). + 998e1b8 - Add AVCodecParameters and its related API. + a806834 - Add av_get_audio_frame_duration2(). -2016-xx-xx - xxx - lavf 57.4.0 - avformat.h +2016-02-22 - ec4c483 - lavf 57.4.0 - avformat.h Add AVFormatContext.protocol_whitelist and protocol_blacklist. Add 'protocol_whitelist' and 'protocol_blacklist' private options for avio_open2(). -2016-xx-xx - lavc 57.13.0 - avcodec.h +2016-02-14 - 7b3214d0 - lavc 57.13.0 - avcodec.h Add AVCodecContext.hw_frames_ctx. -2016-xx-xx - lavfi 6.2.0 - avfilter.h - xxx avfilter.h - Add AVFilterLink.hw_frames_ctx. - xxx buffersrc.h - Add AVBufferSrcParameters and functions for handling it. +2016-02-14 - lavfi 6.2.0 - avfilter.h + b3dd30d avfilter.h - Add AVFilterLink.hw_frames_ctx. + buffersrc.h - Add AVBufferSrcParameters and functions for handling it. -2016-xx-xx - lavu 55.6.0 - xxx buffer.h - Add av_buffer_pool_init2(). - xxx hwcontext.h - Add a new installed header hwcontext.h with a new API +2016-02-14 - lavu 55.6.0 + 721a4ef buffer.h - Add av_buffer_pool_init2(). + 89923e4 hwcontext.h - Add a new installed header hwcontext.h with a new API for handling hwaccel frames. - xxx hwcontext_cuda.h - Add a new installed header hwcontext_cuda.h with + ad884d1 hwcontext_cuda.h - Add a new installed header hwcontext_cuda.h with CUDA-specific hwcontext definitions. - xxx hwcontext_vdpau.h - Add a new installed header hwcontext_vdpau.h with + a001ce3 hwcontext_vdpau.h - Add a new installed header hwcontext_vdpau.h with VDPAU-specific hwcontext definitions. - xxx pixfmt.h - Add AV_PIX_FMT_CUDA. + 7bc780c pixfmt.h - Add AV_PIX_FMT_CUDA. -2016-xx-xx - xxx - lavf 57.3.0 - avformat.h +2016-01-24 - 9f61abc - lavf 57.3.0 - avformat.h Add AVFormatContext.opaque, io_open and io_close, allowing custom IO for muxers and demuxers that open additional files. -2015-xx-xx - xxx - lavc 57.12.0 - avcodec.h +2015-12-12 - 2c68113 - lavc 57.12.0 - avcodec.h Add AVCodecDescriptor.profiles and avcodec_profile_name(). -2015-xx-xx - xxx - lavc 57.11.0 - avcodec.h dirac.h - xxx - Add av_packet_add_side_data(). - xxx - Add AVCodecContext.coded_side_data. - xxx - Add AVCPBProperties API. - xxx - Add a new public header dirac.h containing +2015-12-06 - lavc 57.11.0 - avcodec.h dirac.h + 31c51f7 - Add av_packet_add_side_data(). + 84adab3 - Add AVCodecContext.coded_side_data. + f0b769c - Add AVCPBProperties API. + e02de9d - Add a new public header dirac.h containing av_dirac_parse_sequence_header() -2015-xx-xx - xxx - lavc 57.9.1 - avcodec.h +2015-11-20 - 462a54e - lavc 57.9.1 - avcodec.h Deprecate rtp_callback without replacement, i.e. it won't be possible to get image slices before the full frame is encoded any more. The libavformat rtpenc muxer can still be used for RFC-2190 packetization. -2015-11-xx - xxx - lavc 57.9.0 - avcodec.h +2015-11-18 - 79ae1e6 - lavc 57.9.0 - avcodec.h Add AV_PKT_DATA_FALLBACK_TRACK for making fallback associations between streams. -2015-11-xx - xxx - lavf 57.1.0 - avformat.h +2015-11-18 - 7f4ec43 - lavf 57.1.0 - avformat.h Add av_stream_new_side_data(). -2015-11-xx - xxx - lavu 55.3.0 - xtea.h +2015-11-13 - 92d107a - lavu 55.3.0 - xtea.h Add av_xtea_le_init and av_xtea_le_crypt -2015-11-xx - xxx - lavfi 6.1.0 - avfilter.h +2015-11-09 - 48ff668 - lavfi 6.1.0 - avfilter.h Add a frame_rate field to AVFilterLink -2015-xx-xx - xxx - lavc 57.6.0 - avcodec.h +2015-10-26 - lavc 57.7.0 - avcodec.h + ce70f28 - Deprecate av_free_packet(). Use av_packet_unref() as replacement, +it resets the packet in a more consistent way. + 9b56d5c - Deprecate av_dup_packet(), it is a no-op for most cases. +Use av_packet_ref() to make a non-refcounted AVPacket refcounted. + a9a6010 - Add av_packet_alloc(), av_packet_clone(), av_packet_free(). +They match the AVFrame functions with the same name. -2015-xx-xx - lavc 57.7.0 -
[FFmpeg-cvslog] Merge commit 'dc4983d78af2a666461654067d2e5d45b835358a'
ffmpeg | branch: master | Derek Buitenhuis | Mon Apr 11 15:09:54 2016 +0100| [0dfbca73bbb3319af49554f7f844e1d7b8d2192c] | committer: Derek Buitenhuis Merge commit 'dc4983d78af2a666461654067d2e5d45b835358a' This commit is a no-op. * commit 'dc4983d78af2a666461654067d2e5d45b835358a': APIchanges: add missing hashes and dates Merged-by: Derek Buitenhuis > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0dfbca73bbb3319af49554f7f844e1d7b8d2192c --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] sws/aarch64: add ff_yuv2planeX_8_neon
ffmpeg | branch: master | Clément Bœsch | Fri Apr 1 17:27:29 2016 +0200| [c921f4f687971a62f9eb16eadfad99de53c92064] | committer: Clément Bœsch sws/aarch64: add ff_yuv2planeX_8_neon > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c921f4f687971a62f9eb16eadfad99de53c92064 --- libswscale/aarch64/Makefile |1 + libswscale/aarch64/output.S | 66 ++ libswscale/aarch64/swscale.c |7 + libswscale/utils.c |3 +- 4 files changed, 76 insertions(+), 1 deletion(-) diff --git a/libswscale/aarch64/Makefile b/libswscale/aarch64/Makefile index 51bff08..64a3fe2 100644 --- a/libswscale/aarch64/Makefile +++ b/libswscale/aarch64/Makefile @@ -2,4 +2,5 @@ OBJS+= aarch64/swscale.o\ aarch64/swscale_unscaled.o \ NEON-OBJS += aarch64/hscale.o \ + aarch64/output.o \ aarch64/yuv2rgb_neon.o \ diff --git a/libswscale/aarch64/output.S b/libswscale/aarch64/output.S new file mode 100644 index 000..90d3b57 --- /dev/null +++ b/libswscale/aarch64/output.S @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2016 Clément Bœsch + * + * 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/aarch64/asm.S" + +function ff_yuv2planeX_8_neon, export=1 +ld1 {v0.8B}, [x5] // load 8x8-bit dither +cbz w6, 1f // check if offsetting present +ext v0.8B, v0.8B, v0.8B, #3 // honor offsetting which can be 0 or 3 only +1: uxtlv0.8H, v0.8B// extend dither to 16-bit +ushll v1.4S, v0.4H, #12 // extend dither to 32-bit with left shift by 12 (part 1) +ushll2 v2.4S, v0.8H, #12 // extend dither to 32-bit with left shift by 12 (part 2) +mov x7, #0 // i = 0 +2: mov v3.16B, v1.16B // initialize accumulator part 1 with dithering value +mov v4.16B, v2.16B // initialize accumulator part 2 with dithering value +mov w8, w1 // tmpfilterSize = filterSize +mov x9, x2 // srcp= src +mov x10, x0 // filterp = filter +3: ldp x11, x12, [x9], #16 // get 2 pointers: src[j] and src[j+1] +add x11, x11, x7, lsl #1// &src[j ][i] +add x12, x12, x7, lsl #1// &src[j+1][i] +ld1 {v5.8H}, [x11] // read 8x16-bit @ src[j ][i + {0..7}]: A,B,C,D,E,F,G,H +ld1 {v6.8H}, [x12] // read 8x16-bit @ src[j+1][i + {0..7}]: I,J,K,L,M,N,O,P +ldr w11, [x10], #4 // read 2x16-bit coeffs (X, Y) at (filter[j], filter[j+1]) +zip1v16.8H, v5.8H, v6.8H// A,I,B,J,C,K,D,L +zip2v17.8H, v5.8H, v6.8H// E,M,F,N,F,O,H,P +dup v7.4S, w11 // X,Y,X,Y,X,Y,X,Y +smull v18.4S, v16.4H, v7.4H // A.X I.Y B.X J.Y +smull v20.4S, v17.4H, v7.4H // E.X M.Y F.X N.Y +smull2 v19.4S, v16.8H, v7.8H // C.X K.Y D.X L.Y +smull2 v21.4S, v17.8H, v7.8H // G.X O.Y H.X P.Y +addpv16.4S, v18.4S, v19.4S // A.X+I.Y B.X+J.Y C.X+K.Y D.X+L.Y +addpv17.4S, v20.4S, v21.4S // E.X+M.Y F.X+N.Y F.X+O.Y H.X+P.Y +add v3.4S, v3.4S, v16.4S// update val accumulator for part 1 +add v4.4S, v4.4S, v17.4S// update val accumulator for part 2 +subsw8, w8, #2 // tmpfilterSize -= 2 +b.gt3b // loop until filterSize consumed +sshr
[FFmpeg-cvslog] avprobe: remove a pointless condition and a dead branch
ffmpeg | branch: master | Anton Khirnov | Thu Jan 21 16:35:32 2016 +0100| [e7188a1a84817b8d4337340c21c552ad0b6cb2fd] | committer: Anton Khirnov avprobe: remove a pointless condition and a dead branch AVStream.codec is always non-NULL > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e7188a1a84817b8d4337340c21c552ad0b6cb2fd --- avprobe.c | 129 ++--- 1 file changed, 63 insertions(+), 66 deletions(-) diff --git a/avprobe.c b/avprobe.c index 63e6c2a..3dd41bb 100644 --- a/avprobe.c +++ b/avprobe.c @@ -610,74 +610,71 @@ static void show_stream(AVFormatContext *fmt_ctx, int stream_idx) probe_int("index", stream->index); -if ((dec_ctx = stream->codec)) { -if ((dec = dec_ctx->codec)) { -probe_str("codec_name", dec->name); -probe_str("codec_long_name", dec->long_name); -} else { -probe_str("codec_name", "unknown"); -} +dec_ctx = stream->codec; +if ((dec = dec_ctx->codec)) { +probe_str("codec_name", dec->name); +probe_str("codec_long_name", dec->long_name); +} else { +probe_str("codec_name", "unknown"); +} -probe_str("codec_type", media_type_string(dec_ctx->codec_type)); -probe_str("codec_time_base", - rational_string(val_str, sizeof(val_str), - "/", &dec_ctx->time_base)); - -/* print AVI/FourCC tag */ -av_get_codec_tag_string(val_str, sizeof(val_str), dec_ctx->codec_tag); -probe_str("codec_tag_string", val_str); -probe_str("codec_tag", tag_string(val_str, sizeof(val_str), - dec_ctx->codec_tag)); - -/* print profile, if there is one */ -if (dec && (profile = av_get_profile_name(dec, dec_ctx->profile))) -probe_str("profile", profile); - -switch (dec_ctx->codec_type) { -case AVMEDIA_TYPE_VIDEO: -probe_int("width", dec_ctx->width); -probe_int("height", dec_ctx->height); -probe_int("coded_width", dec_ctx->coded_width); -probe_int("coded_height", dec_ctx->coded_height); -probe_int("has_b_frames", dec_ctx->has_b_frames); -if (dec_ctx->sample_aspect_ratio.num) -sar = &dec_ctx->sample_aspect_ratio; -else if (stream->sample_aspect_ratio.num) -sar = &stream->sample_aspect_ratio; - -if (sar) { -probe_str("sample_aspect_ratio", - rational_string(val_str, sizeof(val_str), ":", sar)); -av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den, - dec_ctx->width * sar->num, dec_ctx->height * sar->den, - 1024*1024); -probe_str("display_aspect_ratio", - rational_string(val_str, sizeof(val_str), ":", - &display_aspect_ratio)); -} -desc = av_pix_fmt_desc_get(dec_ctx->pix_fmt); -probe_str("pix_fmt", desc ? desc->name : "unknown"); -probe_int("level", dec_ctx->level); - -probe_str("color_range", av_color_range_name(dec_ctx->color_range)); -probe_str("color_space", av_color_space_name(dec_ctx->colorspace)); -probe_str("color_trc", av_color_transfer_name(dec_ctx->color_trc)); -probe_str("color_pri", av_color_primaries_name(dec_ctx->color_primaries)); -probe_str("chroma_loc", av_chroma_location_name(dec_ctx->chroma_sample_location)); -break; - -case AVMEDIA_TYPE_AUDIO: -probe_str("sample_rate", - value_string(val_str, sizeof(val_str), - dec_ctx->sample_rate, - unit_hertz_str)); -probe_int("channels", dec_ctx->channels); -probe_int("bits_per_sample", - av_get_bits_per_sample(dec_ctx->codec_id)); -break; +probe_str("codec_type", media_type_string(dec_ctx->codec_type)); +probe_str("codec_time_base", + rational_string(val_str, sizeof(val_str), + "/", &dec_ctx->time_base)); + +/* print AVI/FourCC tag */ +av_get_codec_tag_string(val_str, sizeof(val_str), dec_ctx->codec_tag); +probe_str("codec_tag_string", val_str); +probe_str("codec_tag", tag_string(val_str, sizeof(val_str), + dec_ctx->codec_tag)); + +/* print profile, if there is one */ +if (dec && (profile = av_get_profile_name(dec, dec_ctx->profile))) +probe_str("profile", profile); + +switch (dec_ctx->codec_type) { +case AVMEDIA_TYPE_VIDEO: +probe_int("width", dec_ctx->width); +probe_int("height", dec_ctx->height); +probe_int("coded_width", dec_ctx->coded_width); +probe_int("coded_he
[FFmpeg-cvslog] avprobe: print information from the codec descriptor
ffmpeg | branch: master | Anton Khirnov | Thu Jan 21 16:40:59 2016 +0100| [168a443d43b10ef6a3545d64b2f8bc90144ce4b7] | committer: Anton Khirnov avprobe: print information from the codec descriptor avprobe is not doing any decoding, so this is more correct than printing information from a random codec implementation. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=168a443d43b10ef6a3545d64b2f8bc90144ce4b7 --- avprobe.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/avprobe.c b/avprobe.c index 3dd41bb..1fdcd01 100644 --- a/avprobe.c +++ b/avprobe.c @@ -600,7 +600,7 @@ static void show_stream(AVFormatContext *fmt_ctx, int stream_idx) { AVStream *stream = fmt_ctx->streams[stream_idx]; AVCodecContext *dec_ctx; -const AVCodec *dec; +const AVCodecDescriptor *codec_desc; const char *profile; char val_str[128]; AVRational display_aspect_ratio, *sar = NULL; @@ -611,9 +611,10 @@ static void show_stream(AVFormatContext *fmt_ctx, int stream_idx) probe_int("index", stream->index); dec_ctx = stream->codec; -if ((dec = dec_ctx->codec)) { -probe_str("codec_name", dec->name); -probe_str("codec_long_name", dec->long_name); +codec_desc = avcodec_descriptor_get(dec_ctx->codec_id); +if (codec_desc) { +probe_str("codec_name", codec_desc->name); +probe_str("codec_long_name", codec_desc->long_name); } else { probe_str("codec_name", "unknown"); } @@ -630,7 +631,8 @@ static void show_stream(AVFormatContext *fmt_ctx, int stream_idx) dec_ctx->codec_tag)); /* print profile, if there is one */ -if (dec && (profile = av_get_profile_name(dec, dec_ctx->profile))) +profile = avcodec_profile_name(dec_ctx->codec_id, dec_ctx->profile); +if (profile) probe_str("profile", profile); switch (dec_ctx->codec_type) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] mpegvideo_enc: use avcodec_free_context() instead of av_free()
ffmpeg | branch: master | Anton Khirnov | Wed Feb 24 11:10:30 2016 +0100| [c80344d0101558098a6cd2ed5082ff5fda7ca18b] | committer: Anton Khirnov mpegvideo_enc: use avcodec_free_context() instead of av_free() > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c80344d0101558098a6cd2ed5082ff5fda7ca18b --- libavcodec/mpegvideo_enc.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index d16e408..96f49ef 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -1343,8 +1343,7 @@ static int estimate_best_b_count(MpegEncContext *s) } } -avcodec_close(c); -av_freep(&c); +avcodec_free_context(&c); return best_b_count; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'c80344d0101558098a6cd2ed5082ff5fda7ca18b'
ffmpeg | branch: master | Derek Buitenhuis | Mon Apr 11 16:02:08 2016 +0100| [95348174ef87b67f14609334ef177fe9e75c48c1] | committer: Derek Buitenhuis Merge commit 'c80344d0101558098a6cd2ed5082ff5fda7ca18b' * commit 'c80344d0101558098a6cd2ed5082ff5fda7ca18b': mpegvideo_enc: use avcodec_free_context() instead of av_free() Merged-by: Derek Buitenhuis > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=95348174ef87b67f14609334ef177fe9e75c48c1 --- libavcodec/mpegvideo_enc.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 297ff78..f8de028 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -1518,8 +1518,7 @@ static int estimate_best_b_count(MpegEncContext *s) } } -avcodec_close(c); -av_freep(&c); +avcodec_free_context(&c); return best_b_count; } == ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avprobe: add local per-file state
ffmpeg | branch: master | Anton Khirnov | Wed Feb 24 14:56:15 2016 +0100| [c9478410c68c04261f9cfcd80474607e50bd1852] | committer: Anton Khirnov avprobe: add local per-file state Do not pass just a bare AVFormatContext pointer around, wrap it in struct. This will be useful in the following commits. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c9478410c68c04261f9cfcd80474607e50bd1852 --- avprobe.c | 38 +++--- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/avprobe.c b/avprobe.c index 1fdcd01..b395e93 100644 --- a/avprobe.c +++ b/avprobe.c @@ -32,6 +32,10 @@ #include "libavdevice/avdevice.h" #include "cmdutils.h" +typedef struct InputFile { +AVFormatContext *fmt_ctx; +} InputFile; + const char program_name[] = "avprobe"; const int program_birth_year = 2007; @@ -583,8 +587,9 @@ static void show_packet(AVFormatContext *fmt_ctx, AVPacket *pkt) probe_object_footer("packet"); } -static void show_packets(AVFormatContext *fmt_ctx) +static void show_packets(InputFile *ifile) { +AVFormatContext *fmt_ctx = ifile->fmt_ctx; AVPacket pkt; av_init_packet(&pkt); @@ -596,8 +601,9 @@ static void show_packets(AVFormatContext *fmt_ctx) probe_array_footer("packets", 0); } -static void show_stream(AVFormatContext *fmt_ctx, int stream_idx) +static void show_stream(InputFile *ifile, int stream_idx) { +AVFormatContext *fmt_ctx = ifile->fmt_ctx; AVStream *stream = fmt_ctx->streams[stream_idx]; AVCodecContext *dec_ctx; const AVCodecDescriptor *codec_desc; @@ -726,8 +732,9 @@ static void show_stream(AVFormatContext *fmt_ctx, int stream_idx) probe_object_footer("stream"); } -static void show_format(AVFormatContext *fmt_ctx) +static void show_format(InputFile *ifile) { +AVFormatContext *fmt_ctx = ifile->fmt_ctx; char val_str[128]; int64_t size = fmt_ctx->pb ? avio_size(fmt_ctx->pb) : -1; @@ -755,7 +762,7 @@ static void show_format(AVFormatContext *fmt_ctx) probe_object_footer("format"); } -static int open_input_file(AVFormatContext **fmt_ctx_ptr, const char *filename) +static int open_input_file(InputFile *ifile, const char *filename) { int err, i; AVFormatContext *fmt_ctx = NULL; @@ -798,14 +805,14 @@ static int open_input_file(AVFormatContext **fmt_ctx_ptr, const char *filename) } } -*fmt_ctx_ptr = fmt_ctx; +ifile->fmt_ctx = fmt_ctx; return 0; } -static void close_input_file(AVFormatContext **ctx_ptr) +static void close_input_file(InputFile *ifile) { int i; -AVFormatContext *fmt_ctx = *ctx_ptr; +AVFormatContext *fmt_ctx = ifile->fmt_ctx; /* close decoder for each stream */ for (i = 0; i < fmt_ctx->nb_streams; i++) { @@ -813,31 +820,32 @@ static void close_input_file(AVFormatContext **ctx_ptr) avcodec_close(stream->codec); } -avformat_close_input(ctx_ptr); +avformat_close_input(&ifile->fmt_ctx); } static int probe_file(const char *filename) { -AVFormatContext *fmt_ctx; +InputFile ifile; int ret, i; -if ((ret = open_input_file(&fmt_ctx, filename))) +ret = open_input_file(&ifile, filename); +if (ret < 0) return ret; if (do_show_format) -show_format(fmt_ctx); +show_format(&ifile); if (do_show_streams) { probe_array_header("streams", 0); -for (i = 0; i < fmt_ctx->nb_streams; i++) -show_stream(fmt_ctx, i); +for (i = 0; i < ifile.fmt_ctx->nb_streams; i++) +show_stream(&ifile, i); probe_array_footer("streams", 0); } if (do_show_packets) -show_packets(fmt_ctx); +show_packets(&ifile); -close_input_file(&fmt_ctx); +close_input_file(&ifile); return 0; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avprobe: add local per-stream state
ffmpeg | branch: master | Anton Khirnov | Wed Feb 24 15:02:48 2016 +0100| [567d6d5f9d1400f00445183b3477391f58979aa3] | committer: Anton Khirnov avprobe: add local per-stream state This will be useful in the following commits. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=567d6d5f9d1400f00445183b3477391f58979aa3 --- avprobe.c | 20 1 file changed, 20 insertions(+) diff --git a/avprobe.c b/avprobe.c index b395e93..189574f 100644 --- a/avprobe.c +++ b/avprobe.c @@ -32,8 +32,15 @@ #include "libavdevice/avdevice.h" #include "cmdutils.h" +typedef struct InputStream { +AVStream *st; +} InputStream; + typedef struct InputFile { AVFormatContext *fmt_ctx; + +InputStream *streams; +int nb_streams; } InputFile; const char program_name[] = "avprobe"; @@ -787,11 +794,20 @@ static int open_input_file(InputFile *ifile, const char *filename) av_dump_format(fmt_ctx, 0, filename, 0); +ifile->streams = av_mallocz_array(fmt_ctx->nb_streams, + sizeof(*ifile->streams)); +if (!ifile->streams) +exit(1); +ifile->nb_streams = fmt_ctx->nb_streams; + /* bind a decoder to each input stream */ for (i = 0; i < fmt_ctx->nb_streams; i++) { +InputStream *ist = &ifile->streams[i]; AVStream *stream = fmt_ctx->streams[i]; AVCodec *codec; +ist->st = stream; + if (stream->codec->codec_id == AV_CODEC_ID_PROBE) { fprintf(stderr, "Failed to probe codec for input stream %d\n", stream->index); @@ -820,6 +836,10 @@ static void close_input_file(InputFile *ifile) avcodec_close(stream->codec); } + +av_freep(&ifile->streams); +ifile->nb_streams = 0; + avformat_close_input(&ifile->fmt_ctx); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] doc/examples/muxing: Add support to pass flags to muxer as since codecpar the codec flags are not available to the muxer anymore
ffmpeg | branch: master | Michael Niedermayer | Mon Apr 11 17:39:14 2016 +0200| [0c79c96cf20f96dfe4b9ce429dafddd1f9ecd1c1] | committer: Michael Niedermayer doc/examples/muxing: Add support to pass flags to muxer as since codecpar the codec flags are not available to the muxer anymore Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0c79c96cf20f96dfe4b9ce429dafddd1f9ecd1c1 --- doc/examples/muxing.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/examples/muxing.c b/doc/examples/muxing.c index 2fbc89b..2fc6f71 100644 --- a/doc/examples/muxing.c +++ b/doc/examples/muxing.c @@ -565,6 +565,7 @@ int main(int argc, char **argv) int have_video = 0, have_audio = 0; int encode_video = 0, encode_audio = 0; AVDictionary *opt = NULL; +int i; /* Initialize libavcodec, and register all codecs and formats. */ av_register_all(); @@ -581,8 +582,9 @@ int main(int argc, char **argv) } filename = argv[1]; -if (argc > 3 && !strcmp(argv[2], "-flags")) { -av_dict_set(&opt, argv[2]+1, argv[3], 0); +for (i = 2; i+1 < argc; i+=2) { +if (!strcmp(argv[i], "-flags") || !strcmp(argv[i], "-fflags")) +av_dict_set(&opt, argv[i]+1, argv[i+1], 0); } /* allocate the output media context */ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] swscale/arm: add yuv2planeX_8_neon
ffmpeg | branch: master | Matthieu Bouron | Fri Apr 8 15:32:24 2016 +| [4c2244127631da592cb4d6bbdab1d6b050ff98cb] | committer: Matthieu Bouron swscale/arm: add yuv2planeX_8_neon > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4c2244127631da592cb4d6bbdab1d6b050ff98cb --- libswscale/arm/Makefile |1 + libswscale/arm/output.S | 78 ++ libswscale/arm/swscale.c |7 + 3 files changed, 86 insertions(+) diff --git a/libswscale/arm/Makefile b/libswscale/arm/Makefile index b8b0134..792da6b 100644 --- a/libswscale/arm/Makefile +++ b/libswscale/arm/Makefile @@ -4,4 +4,5 @@ OBJS+= arm/swscale.o\ NEON-OBJS += arm/rgb2yuv_neon_32.o NEON-OBJS += arm/rgb2yuv_neon_16.o NEON-OBJS += arm/hscale.o \ + arm/output.o \ arm/yuv2rgb_neon.o \ diff --git a/libswscale/arm/output.S b/libswscale/arm/output.S new file mode 100644 index 000..70846de --- /dev/null +++ b/libswscale/arm/output.S @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2016 Clément Bœsch + * Copyright (c) 2016 Matthieu Bouron + * + * 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/arm/asm.S" + +function ff_yuv2planeX_8_neon, export=1 +push {r4-r12, lr} +vpush {q4-q7} +ldr r4, [sp, #104] @ dstW +ldr r5, [sp, #108] @ dither +ldr r6, [sp, #112] @ offset +vld1.8 {d0}, [r5] @ load 8x8-bit dither values +cmp r6, #0 @ check offsetting which can be 0 or 3 only +beq 1f +vext.u8 d0, d0, d0, #3 @ honor offseting which can be 3 only +1: vmovl.u8q0, d0 @ extend dither to 16-bit +vshll.u16 q1, d0, #12@ extend dither to 32-bit with left shift by 12 (part 1) +vshll.u16 q2, d1, #12@ extend dither to 32-bit with left shift by 12 (part 2) +mov r7, #0 @ i = 0 +2: vmov.u8 q3, q1 @ initialize accumulator with dithering values (part 1) +vmov.u8 q4, q2 @ initialize accumulator with dithering values (part 2) +mov r8, r1 @ tmpFilterSize = filterSize +mov r9, r2 @ srcp +mov r10, r0@ filterp +3: ldr r11, [r9], #4 @ get pointer @ src[j] +ldr r12, [r9], #4 @ get pointer @ src[j+1] +add r11, r11, r7, lsl #1 @ &src[j][i] +add r12, r12, r7, lsl #1 @ &src[j+1][i] +vld1.16 {q5}, [r11]@ read 8x16-bit @ src[j ][i + {0..7}]: A,B,C,D,E,F,G,H +vld1.16 {q6}, [r12]@ read 8x16-bit @ src[j+1][i + {0..7}]: I,J,K,L,M,N,O,P +ldr r11, [r10], #4 @ read 2x16-bit coeffs (X, Y) at (filter[j], filter[j+1]) +vmov.16 q7, q5 @ copy 8x16-bit @ src[j ][i + {0..7}] for following inplace zip instruction +vmov.16 q8, q6 @ copy 8x16-bit @ src[j+1][i + {0..7}] for following inplace zip instruction +vzip.16 q7, q8 @ A,I,B,J,C,K,D,L,E,M,F,N,G,O,H,P +vdup.32 q15, r11 @ X,Y,X,Y,X,Y,X,Y +vmull.s16 q9, d14, d30 @ A*X,I*Y,B*X,J*Y +vmull.s
[FFmpeg-cvslog] doc/filters: document testsrc2 source filter
ffmpeg | branch: master | Lou Logan | Fri Apr 8 17:07:10 2016 -0800| [03d8fee912a4a0a5cab7995d5c604e89bc4455b8] | committer: Lou Logan doc/filters: document testsrc2 source filter Signed-off-by: Lou Logan > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=03d8fee912a4a0a5cab7995d5c604e89bc4455b8 --- doc/filters.texi |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/filters.texi b/doc/filters.texi index 82be06d..b4af424 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -14330,7 +14330,8 @@ ffplay -f lavfi life=s=300x200:mold=10:r=60:ratio=0.1:death_color=#C83232:life_c @anchor{smptebars} @anchor{smptehdbars} @anchor{testsrc} -@section allrgb, allyuv, color, haldclutsrc, nullsrc, rgbtestsrc, smptebars, smptehdbars, testsrc +@anchor{testsrc2} +@section allrgb, allyuv, color, haldclutsrc, nullsrc, rgbtestsrc, smptebars, smptehdbars, testsrc, testsrc2 The @code{allrgb} source returns frames of size 4096x4096 of all rgb colors. @@ -14359,6 +14360,10 @@ The @code{testsrc} source generates a test video pattern, showing a color pattern, a scrolling gradient and a timestamp. This is mainly intended for testing purposes. +The @code{testsrc2} source is similar to testsrc, but supports more +pixel formats instead of just @code{rgb24}. This allows using it as an +input for other tests without requiring a format conversion. + The sources accept the following parameters: @table @option ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/concatdec: Use correct stream count on close
ffmpeg | branch: master | Timo Rothenpieler | Mon Apr 11 19:27:18 2016 +0200| [901b0f1a219e96d008c801dbd99bb21aae0aea4e] | committer: Timo Rothenpieler avformat/concatdec: Use correct stream count on close > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=901b0f1a219e96d008c801dbd99bb21aae0aea4e --- libavformat/concatdec.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c index 50d6689..e3418e1 100644 --- a/libavformat/concatdec.c +++ b/libavformat/concatdec.c @@ -364,7 +364,7 @@ static int concat_read_close(AVFormatContext *avf) for (i = 0; i < cat->nb_files; i++) { av_freep(&cat->files[i].url); -for (j = 0; j < cat->avf->nb_streams; j++) { +for (j = 0; j < cat->files[i].nb_streams; j++) { if (cat->files[i].streams[j].avctx) avcodec_free_context(&cat->files[i].streams[j].avctx); if (cat->files[i].streams[j].bsf) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/utils: use av_codec_g/set_lowres()
ffmpeg | branch: master | Michael Niedermayer | Tue Apr 12 03:55:19 2016 +0200| [196cfc278d2bce03d03ef95b5b34dfd9689ddb60] | committer: Michael Niedermayer avformat/utils: use av_codec_g/set_lowres() Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=196cfc278d2bce03d03ef95b5b34dfd9689ddb60 --- libavformat/utils.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavformat/utils.c b/libavformat/utils.c index 229c077..d6aba5a 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -3766,7 +3766,7 @@ FF_ENABLE_DEPRECATION_WARNINGS if (ret < 0) goto find_stream_info_err; // The decoder might reduce the video size by the lowres factor. -if (st->internal->avctx->lowres && orig_w) { +if (av_codec_get_lowres(st->internal->avctx) && orig_w) { st->codecpar->width = orig_w; st->codecpar->height = orig_h; } @@ -3780,8 +3780,8 @@ FF_DISABLE_DEPRECATION_WARNINGS // The old API (AVStream.codec) "requires" the resolution to be adjusted // by the lowres factor. -if (st->internal->avctx->lowres && st->internal->avctx->width) { -st->codec->lowres = st->internal->avctx->lowres; +if (av_codec_get_lowres(st->internal->avctx) && st->internal->avctx->width) { +av_codec_set_lowres(st->codec, av_codec_get_lowres(st->internal->avctx)); st->codec->width = st->internal->avctx->width; st->codec->height = st->internal->avctx->height; st->codec->coded_width = st->internal->avctx->coded_width; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog