[FFmpeg-cvslog] avcodec/shorten: make max frame size bigger if custom block size was used
ffmpeg | branch: master | Paul B Mahol | Wed Apr 27 09:08:45 2016 +0200| [1f62a6e7803e4b354b2f1a7c9a5d617efa3b] | committer: Paul B Mahol avcodec/shorten: make max frame size bigger if custom block size was used Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1f62a6e7803e4b354b2f1a7c9a5d617efa3b --- libavcodec/shorten.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c index 061a74b..e4cef61 100644 --- a/libavcodec/shorten.c +++ b/libavcodec/shorten.c @@ -558,7 +558,7 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data, int max_framesize; void *tmp_ptr; -max_framesize = FFMAX(s->max_framesize, s->blocksize * s->channels * 2); +max_framesize = FFMAX(s->max_framesize, s->blocksize * s->channels * 8); tmp_ptr = av_fast_realloc(s->bitstream, &s->allocated_bitstream_size, max_framesize + AV_INPUT_BUFFER_PADDING_SIZE); if (!tmp_ptr) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/alsdec: Fix bitstream reading
ffmpeg | branch: master | Umair Khan | Wed Apr 27 09:22:18 2016 +0530| [a2ba50b03a085993eb5bb9baf947e21d1c0060e1] | committer: Michael Niedermayer avcodec/alsdec: Fix bitstream reading Signed-off-by: Umair Khan Reviewed-by: Thilo Borgmann Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a2ba50b03a085993eb5bb9baf947e21d1c0060e1 --- libavcodec/alsdec.c |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c index 89e281a..842fc7d 100644 --- a/libavcodec/alsdec.c +++ b/libavcodec/alsdec.c @@ -867,9 +867,6 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd) *current_res++ = decode_rice(gb, s[sb]); } -if (!sconf->mc_coding || ctx->js_switch) -align_get_bits(gb); - return 0; } @@ -989,6 +986,7 @@ static int read_block(ALSDecContext *ctx, ALSBlockData *bd) { int ret; GetBitContext *gb= &ctx->gb; +ALSSpecificConfig *sconf = &ctx->sconf; *bd->shift_lsbs = 0; // read block type flag and read the samples accordingly @@ -998,6 +996,9 @@ static int read_block(ALSDecContext *ctx, ALSBlockData *bd) ret = read_const_block_data(ctx, bd); } +if (!sconf->mc_coding || ctx->js_switch) +align_get_bits(gb); + return ret; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] qsv: Fix wrong ticks_per_frame for H.264
ffmpeg | branch: master | Ivan Uskov | Tue Apr 26 10:13:04 2016 -0400| [b577a54a7c83986e59d2227c00a0227911c75452] | committer: Derek Buitenhuis qsv: Fix wrong ticks_per_frame for H.264 For H.264 stream ticks_per_frame should be 2, as per the docs. Signed-off-by: Derek Buitenhuis > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b577a54a7c83986e59d2227c00a0227911c75452 --- libavcodec/qsvdec_h2645.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavcodec/qsvdec_h2645.c b/libavcodec/qsvdec_h2645.c index a396f31..fda827c 100644 --- a/libavcodec/qsvdec_h2645.c +++ b/libavcodec/qsvdec_h2645.c @@ -82,9 +82,11 @@ static av_cold int qsv_decode_init(AVCodecContext *avctx) } } -if (avctx->codec_id == AV_CODEC_ID_H264) +if (avctx->codec_id == AV_CODEC_ID_H264) { s->bsf = av_bitstream_filter_init("h264_mp4toannexb"); -else +//regarding ticks_per_frame description, should be 2 for h.264: +avctx->ticks_per_frame = 2; +} else s->bsf = av_bitstream_filter_init("hevc_mp4toannexb"); if (!s->bsf) { ret = AVERROR(ENOMEM); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] h264: remove the svq3-specific code
ffmpeg | branch: master | Anton Khirnov | Tue Mar 22 15:22:43 2016 +0100| [9b30f8dd8fa5bef5f16904cb98745b4a58f8f776] | committer: Anton Khirnov h264: remove the svq3-specific code > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9b30f8dd8fa5bef5f16904cb98745b4a58f8f776 --- libavcodec/h264.c |1 - libavcodec/h264_mb.c | 150 ++--- libavcodec/h264_mb_template.c | 62 ++--- 3 files changed, 86 insertions(+), 127 deletions(-) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 5332203..49b3f93 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -46,7 +46,6 @@ #include "mpegutils.h" #include "profiles.h" #include "rectangle.h" -#include "svq3.h" #include "thread.h" #include diff --git a/libavcodec/h264_mb.c b/libavcodec/h264_mb.c index f94333b..60068929 100644 --- a/libavcodec/h264_mb.c +++ b/libavcodec/h264_mb.c @@ -33,7 +33,6 @@ #include "avcodec.h" #include "h264.h" #include "qpeldsp.h" -#include "svq3.h" #include "thread.h" static inline int get_lowest_part_list_y(H264SliceContext *sl, @@ -611,8 +610,7 @@ static av_always_inline void dctcoef_set(int16_t *mb, int high_bit_depth, static av_always_inline void hl_decode_mb_predict_luma(const H264Context *h, H264SliceContext *sl, - int mb_type, int is_h264, - int simple, + int mb_type, int simple, int transform_bypass, int pixel_shift, const int *block_offset, @@ -687,48 +685,40 @@ static av_always_inline void hl_decode_mb_predict_luma(const H264Context *h, h->hpc.pred4x4[dir](ptr, topright, linesize); nnz = sl->non_zero_count_cache[scan8[i + p * 16]]; if (nnz) { -if (is_h264) { -if (nnz == 1 && dctcoef_get(sl->mb, pixel_shift, i * 16 + p * 256)) -idct_dc_add(ptr, sl->mb + (i * 16 + p * 256 << pixel_shift), linesize); -else -idct_add(ptr, sl->mb + (i * 16 + p * 256 << pixel_shift), linesize); -} else if (CONFIG_SVQ3_DECODER) -ff_svq3_add_idct_c(ptr, sl->mb + i * 16 + p * 256, linesize, qscale, 0); +if (nnz == 1 && dctcoef_get(sl->mb, pixel_shift, i * 16 + p * 256)) +idct_dc_add(ptr, sl->mb + (i * 16 + p * 256 << pixel_shift), linesize); +else +idct_add(ptr, sl->mb + (i * 16 + p * 256 << pixel_shift), linesize); } } } } } else { h->hpc.pred16x16[sl->intra16x16_pred_mode](dest_y, linesize); -if (is_h264) { -if (sl->non_zero_count_cache[scan8[LUMA_DC_BLOCK_INDEX + p]]) { -if (!transform_bypass) -h->h264dsp.h264_luma_dc_dequant_idct(sl->mb + (p * 256 << pixel_shift), - sl->mb_luma_dc[p], - h->dequant4_coeff[p][qscale][0]); -else { -static const uint8_t dc_mapping[16] = { - 0 * 16, 1 * 16, 4 * 16, 5 * 16, - 2 * 16, 3 * 16, 6 * 16, 7 * 16, - 8 * 16, 9 * 16, 12 * 16, 13 * 16, -10 * 16, 11 * 16, 14 * 16, 15 * 16 -}; -for (i = 0; i < 16; i++) -dctcoef_set(sl->mb + (p * 256 << pixel_shift), -pixel_shift, dc_mapping[i], -dctcoef_get(sl->mb_luma_dc[p], -pixel_shift, i)); -} +if (sl->non_zero_count_cache[scan8[LUMA_DC_BLOCK_INDEX + p]]) { +if (!transform_bypass) +h->h264dsp.h264_luma_dc_dequant_idct(sl->mb + (p * 256 << pixel_shift), + sl->mb_luma_dc[p], + h->dequant4_coeff[p][qscale][0]); +else { +static const uint8_t dc_mapping[16] = { + 0 * 16, 1 * 16, 4 * 16, 5 * 16, + 2 * 16, 3 * 16, 6 * 16, 7 * 16, + 8 * 16, 9 * 16, 12 * 16, 13 * 16, +10 * 16, 11 * 16, 14 * 16, 15 * 16 +}; +for (i = 0; i < 16; i++) +dctcoef_set(sl->mb + (p * 256
[FFmpeg-cvslog] svq3: eliminate write_back_intra_pred_mode() usage
ffmpeg | branch: master | Anton Khirnov | Tue Mar 22 15:52:45 2016 +0100| [c2a4ca944d9029a3c162f8f3ddd317b83a7bd600] | committer: Anton Khirnov svq3: eliminate write_back_intra_pred_mode() usage This function depends on the h264 internals and is so tiny that just copying the code out is the simplest replacement. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c2a4ca944d9029a3c162f8f3ddd317b83a7bd600 --- libavcodec/svq3.c |8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index 9d99da5..f3582f6 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -714,6 +714,9 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type) mb_type = MB_TYPE_16x16; } else if (mb_type == 8 || mb_type == 33) { /* INTRA4x4 */ +int8_t *i4x4 = sl->intra4x4_pred_mode + h->mb2br_xy[sl->mb_xy]; +int8_t *i4x4_cache = sl->intra4x4_pred_mode_cache; + memset(sl->intra4x4_pred_mode_cache, -1, 8 * 5 * sizeof(int8_t)); if (mb_type == 8) { @@ -759,7 +762,10 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type) memset(&sl->intra4x4_pred_mode_cache[scan8[0] + 8 * i], DC_PRED, 4); } -write_back_intra_pred_mode(h, sl); +AV_COPY32(i4x4, i4x4_cache + 4 + 8 * 4); +i4x4[4] = i4x4_cache[7 + 8 * 3]; +i4x4[5] = i4x4_cache[7 + 8 * 2]; +i4x4[6] = i4x4_cache[7 + 8 * 1]; if (mb_type == 8) { ff_h264_check_intra4x4_pred_mode(h, sl); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] svq3: add all the required dsp contexts into SVQ3Context
ffmpeg | branch: master | Anton Khirnov | Tue Mar 22 15:32:57 2016 +0100| [c73fb9efb22c8d66d24de2716f7f9970f234c3c3] | committer: Anton Khirnov svq3: add all the required dsp contexts into SVQ3Context Stop using the H264Context ones, to allow removing the H264Context dependency. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c73fb9efb22c8d66d24de2716f7f9970f234c3c3 --- libavcodec/svq3.c | 42 +++--- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index df4616c..9d99da5 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -68,8 +68,13 @@ typedef struct SVQ3Context { H264Context h; + +H264DSPContext h264dsp; +H264PredContext hpc; HpelDSPContext hdsp; TpelDSPContext tdsp; +VideoDSPContext vdsp; + H264Picture *cur_pic; H264Picture *next_pic; H264Picture *last_pic; @@ -318,7 +323,7 @@ static inline void svq3_mc_dir_part(SVQ3Context *s, src = pic->f->data[0] + mx + my * sl->linesize; if (emu) { -h->vdsp.emulated_edge_mc(sl->edge_emu_buffer, src, +s->vdsp.emulated_edge_mc(sl->edge_emu_buffer, src, sl->linesize, sl->linesize, width + 1, height + 1, mx, my, s->h_edge_pos, s->v_edge_pos); @@ -345,7 +350,7 @@ static inline void svq3_mc_dir_part(SVQ3Context *s, src = pic->f->data[i] + mx + my * sl->uvlinesize; if (emu) { -h->vdsp.emulated_edge_mc(sl->edge_emu_buffer, src, +s->vdsp.emulated_edge_mc(sl->edge_emu_buffer, src, sl->uvlinesize, sl->uvlinesize, width + 1, height + 1, mx, my, (s->h_edge_pos >> 1), @@ -501,7 +506,8 @@ static av_always_inline int dctcoef_get(int16_t *mb, int index) return AV_RN16A(mb + index); } -static av_always_inline void hl_decode_mb_predict_luma(const H264Context *h, +static av_always_inline void hl_decode_mb_predict_luma(SVQ3Context *s, + const H264Context *h, H264SliceContext *sl, int mb_type, const int *block_offset, @@ -529,19 +535,19 @@ static av_always_inline void hl_decode_mb_predict_luma(const H264Context *h, } else topright = NULL; -h->hpc.pred4x4[dir](ptr, topright, linesize); +s->hpc.pred4x4[dir](ptr, topright, linesize); nnz = sl->non_zero_count_cache[scan8[i]]; if (nnz) { svq3_add_idct_c(ptr, sl->mb + i * 16, linesize, qscale, 0); } } } else { -h->hpc.pred16x16[sl->intra16x16_pred_mode](dest_y, linesize); +s->hpc.pred16x16[sl->intra16x16_pred_mode](dest_y, linesize); svq3_luma_dc_dequant_idct_c(sl->mb, sl->mb_luma_dc[0], qscale); } } -static void hl_decode_mb(const H264Context *h, H264SliceContext *sl) +static void hl_decode_mb(SVQ3Context *s, const H264Context *h, H264SliceContext *sl) { const int mb_x= sl->mb_x; const int mb_y= sl->mb_y; @@ -557,8 +563,8 @@ static void hl_decode_mb(const H264Context *h, H264SliceContext *sl) dest_cb = h->cur_pic.f->data[1] + mb_x * 8 + mb_y * sl->uvlinesize * block_h; dest_cr = h->cur_pic.f->data[2] + mb_x * 8 + mb_y * sl->uvlinesize * block_h; -h->vdsp.prefetch(dest_y + (sl->mb_x & 3) * 4 * sl->linesize + 64, sl->linesize, 4); -h->vdsp.prefetch(dest_cb + (sl->mb_x & 7) * sl->uvlinesize + 64, dest_cr - dest_cb, 2); +s->vdsp.prefetch(dest_y + (sl->mb_x & 3) * 4 * sl->linesize + 64, sl->linesize, 4); +s->vdsp.prefetch(dest_cb + (sl->mb_x & 7) * sl->uvlinesize + 64, dest_cr - dest_cb, 2); h->list_counts[mb_xy] = sl->list_count; @@ -566,19 +572,19 @@ static void hl_decode_mb(const H264Context *h, H264SliceContext *sl) uvlinesize = sl->mb_uvlinesize = sl->uvlinesize; if (IS_INTRA(mb_type)) { -h->hpc.pred8x8[sl->chroma_pred_mode](dest_cb, uvlinesize); -h->hpc.pred8x8[sl->chroma_pred_mode](dest_cr, uvlinesize); +s->hpc.pred8x8[sl->chroma_pred_mode](dest_cb, uvlinesize); +s->hpc.pred8x8[sl->chroma_pred_mode](dest_cr, uvlinesize); -hl_decode_mb_predict_luma(h, sl, mb_type, block_offset, linesize, dest_y); +hl_decode_mb_predict_luma(s, h, sl, mb_type, block_offset, linesize, dest_y); } hl_decode_mb_idct_luma(h, sl, mb_type, block_offset, linesize, dest_y); if (sl->cbp & 0x30) { uint8_t *dest[2] = { dest_cb, dest_cr }; -h->h264dsp.h264_chroma_dc_dequant_idct(sl->mb + 16 * 16 * 1, +s->h264dsp.h264_chro
[FFmpeg-cvslog] svq3: make the dsp functions static
ffmpeg | branch: master | Anton Khirnov | Tue Mar 22 15:26:39 2016 +0100| [15b0517da986b312fc2fcb364a92db328380b15b] | committer: Anton Khirnov svq3: make the dsp functions static There is no need for them to be extern anymore. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=15b0517da986b312fc2fcb364a92db328380b15b --- libavcodec/svq3.c | 21 + libavcodec/svq3.h | 27 --- 2 files changed, 9 insertions(+), 39 deletions(-) diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index 7aab4e0..df4616c 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -60,7 +60,6 @@ #endif #include "svq1.h" -#include "svq3.h" /** * @file @@ -160,7 +159,7 @@ static const uint32_t svq3_dequant_coeff[32] = { 61694, 68745, 77615, 89113, 100253, 109366, 126635, 141533 }; -void ff_svq3_luma_dc_dequant_idct_c(int16_t *output, int16_t *input, int qp) +static void svq3_luma_dc_dequant_idct_c(int16_t *output, int16_t *input, int qp) { const int qmul = svq3_dequant_coeff[qp]; #define stride 16 @@ -195,8 +194,8 @@ void ff_svq3_luma_dc_dequant_idct_c(int16_t *output, int16_t *input, int qp) } #undef stride -void ff_svq3_add_idct_c(uint8_t *dst, int16_t *block, -int stride, int qp, int dc) +static void svq3_add_idct_c(uint8_t *dst, int16_t *block, +int stride, int qp, int dc) { const int qmul = svq3_dequant_coeff[qp]; int i; @@ -491,8 +490,8 @@ static av_always_inline void hl_decode_mb_idct_luma(const H264Context *h, H264Sl for (i = 0; i < 16; i++) if (sl->non_zero_count_cache[scan8[i]] || sl->mb[i * 16]) { uint8_t *const ptr = dest_y + block_offset[i]; -ff_svq3_add_idct_c(ptr, sl->mb + i * 16, linesize, - sl->qscale, IS_INTRA(mb_type) ? 1 : 0); +svq3_add_idct_c(ptr, sl->mb + i * 16, linesize, +sl->qscale, IS_INTRA(mb_type) ? 1 : 0); } } } @@ -533,13 +532,12 @@ static av_always_inline void hl_decode_mb_predict_luma(const H264Context *h, h->hpc.pred4x4[dir](ptr, topright, linesize); nnz = sl->non_zero_count_cache[scan8[i]]; if (nnz) { -ff_svq3_add_idct_c(ptr, sl->mb + i * 16, linesize, qscale, 0); +svq3_add_idct_c(ptr, sl->mb + i * 16, linesize, qscale, 0); } } } else { h->hpc.pred16x16[sl->intra16x16_pred_mode](dest_y, linesize); -ff_svq3_luma_dc_dequant_idct_c(sl->mb, - sl->mb_luma_dc[0], qscale); +svq3_luma_dc_dequant_idct_c(sl->mb, sl->mb_luma_dc[0], qscale); } } @@ -586,9 +584,8 @@ static void hl_decode_mb(const H264Context *h, H264SliceContext *sl) for (i = j * 16; i < j * 16 + 4; i++) if (sl->non_zero_count_cache[scan8[i]] || sl->mb[i * 16]) { uint8_t *const ptr = dest[j - 1] + block_offset[i]; -ff_svq3_add_idct_c(ptr, sl->mb + i * 16, - uvlinesize, - ff_h264_chroma_qp[0][sl->qscale + 12] - 12, 2); +svq3_add_idct_c(ptr, sl->mb + i * 16, +uvlinesize, ff_h264_chroma_qp[0][sl->qscale + 12] - 12, 2); } } } diff --git a/libavcodec/svq3.h b/libavcodec/svq3.h deleted file mode 100644 index a20e620..000 --- a/libavcodec/svq3.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This file is part of Libav. - * - * Libav 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. - * - * Libav 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 Libav; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef AVCODEC_SVQ3_H -#define AVCODEC_SVQ3_H - -#include - -void ff_svq3_luma_dc_dequant_idct_c(int16_t *output, int16_t *input, int qp); -void ff_svq3_add_idct_c(uint8_t *dst, int16_t *block, int stride, int qp, int dc); - -#endif /* AVCODEC_SVQ3_H */ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] svq3: move mb_{x,y,xy} to SVQ3Context
ffmpeg | branch: master | Anton Khirnov | Tue Mar 22 15:54:20 2016 +0100| [1877712c586df2261f2806f45388c77592b89d1e] | committer: Anton Khirnov svq3: move mb_{x,y,xy} to SVQ3Context This will allow removing the H264Context dependency in the future. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1877712c586df2261f2806f45388c77592b89d1e --- libavcodec/svq3.c | 83 +++-- 1 file changed, 43 insertions(+), 40 deletions(-) diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index f3582f6..2bb957d 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -90,6 +90,9 @@ typedef struct SVQ3Context { int h_edge_pos; int v_edge_pos; int last_frame_output; + +int mb_x, mb_y; +int mb_xy; } SVQ3Context; #define FULLPEL_MODE 1 @@ -385,11 +388,11 @@ static inline int svq3_mc_dir(SVQ3Context *s, int size, int mode, for (i = 0; i < 16; i += part_height) for (j = 0; j < 16; j += part_width) { -const int b_xy = (4 * sl->mb_x + (j >> 2)) + - (4 * sl->mb_y + (i >> 2)) * h->b_stride; +const int b_xy = (4 * s->mb_x + (j >> 2)) + + (4 * s->mb_y + (i >> 2)) * h->b_stride; int dxy; -x = 16 * sl->mb_x + j; -y = 16 * sl->mb_y + i; +x = 16 * s->mb_x + j; +y = 16 * s->mb_y + i; k = (j >> 2 & 1) + (i >> 1 & 2) + (j >> 1 & 4) + (i & 8); @@ -526,7 +529,7 @@ static av_always_inline void hl_decode_mb_predict_luma(SVQ3Context *s, int nnz, tr; if (dir == DIAG_DOWN_LEFT_PRED || dir == VERT_LEFT_PRED) { const int topright_avail = (sl->topright_samples_available << i) & 0x8000; -assert(sl->mb_y || linesize <= block_offset[i]); +assert(s->mb_y || linesize <= block_offset[i]); if (!topright_avail) { tr = ptr[3 - linesize] * 0x01010101u; topright = (uint8_t *)&tr; @@ -549,9 +552,9 @@ static av_always_inline void hl_decode_mb_predict_luma(SVQ3Context *s, static void hl_decode_mb(SVQ3Context *s, const H264Context *h, H264SliceContext *sl) { -const int mb_x= sl->mb_x; -const int mb_y= sl->mb_y; -const int mb_xy = sl->mb_xy; +const int mb_x= s->mb_x; +const int mb_y= s->mb_y; +const int mb_xy = s->mb_xy; const int mb_type = h->cur_pic.mb_type[mb_xy]; uint8_t *dest_y, *dest_cb, *dest_cr; int linesize, uvlinesize; @@ -563,8 +566,8 @@ static void hl_decode_mb(SVQ3Context *s, const H264Context *h, H264SliceContext dest_cb = h->cur_pic.f->data[1] + mb_x * 8 + mb_y * sl->uvlinesize * block_h; dest_cr = h->cur_pic.f->data[2] + mb_x * 8 + mb_y * sl->uvlinesize * block_h; -s->vdsp.prefetch(dest_y + (sl->mb_x & 3) * 4 * sl->linesize + 64, sl->linesize, 4); -s->vdsp.prefetch(dest_cb + (sl->mb_x & 7) * sl->uvlinesize + 64, dest_cr - dest_cb, 2); +s->vdsp.prefetch(dest_y + (s->mb_x & 3) * 4 * sl->linesize + 64, sl->linesize, 4); +s->vdsp.prefetch(dest_cb + (s->mb_x & 7) * sl->uvlinesize + 64, dest_cr - dest_cb, 2); h->list_counts[mb_xy] = sl->list_count; @@ -605,21 +608,21 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type) int cbp = 0; uint32_t vlc; int8_t *top, *left; -const int mb_xy = sl->mb_xy; -const int b_xy = 4 * sl->mb_x + 4 * sl->mb_y * h->b_stride; +const int mb_xy = s->mb_xy; +const int b_xy = 4 * s->mb_x + 4 * s->mb_y * h->b_stride; -sl->top_samples_available = (sl->mb_y == 0) ? 0x33FF : 0x; -sl->left_samples_available = (sl->mb_x == 0) ? 0x5F5F : 0x; +sl->top_samples_available = (s->mb_y == 0) ? 0x33FF : 0x; +sl->left_samples_available = (s->mb_x == 0) ? 0x5F5F : 0x; sl->topright_samples_available = 0x; if (mb_type == 0) { /* SKIP */ if (h->pict_type == AV_PICTURE_TYPE_P || s->next_pic->mb_type[mb_xy] == -1) { -svq3_mc_dir_part(s, 16 * sl->mb_x, 16 * sl->mb_y, 16, 16, +svq3_mc_dir_part(s, 16 * s->mb_x, 16 * s->mb_y, 16, 16, 0, 0, 0, 0, 0, 0); if (h->pict_type == AV_PICTURE_TYPE_B) -svq3_mc_dir_part(s, 16 * sl->mb_x, 16 * sl->mb_y, 16, 16, +svq3_mc_dir_part(s, 16 * s->mb_x, 16 * s->mb_y, 16, 16, 0, 0, 0, 0, 1, 1); mb_type = MB_TYPE_SKIP; @@ -651,7 +654,7 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type) */ for (m = 0; m < 2; m++) { -if (sl->mb_x > 0 && sl->intra4x4_pred_mode[h->mb2br_xy[mb_xy - 1] + 6] != -1) { +if (s->mb_x > 0 && sl->intra4x4_pred_mode[h->mb2br_xy[mb_xy - 1] + 6] != -1) { for (i = 0; i
[FFmpeg-cvslog] Merge commit 'c2a4ca944d9029a3c162f8f3ddd317b83a7bd600'
ffmpeg | branch: master | Derek Buitenhuis | Wed Apr 27 16:07:03 2016 +0100| [7dca13428541f358101c92d61d146203d4b7acf8] | committer: Derek Buitenhuis Merge commit 'c2a4ca944d9029a3c162f8f3ddd317b83a7bd600' * commit 'c2a4ca944d9029a3c162f8f3ddd317b83a7bd600': svq3: eliminate write_back_intra_pred_mode() usage Merged-by: Derek Buitenhuis > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7dca13428541f358101c92d61d146203d4b7acf8 --- libavcodec/svq3.c |8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index e7c6e27..d671050 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -721,6 +721,9 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type) mb_type = MB_TYPE_16x16; } else if (mb_type == 8 || mb_type == 33) { /* INTRA4x4 */ +int8_t *i4x4 = sl->intra4x4_pred_mode + h->mb2br_xy[sl->mb_xy]; +int8_t *i4x4_cache = sl->intra4x4_pred_mode_cache; + memset(sl->intra4x4_pred_mode_cache, -1, 8 * 5 * sizeof(int8_t)); if (mb_type == 8) { @@ -766,7 +769,10 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type) memset(&sl->intra4x4_pred_mode_cache[scan8[0] + 8 * i], DC_PRED, 4); } -write_back_intra_pred_mode(h, sl); +AV_COPY32(i4x4, i4x4_cache + 4 + 8 * 4); +i4x4[4] = i4x4_cache[7 + 8 * 3]; +i4x4[5] = i4x4_cache[7 + 8 * 2]; +i4x4[6] = i4x4_cache[7 + 8 * 1]; if (mb_type == 8) { ff_h264_check_intra4x4_pred_mode(h, sl); == ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '1877712c586df2261f2806f45388c77592b89d1e'
ffmpeg | branch: master | Derek Buitenhuis | Wed Apr 27 16:07:35 2016 +0100| [c18535399d2597afd8855ccaa4416b0999d0d7f9] | committer: Derek Buitenhuis Merge commit '1877712c586df2261f2806f45388c77592b89d1e' * commit '1877712c586df2261f2806f45388c77592b89d1e': svq3: move mb_{x,y,xy} to SVQ3Context Merged-by: Derek Buitenhuis > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c18535399d2597afd8855ccaa4416b0999d0d7f9 --- libavcodec/svq3.c | 81 +++-- 1 file changed, 42 insertions(+), 39 deletions(-) diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index d671050..0cf9159 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -93,6 +93,9 @@ typedef struct SVQ3Context { int h_edge_pos; int v_edge_pos; int last_frame_output; + +int mb_x, mb_y; +int mb_xy; } SVQ3Context; #define FULLPEL_MODE 1 @@ -392,11 +395,11 @@ static inline int svq3_mc_dir(SVQ3Context *s, int size, int mode, for (i = 0; i < 16; i += part_height) for (j = 0; j < 16; j += part_width) { -const int b_xy = (4 * sl->mb_x + (j >> 2)) + - (4 * sl->mb_y + (i >> 2)) * h->b_stride; +const int b_xy = (4 * s->mb_x + (j >> 2)) + + (4 * s->mb_y + (i >> 2)) * h->b_stride; int dxy; -x = 16 * sl->mb_x + j; -y = 16 * sl->mb_y + i; +x = 16 * s->mb_x + j; +y = 16 * s->mb_y + i; k = (j >> 2 & 1) + (i >> 1 & 2) + (j >> 1 & 4) + (i & 8); @@ -533,7 +536,7 @@ static av_always_inline void hl_decode_mb_predict_luma(SVQ3Context *s, int nnz, tr; if (dir == DIAG_DOWN_LEFT_PRED || dir == VERT_LEFT_PRED) { const int topright_avail = (sl->topright_samples_available << i) & 0x8000; -av_assert2(sl->mb_y || linesize <= block_offset[i]); +av_assert2(s->mb_y || linesize <= block_offset[i]); if (!topright_avail) { tr = ptr[3 - linesize] * 0x01010101u; topright = (uint8_t *)&tr; @@ -556,9 +559,9 @@ static av_always_inline void hl_decode_mb_predict_luma(SVQ3Context *s, static void hl_decode_mb(SVQ3Context *s, const H264Context *h, H264SliceContext *sl) { -const int mb_x= sl->mb_x; -const int mb_y= sl->mb_y; -const int mb_xy = sl->mb_xy; +const int mb_x= s->mb_x; +const int mb_y= s->mb_y; +const int mb_xy = s->mb_xy; const int mb_type = h->cur_pic.mb_type[mb_xy]; uint8_t *dest_y, *dest_cb, *dest_cr; int linesize, uvlinesize; @@ -570,8 +573,8 @@ static void hl_decode_mb(SVQ3Context *s, const H264Context *h, H264SliceContext dest_cb = h->cur_pic.f->data[1] + mb_x * 8 + mb_y * sl->uvlinesize * block_h; dest_cr = h->cur_pic.f->data[2] + mb_x * 8 + mb_y * sl->uvlinesize * block_h; -s->vdsp.prefetch(dest_y + (sl->mb_x & 3) * 4 * sl->linesize + 64, sl->linesize, 4); -s->vdsp.prefetch(dest_cb + (sl->mb_x & 7) * sl->uvlinesize + 64, dest_cr - dest_cb, 2); +s->vdsp.prefetch(dest_y + (s->mb_x & 3) * 4 * sl->linesize + 64, sl->linesize, 4); +s->vdsp.prefetch(dest_cb + (s->mb_x & 7) * sl->uvlinesize + 64, dest_cr - dest_cb, 2); h->list_counts[mb_xy] = sl->list_count; @@ -612,21 +615,21 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type) int cbp = 0; uint32_t vlc; int8_t *top, *left; -const int mb_xy = sl->mb_xy; -const int b_xy = 4 * sl->mb_x + 4 * sl->mb_y * h->b_stride; +const int mb_xy = s->mb_xy; +const int b_xy = 4 * s->mb_x + 4 * s->mb_y * h->b_stride; -sl->top_samples_available = (sl->mb_y == 0) ? 0x33FF : 0x; -sl->left_samples_available = (sl->mb_x == 0) ? 0x5F5F : 0x; +sl->top_samples_available = (s->mb_y == 0) ? 0x33FF : 0x; +sl->left_samples_available = (s->mb_x == 0) ? 0x5F5F : 0x; sl->topright_samples_available = 0x; if (mb_type == 0) { /* SKIP */ if (h->pict_type == AV_PICTURE_TYPE_P || s->next_pic->mb_type[mb_xy] == -1) { -svq3_mc_dir_part(s, 16 * sl->mb_x, 16 * sl->mb_y, 16, 16, +svq3_mc_dir_part(s, 16 * s->mb_x, 16 * s->mb_y, 16, 16, 0, 0, 0, 0, 0, 0); if (h->pict_type == AV_PICTURE_TYPE_B) -svq3_mc_dir_part(s, 16 * sl->mb_x, 16 * sl->mb_y, 16, 16, +svq3_mc_dir_part(s, 16 * s->mb_x, 16 * s->mb_y, 16, 16, 0, 0, 0, 0, 1, 1); mb_type = MB_TYPE_SKIP; @@ -658,7 +661,7 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type) */ for (m = 0; m < 2; m++) { -if (sl->mb_x > 0 && sl->intra4x4_pred_mode[h->mb2br_xy[mb_xy - 1] + 6] != -1) { +if (s->mb_x > 0 && sl->
[FFmpeg-cvslog] Merge commit '9b30f8dd8fa5bef5f16904cb98745b4a58f8f776'
ffmpeg | branch: master | Derek Buitenhuis | Wed Apr 27 15:48:00 2016 +0100| [d6f01c61edee80705eca7ba1ca455b47b3648644] | committer: Derek Buitenhuis Merge commit '9b30f8dd8fa5bef5f16904cb98745b4a58f8f776' * commit '9b30f8dd8fa5bef5f16904cb98745b4a58f8f776': h264: remove the svq3-specific code Merged-by: Derek Buitenhuis > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d6f01c61edee80705eca7ba1ca455b47b3648644 --- libavcodec/h264.c |1 - libavcodec/h264_mb.c | 150 ++--- libavcodec/h264_mb_template.c | 62 ++--- 3 files changed, 86 insertions(+), 127 deletions(-) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index a85953e..5a0f0bb 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -48,7 +48,6 @@ #include "mpegutils.h" #include "profiles.h" #include "rectangle.h" -#include "svq3.h" #include "thread.h" #include "vdpau_compat.h" diff --git a/libavcodec/h264_mb.c b/libavcodec/h264_mb.c index 8791e2e..3c5c932 100644 --- a/libavcodec/h264_mb.c +++ b/libavcodec/h264_mb.c @@ -33,7 +33,6 @@ #include "avcodec.h" #include "h264.h" #include "qpeldsp.h" -#include "svq3.h" #include "thread.h" static inline int get_lowest_part_list_y(H264SliceContext *sl, @@ -612,8 +611,7 @@ static av_always_inline void dctcoef_set(int16_t *mb, int high_bit_depth, static av_always_inline void hl_decode_mb_predict_luma(const H264Context *h, H264SliceContext *sl, - int mb_type, int is_h264, - int simple, + int mb_type, int simple, int transform_bypass, int pixel_shift, const int *block_offset, @@ -693,48 +691,40 @@ static av_always_inline void hl_decode_mb_predict_luma(const H264Context *h, h->hpc.pred4x4[dir](ptr, topright, linesize); nnz = sl->non_zero_count_cache[scan8[i + p * 16]]; if (nnz) { -if (is_h264) { -if (nnz == 1 && dctcoef_get(sl->mb, pixel_shift, i * 16 + p * 256)) -idct_dc_add(ptr, sl->mb + (i * 16 + p * 256 << pixel_shift), linesize); -else -idct_add(ptr, sl->mb + (i * 16 + p * 256 << pixel_shift), linesize); -} else if (CONFIG_SVQ3_DECODER) -ff_svq3_add_idct_c(ptr, sl->mb + i * 16 + p * 256, linesize, qscale, 0); +if (nnz == 1 && dctcoef_get(sl->mb, pixel_shift, i * 16 + p * 256)) +idct_dc_add(ptr, sl->mb + (i * 16 + p * 256 << pixel_shift), linesize); +else +idct_add(ptr, sl->mb + (i * 16 + p * 256 << pixel_shift), linesize); } } } } } else { h->hpc.pred16x16[sl->intra16x16_pred_mode](dest_y, linesize); -if (is_h264) { -if (sl->non_zero_count_cache[scan8[LUMA_DC_BLOCK_INDEX + p]]) { -if (!transform_bypass) -h->h264dsp.h264_luma_dc_dequant_idct(sl->mb + (p * 256 << pixel_shift), - sl->mb_luma_dc[p], - h->dequant4_coeff[p][qscale][0]); -else { -static const uint8_t dc_mapping[16] = { - 0 * 16, 1 * 16, 4 * 16, 5 * 16, - 2 * 16, 3 * 16, 6 * 16, 7 * 16, - 8 * 16, 9 * 16, 12 * 16, 13 * 16, -10 * 16, 11 * 16, 14 * 16, 15 * 16 -}; -for (i = 0; i < 16; i++) -dctcoef_set(sl->mb + (p * 256 << pixel_shift), -pixel_shift, dc_mapping[i], -dctcoef_get(sl->mb_luma_dc[p], -pixel_shift, i)); -} +if (sl->non_zero_count_cache[scan8[LUMA_DC_BLOCK_INDEX + p]]) { +if (!transform_bypass) +h->h264dsp.h264_luma_dc_dequant_idct(sl->mb + (p * 256 << pixel_shift), + sl->mb_luma_dc[p], + h->dequant4_coeff[p][qscale][0]); +else { +static const uint8_t dc_mapping[16] = { + 0 * 16, 1 * 16, 4 * 16, 5 * 16, + 2 * 16, 3 * 16, 6 * 16, 7 * 16, + 8 * 16, 9 * 16, 12 * 16, 13 * 16, +
[FFmpeg-cvslog] Merge commit 'c73fb9efb22c8d66d24de2716f7f9970f234c3c3'
ffmpeg | branch: master | Derek Buitenhuis | Wed Apr 27 16:06:29 2016 +0100| [47bb289170aa48674a10ada899cf64e7c3b87caf] | committer: Derek Buitenhuis Merge commit 'c73fb9efb22c8d66d24de2716f7f9970f234c3c3' * commit 'c73fb9efb22c8d66d24de2716f7f9970f234c3c3': svq3: add all the required dsp contexts into SVQ3Context Merged-by: Derek Buitenhuis > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=47bb289170aa48674a10ada899cf64e7c3b87caf --- libavcodec/svq3.c | 40 +++- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index 492479d..e7c6e27 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -69,8 +69,13 @@ typedef struct SVQ3Context { H264Context h; + +H264DSPContext h264dsp; +H264PredContext hpc; HpelDSPContext hdsp; TpelDSPContext tdsp; +VideoDSPContext vdsp; + H264Picture *cur_pic; H264Picture *next_pic; H264Picture *last_pic; @@ -325,7 +330,7 @@ static inline void svq3_mc_dir_part(SVQ3Context *s, src = pic->f->data[0] + mx + my * sl->linesize; if (emu) { -h->vdsp.emulated_edge_mc(sl->edge_emu_buffer, src, +s->vdsp.emulated_edge_mc(sl->edge_emu_buffer, src, sl->linesize, sl->linesize, width + 1, height + 1, mx, my, s->h_edge_pos, s->v_edge_pos); @@ -352,7 +357,7 @@ static inline void svq3_mc_dir_part(SVQ3Context *s, src = pic->f->data[i] + mx + my * sl->uvlinesize; if (emu) { -h->vdsp.emulated_edge_mc(sl->edge_emu_buffer, src, +s->vdsp.emulated_edge_mc(sl->edge_emu_buffer, src, sl->uvlinesize, sl->uvlinesize, width + 1, height + 1, mx, my, (s->h_edge_pos >> 1), @@ -508,7 +513,8 @@ static av_always_inline int dctcoef_get(int16_t *mb, int index) return AV_RN16A(mb + index); } -static av_always_inline void hl_decode_mb_predict_luma(const H264Context *h, +static av_always_inline void hl_decode_mb_predict_luma(SVQ3Context *s, + const H264Context *h, H264SliceContext *sl, int mb_type, const int *block_offset, @@ -536,19 +542,19 @@ static av_always_inline void hl_decode_mb_predict_luma(const H264Context *h, } else topright = NULL; -h->hpc.pred4x4[dir](ptr, topright, linesize); +s->hpc.pred4x4[dir](ptr, topright, linesize); nnz = sl->non_zero_count_cache[scan8[i]]; if (nnz) { svq3_add_idct_c(ptr, sl->mb + i * 16, linesize, qscale, 0); } } } else { -h->hpc.pred16x16[sl->intra16x16_pred_mode](dest_y, linesize); +s->hpc.pred16x16[sl->intra16x16_pred_mode](dest_y, linesize); svq3_luma_dc_dequant_idct_c(sl->mb, sl->mb_luma_dc[0], qscale); } } -static void hl_decode_mb(const H264Context *h, H264SliceContext *sl) +static void hl_decode_mb(SVQ3Context *s, const H264Context *h, H264SliceContext *sl) { const int mb_x= sl->mb_x; const int mb_y= sl->mb_y; @@ -564,8 +570,8 @@ static void hl_decode_mb(const H264Context *h, H264SliceContext *sl) dest_cb = h->cur_pic.f->data[1] + mb_x * 8 + mb_y * sl->uvlinesize * block_h; dest_cr = h->cur_pic.f->data[2] + mb_x * 8 + mb_y * sl->uvlinesize * block_h; -h->vdsp.prefetch(dest_y + (sl->mb_x & 3) * 4 * sl->linesize + 64, sl->linesize, 4); -h->vdsp.prefetch(dest_cb + (sl->mb_x & 7) * sl->uvlinesize + 64, dest_cr - dest_cb, 2); +s->vdsp.prefetch(dest_y + (sl->mb_x & 3) * 4 * sl->linesize + 64, sl->linesize, 4); +s->vdsp.prefetch(dest_cb + (sl->mb_x & 7) * sl->uvlinesize + 64, dest_cr - dest_cb, 2); h->list_counts[mb_xy] = sl->list_count; @@ -573,19 +579,19 @@ static void hl_decode_mb(const H264Context *h, H264SliceContext *sl) uvlinesize = sl->mb_uvlinesize = sl->uvlinesize; if (IS_INTRA(mb_type)) { -h->hpc.pred8x8[sl->chroma_pred_mode](dest_cb, uvlinesize); -h->hpc.pred8x8[sl->chroma_pred_mode](dest_cr, uvlinesize); +s->hpc.pred8x8[sl->chroma_pred_mode](dest_cb, uvlinesize); +s->hpc.pred8x8[sl->chroma_pred_mode](dest_cr, uvlinesize); -hl_decode_mb_predict_luma(h, sl, mb_type, block_offset, linesize, dest_y); +hl_decode_mb_predict_luma(s, h, sl, mb_type, block_offset, linesize, dest_y); } hl_decode_mb_idct_luma(h, sl, mb_type, block_offset, linesize, dest_y); if (sl->cbp & 0x30) { uint8_t *dest[2] = { dest_cb, dest_cr }; -h->h264dsp.h264_chroma_d
[FFmpeg-cvslog] Merge commit '15b0517da986b312fc2fcb364a92db328380b15b'
ffmpeg | branch: master | Derek Buitenhuis | Wed Apr 27 15:49:40 2016 +0100| [656b071a8f01c0269beb46d3fe00ded70fff079c] | committer: Derek Buitenhuis Merge commit '15b0517da986b312fc2fcb364a92db328380b15b' * commit '15b0517da986b312fc2fcb364a92db328380b15b': svq3: make the dsp functions static Merged-by: Derek Buitenhuis > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=656b071a8f01c0269beb46d3fe00ded70fff079c --- libavcodec/svq3.c | 21 + libavcodec/svq3.h | 27 --- 2 files changed, 9 insertions(+), 39 deletions(-) diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index 608f817..492479d 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -61,7 +61,6 @@ #endif #include "svq1.h" -#include "svq3.h" /** * @file @@ -165,7 +164,7 @@ static const uint32_t svq3_dequant_coeff[32] = { static int svq3_decode_end(AVCodecContext *avctx); -void ff_svq3_luma_dc_dequant_idct_c(int16_t *output, int16_t *input, int qp) +static void svq3_luma_dc_dequant_idct_c(int16_t *output, int16_t *input, int qp) { const int qmul = svq3_dequant_coeff[qp]; #define stride 16 @@ -200,8 +199,8 @@ void ff_svq3_luma_dc_dequant_idct_c(int16_t *output, int16_t *input, int qp) } #undef stride -void ff_svq3_add_idct_c(uint8_t *dst, int16_t *block, -int stride, int qp, int dc) +static void svq3_add_idct_c(uint8_t *dst, int16_t *block, +int stride, int qp, int dc) { const int qmul = svq3_dequant_coeff[qp]; int i; @@ -498,8 +497,8 @@ static av_always_inline void hl_decode_mb_idct_luma(const H264Context *h, H264Sl for (i = 0; i < 16; i++) if (sl->non_zero_count_cache[scan8[i]] || sl->mb[i * 16]) { uint8_t *const ptr = dest_y + block_offset[i]; -ff_svq3_add_idct_c(ptr, sl->mb + i * 16, linesize, - sl->qscale, IS_INTRA(mb_type) ? 1 : 0); +svq3_add_idct_c(ptr, sl->mb + i * 16, linesize, +sl->qscale, IS_INTRA(mb_type) ? 1 : 0); } } } @@ -540,13 +539,12 @@ static av_always_inline void hl_decode_mb_predict_luma(const H264Context *h, h->hpc.pred4x4[dir](ptr, topright, linesize); nnz = sl->non_zero_count_cache[scan8[i]]; if (nnz) { -ff_svq3_add_idct_c(ptr, sl->mb + i * 16, linesize, qscale, 0); +svq3_add_idct_c(ptr, sl->mb + i * 16, linesize, qscale, 0); } } } else { h->hpc.pred16x16[sl->intra16x16_pred_mode](dest_y, linesize); -ff_svq3_luma_dc_dequant_idct_c(sl->mb, - sl->mb_luma_dc[0], qscale); +svq3_luma_dc_dequant_idct_c(sl->mb, sl->mb_luma_dc[0], qscale); } } @@ -593,9 +591,8 @@ static void hl_decode_mb(const H264Context *h, H264SliceContext *sl) for (i = j * 16; i < j * 16 + 4; i++) if (sl->non_zero_count_cache[scan8[i]] || sl->mb[i * 16]) { uint8_t *const ptr = dest[j - 1] + block_offset[i]; -ff_svq3_add_idct_c(ptr, sl->mb + i * 16, - uvlinesize, - ff_h264_chroma_qp[0][sl->qscale + 12] - 12, 2); +svq3_add_idct_c(ptr, sl->mb + i * 16, +uvlinesize, ff_h264_chroma_qp[0][sl->qscale + 12] - 12, 2); } } } diff --git a/libavcodec/svq3.h b/libavcodec/svq3.h deleted file mode 100644 index 5007a8c..000 --- a/libavcodec/svq3.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef AVCODEC_SVQ3_H -#define AVCODEC_SVQ3_H - -#include - -void ff_svq3_luma_dc_dequant_idct_c(int16_t *output, int16_t *input, int qp); -void ff_svq3_add_idct_c(uint8_t *dst, int16_t *block, int stride, int qp, int dc); - -#endif /* AVCODEC_SVQ3_H */ == diff --cc libavcodec/svq3.c index 608f817,df4616c..492479d --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@@ -163,9 -159,7 +162,9 @@@ static const uint32_t svq3_dequant_coef 61694, 68745
[FFmpeg-cvslog] h264: move ff_h264_check_intra[4x4]_pred_mode() to h264_parse
ffmpeg | branch: master | Anton Khirnov | Wed Mar 23 09:41:05 2016 +0100| [ecc31f6b086453ab9811dce2ae5ceb6a7c19e4ad] | committer: Anton Khirnov h264: move ff_h264_check_intra[4x4]_pred_mode() to h264_parse It is shared with svq3. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ecc31f6b086453ab9811dce2ae5ceb6a7c19e4ad --- libavcodec/Makefile |2 +- libavcodec/h264.c | 93 --- libavcodec/h264.h | 13 --- libavcodec/h264_cabac.c | 10 +++-- libavcodec/h264_cavlc.c |9 +++-- libavcodec/h264_parse.c | 92 ++ libavcodec/h264_parse.h | 15 libavcodec/svq3.c | 10 +++-- 8 files changed, 128 insertions(+), 116 deletions(-) diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 54b12d3..e66ec51 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -418,7 +418,7 @@ OBJS-$(CONFIG_SUNRAST_ENCODER) += sunrastenc.o OBJS-$(CONFIG_SVQ1_DECODER)+= svq1dec.o svq1.o svq13.o h263data.o OBJS-$(CONFIG_SVQ1_ENCODER)+= svq1enc.o svq1.o h263data.o \ h263.o ituh263enc.o -OBJS-$(CONFIG_SVQ3_DECODER)+= svq3.o svq13.o mpegutils.o +OBJS-$(CONFIG_SVQ3_DECODER)+= svq3.o svq13.o mpegutils.o h264_parse.o OBJS-$(CONFIG_TAK_DECODER) += takdec.o tak.o OBJS-$(CONFIG_TARGA_DECODER) += targa.o OBJS-$(CONFIG_TARGA_ENCODER) += targaenc.o rle.o diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 49b3f93..a90ef64 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -114,99 +114,6 @@ void ff_h264_draw_horiz_band(const H264Context *h, H264SliceContext *sl, } } -/** - * Check if the top & left blocks are available if needed and - * change the dc mode so it only uses the available blocks. - */ -int ff_h264_check_intra4x4_pred_mode(const H264Context *h, H264SliceContext *sl) -{ -static const int8_t top[12] = { --1, 0, LEFT_DC_PRED, -1, -1, -1, -1, -1, 0 -}; -static const int8_t left[12] = { -0, -1, TOP_DC_PRED, 0, -1, -1, -1, 0, -1, DC_128_PRED -}; -int i; - -if (!(sl->top_samples_available & 0x8000)) { -for (i = 0; i < 4; i++) { -int status = top[sl->intra4x4_pred_mode_cache[scan8[0] + i]]; -if (status < 0) { -av_log(h->avctx, AV_LOG_ERROR, - "top block unavailable for requested intra4x4 mode %d at %d %d\n", - status, sl->mb_x, sl->mb_y); -return AVERROR_INVALIDDATA; -} else if (status) { -sl->intra4x4_pred_mode_cache[scan8[0] + i] = status; -} -} -} - -if ((sl->left_samples_available & 0x) != 0x) { -static const int mask[4] = { 0x8000, 0x2000, 0x80, 0x20 }; -for (i = 0; i < 4; i++) -if (!(sl->left_samples_available & mask[i])) { -int status = left[sl->intra4x4_pred_mode_cache[scan8[0] + 8 * i]]; -if (status < 0) { -av_log(h->avctx, AV_LOG_ERROR, - "left block unavailable for requested intra4x4 mode %d at %d %d\n", - status, sl->mb_x, sl->mb_y); -return AVERROR_INVALIDDATA; -} else if (status) { -sl->intra4x4_pred_mode_cache[scan8[0] + 8 * i] = status; -} -} -} - -return 0; -} // FIXME cleanup like ff_h264_check_intra_pred_mode - -/** - * Check if the top & left blocks are available if needed and - * change the dc mode so it only uses the available blocks. - */ -int ff_h264_check_intra_pred_mode(const H264Context *h, H264SliceContext *sl, - int mode, int is_chroma) -{ -static const int8_t top[4] = { LEFT_DC_PRED8x8, 1, -1, -1 }; -static const int8_t left[5] = { TOP_DC_PRED8x8, -1, 2, -1, DC_128_PRED8x8 }; - -if (mode > 3U) { -av_log(h->avctx, AV_LOG_ERROR, - "out of range intra chroma pred mode at %d %d\n", - sl->mb_x, sl->mb_y); -return AVERROR_INVALIDDATA; -} - -if (!(sl->top_samples_available & 0x8000)) { -mode = top[mode]; -if (mode < 0) { -av_log(h->avctx, AV_LOG_ERROR, - "top block unavailable for requested intra mode at %d %d\n", - sl->mb_x, sl->mb_y); -return AVERROR_INVALIDDATA; -} -} - -if ((sl->left_samples_available & 0x8080) != 0x8080) { -mode = left[mode]; -if (is_chroma && (sl->left_samples_available & 0x8080)) { -// mad cow disease mode, aka MBAFF + constrained_intra_pred -mode = ALZHEIMER_DC_L0T_PRED8x8 + - (!(sl->left_samples_available & 0x8000)) + - 2 * (mode == DC_128_PRED8x8); -} -if (mode < 0)
[FFmpeg-cvslog] Merge commit 'ecc31f6b086453ab9811dce2ae5ceb6a7c19e4ad'
ffmpeg | branch: master | Derek Buitenhuis | Wed Apr 27 16:34:40 2016 +0100| [a2922b5d614ca6db025364f47bc4a1e4812859aa] | committer: Derek Buitenhuis Merge commit 'ecc31f6b086453ab9811dce2ae5ceb6a7c19e4ad' * commit 'ecc31f6b086453ab9811dce2ae5ceb6a7c19e4ad': h264: move ff_h264_check_intra[4x4]_pred_mode() to h264_parse Merged-by: Derek Buitenhuis > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a2922b5d614ca6db025364f47bc4a1e4812859aa --- libavcodec/Makefile |2 +- libavcodec/h264.c | 93 --- libavcodec/h264.h | 13 --- libavcodec/h264_cabac.c | 10 +++-- libavcodec/h264_cavlc.c |9 +++-- libavcodec/h264_parse.c | 92 ++ libavcodec/h264_parse.h | 15 libavcodec/svq3.c | 10 +++-- 8 files changed, 128 insertions(+), 116 deletions(-) diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 4cda4dc..8f63261 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -509,7 +509,7 @@ OBJS-$(CONFIG_SUNRAST_ENCODER) += sunrastenc.o OBJS-$(CONFIG_SVQ1_DECODER)+= svq1dec.o svq1.o svq13.o h263data.o OBJS-$(CONFIG_SVQ1_ENCODER)+= svq1enc.o svq1.o h263data.o \ h263.o ituh263enc.o -OBJS-$(CONFIG_SVQ3_DECODER)+= svq3.o svq13.o mpegutils.o +OBJS-$(CONFIG_SVQ3_DECODER)+= svq3.o svq13.o mpegutils.o h264_parse.o OBJS-$(CONFIG_TEXT_DECODER)+= textdec.o ass.o OBJS-$(CONFIG_TEXT_ENCODER)+= srtenc.o ass_split.o OBJS-$(CONFIG_TAK_DECODER) += takdec.o tak.o takdsp.o diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 5a0f0bb..6dbe5c7 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -132,99 +132,6 @@ void ff_h264_draw_horiz_band(const H264Context *h, H264SliceContext *sl, } } -/** - * Check if the top & left blocks are available if needed and - * change the dc mode so it only uses the available blocks. - */ -int ff_h264_check_intra4x4_pred_mode(const H264Context *h, H264SliceContext *sl) -{ -static const int8_t top[12] = { --1, 0, LEFT_DC_PRED, -1, -1, -1, -1, -1, 0 -}; -static const int8_t left[12] = { -0, -1, TOP_DC_PRED, 0, -1, -1, -1, 0, -1, DC_128_PRED -}; -int i; - -if (!(sl->top_samples_available & 0x8000)) { -for (i = 0; i < 4; i++) { -int status = top[sl->intra4x4_pred_mode_cache[scan8[0] + i]]; -if (status < 0) { -av_log(h->avctx, AV_LOG_ERROR, - "top block unavailable for requested intra4x4 mode %d at %d %d\n", - status, sl->mb_x, sl->mb_y); -return AVERROR_INVALIDDATA; -} else if (status) { -sl->intra4x4_pred_mode_cache[scan8[0] + i] = status; -} -} -} - -if ((sl->left_samples_available & 0x) != 0x) { -static const int mask[4] = { 0x8000, 0x2000, 0x80, 0x20 }; -for (i = 0; i < 4; i++) -if (!(sl->left_samples_available & mask[i])) { -int status = left[sl->intra4x4_pred_mode_cache[scan8[0] + 8 * i]]; -if (status < 0) { -av_log(h->avctx, AV_LOG_ERROR, - "left block unavailable for requested intra4x4 mode %d at %d %d\n", - status, sl->mb_x, sl->mb_y); -return AVERROR_INVALIDDATA; -} else if (status) { -sl->intra4x4_pred_mode_cache[scan8[0] + 8 * i] = status; -} -} -} - -return 0; -} // FIXME cleanup like ff_h264_check_intra_pred_mode - -/** - * Check if the top & left blocks are available if needed and - * change the dc mode so it only uses the available blocks. - */ -int ff_h264_check_intra_pred_mode(const H264Context *h, H264SliceContext *sl, - int mode, int is_chroma) -{ -static const int8_t top[4] = { LEFT_DC_PRED8x8, 1, -1, -1 }; -static const int8_t left[5] = { TOP_DC_PRED8x8, -1, 2, -1, DC_128_PRED8x8 }; - -if (mode > 3U) { -av_log(h->avctx, AV_LOG_ERROR, - "out of range intra chroma pred mode at %d %d\n", - sl->mb_x, sl->mb_y); -return AVERROR_INVALIDDATA; -} - -if (!(sl->top_samples_available & 0x8000)) { -mode = top[mode]; -if (mode < 0) { -av_log(h->avctx, AV_LOG_ERROR, - "top block unavailable for requested intra mode at %d %d\n", - sl->mb_x, sl->mb_y); -return AVERROR_INVALIDDATA; -} -} - -if ((sl->left_samples_available & 0x8080) != 0x8080) { -mode = left[mode]; -if (mode < 0) { -av_log(h->avctx, AV_LOG_ERROR, - "left block unavailable for requested intra mode at %d %d\n", - sl->mb_x, sl->mb_
[FFmpeg-cvslog] Merge commit '527bf5f7c6890664b0f1dccd42397f4d204659fe'
ffmpeg | branch: master | Derek Buitenhuis | Wed Apr 27 16:46:54 2016 +0100| [463de5625bcba2abb53ee8194ecb8bf45b83f315] | committer: Derek Buitenhuis Merge commit '527bf5f7c6890664b0f1dccd42397f4d204659fe' * commit '527bf5f7c6890664b0f1dccd42397f4d204659fe': svq3: move the pred mode variables to SVQ3Context Merged-by: Derek Buitenhuis > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=463de5625bcba2abb53ee8194ecb8bf45b83f315 --- libavcodec/svq3.c | 103 + 1 file changed, 57 insertions(+), 46 deletions(-) diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index 01bac4a..93539fa 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -96,6 +96,16 @@ typedef struct SVQ3Context { int mb_x, mb_y; int mb_xy; + +int chroma_pred_mode; +int intra16x16_pred_mode; + +int8_t intra4x4_pred_mode_cache[5 * 8]; +int8_t (*intra4x4_pred_mode); + +unsigned int top_samples_available; +unsigned int topright_samples_available; +unsigned int left_samples_available; } SVQ3Context; #define FULLPEL_MODE 1 @@ -530,12 +540,12 @@ static av_always_inline void hl_decode_mb_predict_luma(SVQ3Context *s, if (IS_INTRA4x4(mb_type)) { for (i = 0; i < 16; i++) { uint8_t *const ptr = dest_y + block_offset[i]; -const int dir = sl->intra4x4_pred_mode_cache[scan8[i]]; +const int dir = s->intra4x4_pred_mode_cache[scan8[i]]; uint8_t *topright; int nnz, tr; if (dir == DIAG_DOWN_LEFT_PRED || dir == VERT_LEFT_PRED) { -const int topright_avail = (sl->topright_samples_available << i) & 0x8000; +const int topright_avail = (s->topright_samples_available << i) & 0x8000; av_assert2(s->mb_y || linesize <= block_offset[i]); if (!topright_avail) { tr = ptr[3 - linesize] * 0x01010101u; @@ -552,7 +562,7 @@ static av_always_inline void hl_decode_mb_predict_luma(SVQ3Context *s, } } } else { -s->hpc.pred16x16[sl->intra16x16_pred_mode](dest_y, linesize); +s->hpc.pred16x16[s->intra16x16_pred_mode](dest_y, linesize); svq3_luma_dc_dequant_idct_c(sl->mb, sl->mb_luma_dc[0], qscale); } } @@ -582,8 +592,8 @@ static void hl_decode_mb(SVQ3Context *s, const H264Context *h, H264SliceContext uvlinesize = sl->mb_uvlinesize = sl->uvlinesize; if (IS_INTRA(mb_type)) { -s->hpc.pred8x8[sl->chroma_pred_mode](dest_cb, uvlinesize); -s->hpc.pred8x8[sl->chroma_pred_mode](dest_cr, uvlinesize); +s->hpc.pred8x8[s->chroma_pred_mode](dest_cb, uvlinesize); +s->hpc.pred8x8[s->chroma_pred_mode](dest_cr, uvlinesize); hl_decode_mb_predict_luma(s, h, sl, mb_type, block_offset, linesize, dest_y); } @@ -618,9 +628,9 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type) const int mb_xy = s->mb_xy; const int b_xy = 4 * s->mb_x + 4 * s->mb_y * h->b_stride; -sl->top_samples_available = (s->mb_y == 0) ? 0x33FF : 0x; -sl->left_samples_available = (s->mb_x == 0) ? 0x5F5F : 0x; -sl->topright_samples_available = 0x; +s->top_samples_available = (s->mb_y == 0) ? 0x33FF : 0x; +s->left_samples_available = (s->mb_x == 0) ? 0x5F5F : 0x; +s->topright_samples_available = 0x; if (mb_type == 0) { /* SKIP */ if (h->pict_type == AV_PICTURE_TYPE_P || @@ -661,7 +671,7 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type) */ for (m = 0; m < 2; m++) { -if (s->mb_x > 0 && sl->intra4x4_pred_mode[h->mb2br_xy[mb_xy - 1] + 6] != -1) { +if (s->mb_x > 0 && s->intra4x4_pred_mode[h->mb2br_xy[mb_xy - 1] + 6] != -1) { for (i = 0; i < 4; i++) AV_COPY32(sl->mv_cache[m][scan8[0] - 1 + i * 8], h->cur_pic.motion_val[m][b_xy - 1 + i * h->b_stride]); @@ -674,21 +684,21 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type) h->cur_pic.motion_val[m][b_xy - h->b_stride], 4 * 2 * sizeof(int16_t)); memset(&sl->ref_cache[m][scan8[0] - 1 * 8], - (sl->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride]] == -1) ? PART_NOT_AVAILABLE : 1, 4); + (s->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride]] == -1) ? PART_NOT_AVAILABLE : 1, 4); if (s->mb_x < h->mb_width - 1) { AV_COPY32(sl->mv_cache[m][scan8[0] + 4 - 1 * 8], h->cur_pic.motion_val[m][b_xy - h->b_stride + 4]); sl->ref_cache[m][scan8[0] + 4 - 1 * 8] = -(sl->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride + 1] + 6] == -1 || - sl->intra4x4_pred_mode[h->mb
[FFmpeg-cvslog] Merge commit '89a13998a1b5074411dff5a461dce3837057b0b8'
ffmpeg | branch: master | Derek Buitenhuis | Wed Apr 27 16:48:20 2016 +0100| [c0b51aa2d2c66cb52577a287b3b821e89f214514] | committer: Derek Buitenhuis Merge commit '89a13998a1b5074411dff5a461dce3837057b0b8' * commit '89a13998a1b5074411dff5a461dce3837057b0b8': svq3: rip out the svq3-relevant parts of pred_motion() out of h264 Merged-by: Derek Buitenhuis > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c0b51aa2d2c66cb52577a287b3b821e89f214514 --- libavcodec/svq3.c | 75 - 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index d5ed692..26fc7c5 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -318,6 +318,79 @@ static inline int svq3_decode_block(GetBitContext *gb, int16_t *block, return 0; } +static av_always_inline int +svq3_fetch_diagonal_mv(const H264Context *h, H264SliceContext *sl, + const int16_t **C, + int i, int list, int part_width) +{ +const int topright_ref = sl->ref_cache[list][i - 8 + part_width]; + +if (topright_ref != PART_NOT_AVAILABLE) { +*C = sl->mv_cache[list][i - 8 + part_width]; +return topright_ref; +} else { +*C = sl->mv_cache[list][i - 8 - 1]; +return sl->ref_cache[list][i - 8 - 1]; +} +} + +/** + * Get the predicted MV. + * @param n the block index + * @param part_width the width of the partition (4, 8,16) -> (1, 2, 4) + * @param mx the x component of the predicted motion vector + * @param my the y component of the predicted motion vector + */ +static av_always_inline void svq3_pred_motion(const H264Context *const h, + H264SliceContext *sl, int n, + int part_width, int list, + int ref, int *const mx, int *const my) +{ +const int index8 = scan8[n]; +const int top_ref = sl->ref_cache[list][index8 - 8]; +const int left_ref = sl->ref_cache[list][index8 - 1]; +const int16_t *const A = sl->mv_cache[list][index8 - 1]; +const int16_t *const B = sl->mv_cache[list][index8 - 8]; +const int16_t *C; +int diagonal_ref, match_count; + +/* mv_cache + * B . . A T T T T + * U . . L . . , . + * U . . L . . . . + * U . . L . . , . + * . . . L . . . . + */ + +diagonal_ref = svq3_fetch_diagonal_mv(h, sl, &C, index8, list, part_width); +match_count = (diagonal_ref == ref) + (top_ref == ref) + (left_ref == ref); +if (match_count > 1) { //most common +*mx = mid_pred(A[0], B[0], C[0]); +*my = mid_pred(A[1], B[1], C[1]); +} else if (match_count == 1) { +if (left_ref == ref) { +*mx = A[0]; +*my = A[1]; +} else if (top_ref == ref) { +*mx = B[0]; +*my = B[1]; +} else { +*mx = C[0]; +*my = C[1]; +} +} else { +if (top_ref == PART_NOT_AVAILABLE && +diagonal_ref == PART_NOT_AVAILABLE && +left_ref != PART_NOT_AVAILABLE) { +*mx = A[0]; +*my = A[1]; +} else { +*mx = mid_pred(A[0], B[0], C[0]); +*my = mid_pred(A[1], B[1], C[1]); +} +} +} + static inline void svq3_mc_dir_part(SVQ3Context *s, int x, int y, int width, int height, int mx, int my, int dxy, @@ -416,7 +489,7 @@ static inline int svq3_mc_dir(SVQ3Context *s, int size, int mode, (j >> 1 & 4) + (i & 8); if (mode != PREDICT_MODE) { -pred_motion(h, sl, k, part_width >> 2, dir, 1, &mx, &my); +svq3_pred_motion(h, sl, k, part_width >> 2, dir, 1, &mx, &my); } else { mx = s->next_pic->motion_val[0][b_xy][0] << 1; my = s->next_pic->motion_val[0][b_xy][1] << 1; == ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] svq3: move the pred mode variables to SVQ3Context
ffmpeg | branch: master | Anton Khirnov | Wed Mar 23 09:49:20 2016 +0100| [527bf5f7c6890664b0f1dccd42397f4d204659fe] | committer: Anton Khirnov svq3: move the pred mode variables to SVQ3Context This will allow removing the H264Context dependency in the future. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=527bf5f7c6890664b0f1dccd42397f4d204659fe --- libavcodec/svq3.c | 107 ++--- 1 file changed, 61 insertions(+), 46 deletions(-) diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index 0d96abd..3785cca 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -93,6 +93,16 @@ typedef struct SVQ3Context { int mb_x, mb_y; int mb_xy; + +int chroma_pred_mode; +int intra16x16_pred_mode; + +int8_t intra4x4_pred_mode_cache[5 * 8]; +int8_t (*intra4x4_pred_mode); + +unsigned int top_samples_available; +unsigned int topright_samples_available; +unsigned int left_samples_available; } SVQ3Context; #define FULLPEL_MODE 1 @@ -523,12 +533,12 @@ static av_always_inline void hl_decode_mb_predict_luma(SVQ3Context *s, if (IS_INTRA4x4(mb_type)) { for (i = 0; i < 16; i++) { uint8_t *const ptr = dest_y + block_offset[i]; -const int dir = sl->intra4x4_pred_mode_cache[scan8[i]]; +const int dir = s->intra4x4_pred_mode_cache[scan8[i]]; uint8_t *topright; int nnz, tr; if (dir == DIAG_DOWN_LEFT_PRED || dir == VERT_LEFT_PRED) { -const int topright_avail = (sl->topright_samples_available << i) & 0x8000; +const int topright_avail = (s->topright_samples_available << i) & 0x8000; assert(s->mb_y || linesize <= block_offset[i]); if (!topright_avail) { tr = ptr[3 - linesize] * 0x01010101u; @@ -545,7 +555,7 @@ static av_always_inline void hl_decode_mb_predict_luma(SVQ3Context *s, } } } else { -s->hpc.pred16x16[sl->intra16x16_pred_mode](dest_y, linesize); +s->hpc.pred16x16[s->intra16x16_pred_mode](dest_y, linesize); svq3_luma_dc_dequant_idct_c(sl->mb, sl->mb_luma_dc[0], qscale); } } @@ -575,8 +585,8 @@ static void hl_decode_mb(SVQ3Context *s, const H264Context *h, H264SliceContext uvlinesize = sl->mb_uvlinesize = sl->uvlinesize; if (IS_INTRA(mb_type)) { -s->hpc.pred8x8[sl->chroma_pred_mode](dest_cb, uvlinesize); -s->hpc.pred8x8[sl->chroma_pred_mode](dest_cr, uvlinesize); +s->hpc.pred8x8[s->chroma_pred_mode](dest_cb, uvlinesize); +s->hpc.pred8x8[s->chroma_pred_mode](dest_cr, uvlinesize); hl_decode_mb_predict_luma(s, h, sl, mb_type, block_offset, linesize, dest_y); } @@ -611,9 +621,9 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type) const int mb_xy = s->mb_xy; const int b_xy = 4 * s->mb_x + 4 * s->mb_y * h->b_stride; -sl->top_samples_available = (s->mb_y == 0) ? 0x33FF : 0x; -sl->left_samples_available = (s->mb_x == 0) ? 0x5F5F : 0x; -sl->topright_samples_available = 0x; +s->top_samples_available = (s->mb_y == 0) ? 0x33FF : 0x; +s->left_samples_available = (s->mb_x == 0) ? 0x5F5F : 0x; +s->topright_samples_available = 0x; if (mb_type == 0) { /* SKIP */ if (h->pict_type == AV_PICTURE_TYPE_P || @@ -654,7 +664,7 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type) */ for (m = 0; m < 2; m++) { -if (s->mb_x > 0 && sl->intra4x4_pred_mode[h->mb2br_xy[mb_xy - 1] + 6] != -1) { +if (s->mb_x > 0 && s->intra4x4_pred_mode[h->mb2br_xy[mb_xy - 1] + 6] != -1) { for (i = 0; i < 4; i++) AV_COPY32(sl->mv_cache[m][scan8[0] - 1 + i * 8], h->cur_pic.motion_val[m][b_xy - 1 + i * h->b_stride]); @@ -667,21 +677,21 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type) h->cur_pic.motion_val[m][b_xy - h->b_stride], 4 * 2 * sizeof(int16_t)); memset(&sl->ref_cache[m][scan8[0] - 1 * 8], - (sl->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride]] == -1) ? PART_NOT_AVAILABLE : 1, 4); + (s->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride]] == -1) ? PART_NOT_AVAILABLE : 1, 4); if (s->mb_x < h->mb_width - 1) { AV_COPY32(sl->mv_cache[m][scan8[0] + 4 - 1 * 8], h->cur_pic.motion_val[m][b_xy - h->b_stride + 4]); sl->ref_cache[m][scan8[0] + 4 - 1 * 8] = -(sl->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride + 1] + 6] == -1 || - sl->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride]] == -1) ? PART_NOT_AVAILABLE : 1; +
[FFmpeg-cvslog] Merge commit '8eecae77ff6e2923de57dd883421d24fd53ca61f'
ffmpeg | branch: master | Derek Buitenhuis | Wed Apr 27 16:47:52 2016 +0100| [fed686af232487dad6ec46294b3e5018f11943f1] | committer: Derek Buitenhuis Merge commit '8eecae77ff6e2923de57dd883421d24fd53ca61f' * commit '8eecae77ff6e2923de57dd883421d24fd53ca61f': svq3: move edge_emu_buffer to the SVQ3Context Merged-by: Derek Buitenhuis > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fed686af232487dad6ec46294b3e5018f11943f1 --- libavcodec/svq3.c | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index 93539fa..d5ed692 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -106,6 +106,8 @@ typedef struct SVQ3Context { unsigned int top_samples_available; unsigned int topright_samples_available; unsigned int left_samples_available; + +uint8_t *edge_emu_buffer; } SVQ3Context; #define FULLPEL_MODE 1 @@ -343,11 +345,11 @@ static inline void svq3_mc_dir_part(SVQ3Context *s, src = pic->f->data[0] + mx + my * sl->linesize; if (emu) { -s->vdsp.emulated_edge_mc(sl->edge_emu_buffer, src, +s->vdsp.emulated_edge_mc(s->edge_emu_buffer, src, sl->linesize, sl->linesize, width + 1, height + 1, mx, my, s->h_edge_pos, s->v_edge_pos); -src = sl->edge_emu_buffer; +src = s->edge_emu_buffer; } if (thirdpel) (avg ? s->tdsp.avg_tpel_pixels_tab @@ -370,12 +372,12 @@ static inline void svq3_mc_dir_part(SVQ3Context *s, src = pic->f->data[i] + mx + my * sl->uvlinesize; if (emu) { -s->vdsp.emulated_edge_mc(sl->edge_emu_buffer, src, +s->vdsp.emulated_edge_mc(s->edge_emu_buffer, src, sl->uvlinesize, sl->uvlinesize, width + 1, height + 1, mx, my, (s->h_edge_pos >> 1), s->v_edge_pos >> 1); -src = sl->edge_emu_buffer; +src = s->edge_emu_buffer; } if (thirdpel) (avg ? s->tdsp.avg_tpel_pixels_tab @@ -1290,9 +1292,9 @@ static int get_buffer(AVCodecContext *avctx, H264Picture *pic) if (ret < 0) goto fail; -if (!sl->edge_emu_buffer) { -sl->edge_emu_buffer = av_mallocz_array(pic->f->linesize[0], 17); -if (!sl->edge_emu_buffer) +if (!s->edge_emu_buffer) { +s->edge_emu_buffer = av_mallocz_array(pic->f->linesize[0], 17); +if (!s->edge_emu_buffer) return AVERROR(ENOMEM); } @@ -1542,6 +1544,7 @@ static av_cold int svq3_decode_end(AVCodecContext *avctx) av_freep(&s->last_pic); av_freep(&s->slice_buf); av_freep(&s->intra4x4_pred_mode); +av_freep(&s->edge_emu_buffer); memset(&h->cur_pic, 0, sizeof(h->cur_pic)); == diff --cc libavcodec/svq3.c index 93539fa,5564d29..d5ed692 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@@ -1290,9 -1266,9 +1292,9 @@@ static int get_buffer(AVCodecContext *a if (ret < 0) goto fail; - if (!sl->edge_emu_buffer) { - sl->edge_emu_buffer = av_mallocz_array(pic->f->linesize[0], 17); - if (!sl->edge_emu_buffer) + if (!s->edge_emu_buffer) { -s->edge_emu_buffer = av_mallocz(pic->f->linesize[0] * 17); ++s->edge_emu_buffer = av_mallocz_array(pic->f->linesize[0], 17); + if (!s->edge_emu_buffer) return AVERROR(ENOMEM); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '99dde60391cade40ae026b9e385a5280be6b9882'
ffmpeg | branch: master | Derek Buitenhuis | Wed Apr 27 16:49:10 2016 +0100| [f09fd96cee9755cfb8b4bd8f0103a3c56a6396e7] | committer: Derek Buitenhuis Merge commit '99dde60391cade40ae026b9e385a5280be6b9882' * commit '99dde60391cade40ae026b9e385a5280be6b9882': svq3: move {ref,mv}_cache to the SVQ3Context Merged-by: Derek Buitenhuis > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f09fd96cee9755cfb8b4bd8f0103a3c56a6396e7 --- libavcodec/svq3.c | 64 ++--- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index 26fc7c5..6ae67c2 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -108,6 +108,9 @@ typedef struct SVQ3Context { unsigned int left_samples_available; uint8_t *edge_emu_buffer; + +DECLARE_ALIGNED(16, int16_t, mv_cache)[2][5 * 8][2]; +DECLARE_ALIGNED(8, int8_t, ref_cache)[2][5 * 8]; } SVQ3Context; #define FULLPEL_MODE 1 @@ -319,18 +322,17 @@ static inline int svq3_decode_block(GetBitContext *gb, int16_t *block, } static av_always_inline int -svq3_fetch_diagonal_mv(const H264Context *h, H264SliceContext *sl, - const int16_t **C, +svq3_fetch_diagonal_mv(const SVQ3Context *s, const int16_t **C, int i, int list, int part_width) { -const int topright_ref = sl->ref_cache[list][i - 8 + part_width]; +const int topright_ref = s->ref_cache[list][i - 8 + part_width]; if (topright_ref != PART_NOT_AVAILABLE) { -*C = sl->mv_cache[list][i - 8 + part_width]; +*C = s->mv_cache[list][i - 8 + part_width]; return topright_ref; } else { -*C = sl->mv_cache[list][i - 8 - 1]; -return sl->ref_cache[list][i - 8 - 1]; +*C = s->mv_cache[list][i - 8 - 1]; +return s->ref_cache[list][i - 8 - 1]; } } @@ -341,16 +343,15 @@ svq3_fetch_diagonal_mv(const H264Context *h, H264SliceContext *sl, * @param mx the x component of the predicted motion vector * @param my the y component of the predicted motion vector */ -static av_always_inline void svq3_pred_motion(const H264Context *const h, - H264SliceContext *sl, int n, +static av_always_inline void svq3_pred_motion(const SVQ3Context *s, int n, int part_width, int list, int ref, int *const mx, int *const my) { const int index8 = scan8[n]; -const int top_ref = sl->ref_cache[list][index8 - 8]; -const int left_ref = sl->ref_cache[list][index8 - 1]; -const int16_t *const A = sl->mv_cache[list][index8 - 1]; -const int16_t *const B = sl->mv_cache[list][index8 - 8]; +const int top_ref = s->ref_cache[list][index8 - 8]; +const int left_ref = s->ref_cache[list][index8 - 1]; +const int16_t *const A = s->mv_cache[list][index8 - 1]; +const int16_t *const B = s->mv_cache[list][index8 - 8]; const int16_t *C; int diagonal_ref, match_count; @@ -362,7 +363,7 @@ static av_always_inline void svq3_pred_motion(const H264Context *const h, * . . . L . . . . */ -diagonal_ref = svq3_fetch_diagonal_mv(h, sl, &C, index8, list, part_width); +diagonal_ref = svq3_fetch_diagonal_mv(s, &C, index8, list, part_width); match_count = (diagonal_ref == ref) + (top_ref == ref) + (left_ref == ref); if (match_count > 1) { //most common *mx = mid_pred(A[0], B[0], C[0]); @@ -471,7 +472,6 @@ static inline int svq3_mc_dir(SVQ3Context *s, int size, int mode, { int i, j, k, mx, my, dx, dy, x, y; H264Context *h = &s->h; -H264SliceContext *sl= &h->slice_ctx[0]; const int part_width= ((size & 5) == 4) ? 4 : 16 >> (size & 1); const int part_height = 16 >> ((unsigned)(size + 1) / 3); const int extra_width = (mode == PREDICT_MODE) ? -16 * 6 : 0; @@ -489,7 +489,7 @@ static inline int svq3_mc_dir(SVQ3Context *s, int size, int mode, (j >> 1 & 4) + (i & 8); if (mode != PREDICT_MODE) { -svq3_pred_motion(h, sl, k, part_width >> 2, dir, 1, &mx, &my); +svq3_pred_motion(s, k, part_width >> 2, dir, 1, &mx, &my); } else { mx = s->next_pic->motion_val[0][b_xy][0] << 1; my = s->next_pic->motion_val[0][b_xy][1] << 1; @@ -561,15 +561,15 @@ static inline int svq3_mc_dir(SVQ3Context *s, int size, int mode, int32_t mv = pack16to32(mx, my); if (part_height == 8 && i < 8) { -AV_WN32A(sl->mv_cache[dir][scan8[k] + 1 * 8], mv); +AV_WN32A(s->mv_cache[dir][scan8[k] + 1 * 8], mv); if (part_width == 8 && j < 8) -AV_WN32A(sl->mv_cache[dir][scan8[k] + 1 + 1 * 8], mv); +AV_WN32A(s->mv_cache[dir][scan8[k] + 1 + 1 * 8], mv);
[FFmpeg-cvslog] svq3: rip out the svq3-relevant parts of pred_motion() out of h264
ffmpeg | branch: master | Anton Khirnov | Wed Mar 23 09:59:57 2016 +0100| [89a13998a1b5074411dff5a461dce3837057b0b8] | committer: Anton Khirnov svq3: rip out the svq3-relevant parts of pred_motion() out of h264 > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=89a13998a1b5074411dff5a461dce3837057b0b8 --- libavcodec/svq3.c | 75 - 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index 5564d29..a248cd6 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -311,6 +311,79 @@ static inline int svq3_decode_block(GetBitContext *gb, int16_t *block, return 0; } +static av_always_inline int +svq3_fetch_diagonal_mv(const H264Context *h, H264SliceContext *sl, + const int16_t **C, + int i, int list, int part_width) +{ +const int topright_ref = sl->ref_cache[list][i - 8 + part_width]; + +if (topright_ref != PART_NOT_AVAILABLE) { +*C = sl->mv_cache[list][i - 8 + part_width]; +return topright_ref; +} else { +*C = sl->mv_cache[list][i - 8 - 1]; +return sl->ref_cache[list][i - 8 - 1]; +} +} + +/** + * Get the predicted MV. + * @param n the block index + * @param part_width the width of the partition (4, 8,16) -> (1, 2, 4) + * @param mx the x component of the predicted motion vector + * @param my the y component of the predicted motion vector + */ +static av_always_inline void svq3_pred_motion(const H264Context *const h, + H264SliceContext *sl, int n, + int part_width, int list, + int ref, int *const mx, int *const my) +{ +const int index8 = scan8[n]; +const int top_ref = sl->ref_cache[list][index8 - 8]; +const int left_ref = sl->ref_cache[list][index8 - 1]; +const int16_t *const A = sl->mv_cache[list][index8 - 1]; +const int16_t *const B = sl->mv_cache[list][index8 - 8]; +const int16_t *C; +int diagonal_ref, match_count; + +/* mv_cache + * B . . A T T T T + * U . . L . . , . + * U . . L . . . . + * U . . L . . , . + * . . . L . . . . + */ + +diagonal_ref = svq3_fetch_diagonal_mv(h, sl, &C, index8, list, part_width); +match_count = (diagonal_ref == ref) + (top_ref == ref) + (left_ref == ref); +if (match_count > 1) { //most common +*mx = mid_pred(A[0], B[0], C[0]); +*my = mid_pred(A[1], B[1], C[1]); +} else if (match_count == 1) { +if (left_ref == ref) { +*mx = A[0]; +*my = A[1]; +} else if (top_ref == ref) { +*mx = B[0]; +*my = B[1]; +} else { +*mx = C[0]; +*my = C[1]; +} +} else { +if (top_ref == PART_NOT_AVAILABLE && +diagonal_ref == PART_NOT_AVAILABLE && +left_ref != PART_NOT_AVAILABLE) { +*mx = A[0]; +*my = A[1]; +} else { +*mx = mid_pred(A[0], B[0], C[0]); +*my = mid_pred(A[1], B[1], C[1]); +} +} +} + static inline void svq3_mc_dir_part(SVQ3Context *s, int x, int y, int width, int height, int mx, int my, int dxy, @@ -409,7 +482,7 @@ static inline int svq3_mc_dir(SVQ3Context *s, int size, int mode, (j >> 1 & 4) + (i & 8); if (mode != PREDICT_MODE) { -pred_motion(h, sl, k, part_width >> 2, dir, 1, &mx, &my); +svq3_pred_motion(h, sl, k, part_width >> 2, dir, 1, &mx, &my); } else { mx = s->next_pic->motion_val[0][b_xy][0] << 1; my = s->next_pic->motion_val[0][b_xy][1] << 1; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] svq3: move edge_emu_buffer to the SVQ3Context
ffmpeg | branch: master | Anton Khirnov | Wed Mar 23 09:54:43 2016 +0100| [8eecae77ff6e2923de57dd883421d24fd53ca61f] | committer: Anton Khirnov svq3: move edge_emu_buffer to the SVQ3Context > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8eecae77ff6e2923de57dd883421d24fd53ca61f --- libavcodec/svq3.c | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index 3785cca..5564d29 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -103,6 +103,8 @@ typedef struct SVQ3Context { unsigned int top_samples_available; unsigned int topright_samples_available; unsigned int left_samples_available; + +uint8_t *edge_emu_buffer; } SVQ3Context; #define FULLPEL_MODE 1 @@ -336,11 +338,11 @@ static inline void svq3_mc_dir_part(SVQ3Context *s, src = pic->f->data[0] + mx + my * sl->linesize; if (emu) { -s->vdsp.emulated_edge_mc(sl->edge_emu_buffer, src, +s->vdsp.emulated_edge_mc(s->edge_emu_buffer, src, sl->linesize, sl->linesize, width + 1, height + 1, mx, my, s->h_edge_pos, s->v_edge_pos); -src = sl->edge_emu_buffer; +src = s->edge_emu_buffer; } if (thirdpel) (avg ? s->tdsp.avg_tpel_pixels_tab @@ -363,12 +365,12 @@ static inline void svq3_mc_dir_part(SVQ3Context *s, src = pic->f->data[i] + mx + my * sl->uvlinesize; if (emu) { -s->vdsp.emulated_edge_mc(sl->edge_emu_buffer, src, +s->vdsp.emulated_edge_mc(s->edge_emu_buffer, src, sl->uvlinesize, sl->uvlinesize, width + 1, height + 1, mx, my, (s->h_edge_pos >> 1), s->v_edge_pos >> 1); -src = sl->edge_emu_buffer; +src = s->edge_emu_buffer; } if (thirdpel) (avg ? s->tdsp.avg_tpel_pixels_tab @@ -1264,9 +1266,9 @@ static int get_buffer(AVCodecContext *avctx, H264Picture *pic) if (ret < 0) goto fail; -if (!sl->edge_emu_buffer) { -sl->edge_emu_buffer = av_mallocz(pic->f->linesize[0] * 17); -if (!sl->edge_emu_buffer) +if (!s->edge_emu_buffer) { +s->edge_emu_buffer = av_mallocz(pic->f->linesize[0] * 17); +if (!s->edge_emu_buffer) return AVERROR(ENOMEM); } @@ -1491,6 +1493,7 @@ static av_cold int svq3_decode_end(AVCodecContext *avctx) av_freep(&s->last_pic); av_freep(&s->slice_buf); av_freep(&s->intra4x4_pred_mode); +av_freep(&s->edge_emu_buffer); memset(&h->cur_pic, 0, sizeof(h->cur_pic)); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] svq3: move {ref,mv}_cache to the SVQ3Context
ffmpeg | branch: master | Anton Khirnov | Wed Mar 23 10:03:50 2016 +0100| [99dde60391cade40ae026b9e385a5280be6b9882] | committer: Anton Khirnov svq3: move {ref,mv}_cache to the SVQ3Context > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=99dde60391cade40ae026b9e385a5280be6b9882 --- libavcodec/svq3.c | 64 ++--- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index a248cd6..3c8be4b 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -105,6 +105,9 @@ typedef struct SVQ3Context { unsigned int left_samples_available; uint8_t *edge_emu_buffer; + +DECLARE_ALIGNED(16, int16_t, mv_cache)[2][5 * 8][2]; +DECLARE_ALIGNED(8, int8_t, ref_cache)[2][5 * 8]; } SVQ3Context; #define FULLPEL_MODE 1 @@ -312,18 +315,17 @@ static inline int svq3_decode_block(GetBitContext *gb, int16_t *block, } static av_always_inline int -svq3_fetch_diagonal_mv(const H264Context *h, H264SliceContext *sl, - const int16_t **C, +svq3_fetch_diagonal_mv(const SVQ3Context *s, const int16_t **C, int i, int list, int part_width) { -const int topright_ref = sl->ref_cache[list][i - 8 + part_width]; +const int topright_ref = s->ref_cache[list][i - 8 + part_width]; if (topright_ref != PART_NOT_AVAILABLE) { -*C = sl->mv_cache[list][i - 8 + part_width]; +*C = s->mv_cache[list][i - 8 + part_width]; return topright_ref; } else { -*C = sl->mv_cache[list][i - 8 - 1]; -return sl->ref_cache[list][i - 8 - 1]; +*C = s->mv_cache[list][i - 8 - 1]; +return s->ref_cache[list][i - 8 - 1]; } } @@ -334,16 +336,15 @@ svq3_fetch_diagonal_mv(const H264Context *h, H264SliceContext *sl, * @param mx the x component of the predicted motion vector * @param my the y component of the predicted motion vector */ -static av_always_inline void svq3_pred_motion(const H264Context *const h, - H264SliceContext *sl, int n, +static av_always_inline void svq3_pred_motion(const SVQ3Context *s, int n, int part_width, int list, int ref, int *const mx, int *const my) { const int index8 = scan8[n]; -const int top_ref = sl->ref_cache[list][index8 - 8]; -const int left_ref = sl->ref_cache[list][index8 - 1]; -const int16_t *const A = sl->mv_cache[list][index8 - 1]; -const int16_t *const B = sl->mv_cache[list][index8 - 8]; +const int top_ref = s->ref_cache[list][index8 - 8]; +const int left_ref = s->ref_cache[list][index8 - 1]; +const int16_t *const A = s->mv_cache[list][index8 - 1]; +const int16_t *const B = s->mv_cache[list][index8 - 8]; const int16_t *C; int diagonal_ref, match_count; @@ -355,7 +356,7 @@ static av_always_inline void svq3_pred_motion(const H264Context *const h, * . . . L . . . . */ -diagonal_ref = svq3_fetch_diagonal_mv(h, sl, &C, index8, list, part_width); +diagonal_ref = svq3_fetch_diagonal_mv(s, &C, index8, list, part_width); match_count = (diagonal_ref == ref) + (top_ref == ref) + (left_ref == ref); if (match_count > 1) { //most common *mx = mid_pred(A[0], B[0], C[0]); @@ -464,7 +465,6 @@ static inline int svq3_mc_dir(SVQ3Context *s, int size, int mode, { int i, j, k, mx, my, dx, dy, x, y; H264Context *h = &s->h; -H264SliceContext *sl= &h->slice_ctx[0]; const int part_width= ((size & 5) == 4) ? 4 : 16 >> (size & 1); const int part_height = 16 >> ((unsigned)(size + 1) / 3); const int extra_width = (mode == PREDICT_MODE) ? -16 * 6 : 0; @@ -482,7 +482,7 @@ static inline int svq3_mc_dir(SVQ3Context *s, int size, int mode, (j >> 1 & 4) + (i & 8); if (mode != PREDICT_MODE) { -svq3_pred_motion(h, sl, k, part_width >> 2, dir, 1, &mx, &my); +svq3_pred_motion(s, k, part_width >> 2, dir, 1, &mx, &my); } else { mx = s->next_pic->motion_val[0][b_xy][0] << 1; my = s->next_pic->motion_val[0][b_xy][1] << 1; @@ -554,15 +554,15 @@ static inline int svq3_mc_dir(SVQ3Context *s, int size, int mode, int32_t mv = pack16to32(mx, my); if (part_height == 8 && i < 8) { -AV_WN32A(sl->mv_cache[dir][scan8[k] + 1 * 8], mv); +AV_WN32A(s->mv_cache[dir][scan8[k] + 1 * 8], mv); if (part_width == 8 && j < 8) -AV_WN32A(sl->mv_cache[dir][scan8[k] + 1 + 1 * 8], mv); +AV_WN32A(s->mv_cache[dir][scan8[k] + 1 + 1 * 8], mv); } if (part_width == 8 && j < 8) -AV_WN32A(sl->mv_cache[dir][scan8[k] + 1], mv); +
[FFmpeg-cvslog] Merge commit '549fc77273636d0d02175362af5dcd60c79f7633'
ffmpeg | branch: master | Derek Buitenhuis | Wed Apr 27 16:52:02 2016 +0100| [6f784c158bd56f2cc73354974ceebb04a40e0f52] | committer: Derek Buitenhuis Merge commit '549fc77273636d0d02175362af5dcd60c79f7633' * commit '549fc77273636d0d02175362af5dcd60c79f7633': svq3: move mb2br_xy to the SVQ3Context Merged-by: Derek Buitenhuis > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6f784c158bd56f2cc73354974ceebb04a40e0f52 --- libavcodec/svq3.c | 53 - 1 file changed, 36 insertions(+), 17 deletions(-) diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index 6ae67c2..b483eb0 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -97,6 +97,8 @@ typedef struct SVQ3Context { int mb_x, mb_y; int mb_xy; +uint32_t *mb2br_xy; + int chroma_pred_mode; int intra16x16_pred_mode; @@ -746,7 +748,7 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type) */ for (m = 0; m < 2; m++) { -if (s->mb_x > 0 && s->intra4x4_pred_mode[h->mb2br_xy[mb_xy - 1] + 6] != -1) { +if (s->mb_x > 0 && s->intra4x4_pred_mode[s->mb2br_xy[mb_xy - 1] + 6] != -1) { for (i = 0; i < 4; i++) AV_COPY32(s->mv_cache[m][scan8[0] - 1 + i * 8], h->cur_pic.motion_val[m][b_xy - 1 + i * h->b_stride]); @@ -759,21 +761,21 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type) h->cur_pic.motion_val[m][b_xy - h->b_stride], 4 * 2 * sizeof(int16_t)); memset(&s->ref_cache[m][scan8[0] - 1 * 8], - (s->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride]] == -1) ? PART_NOT_AVAILABLE : 1, 4); + (s->intra4x4_pred_mode[s->mb2br_xy[mb_xy - h->mb_stride]] == -1) ? PART_NOT_AVAILABLE : 1, 4); if (s->mb_x < h->mb_width - 1) { AV_COPY32(s->mv_cache[m][scan8[0] + 4 - 1 * 8], h->cur_pic.motion_val[m][b_xy - h->b_stride + 4]); s->ref_cache[m][scan8[0] + 4 - 1 * 8] = -(s->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride + 1] + 6] == -1 || - s->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride]] == -1) ? PART_NOT_AVAILABLE : 1; +(s->intra4x4_pred_mode[s->mb2br_xy[mb_xy - h->mb_stride + 1] + 6] == -1 || + s->intra4x4_pred_mode[s->mb2br_xy[mb_xy - h->mb_stride]] == -1) ? PART_NOT_AVAILABLE : 1; } else s->ref_cache[m][scan8[0] + 4 - 1 * 8] = PART_NOT_AVAILABLE; if (s->mb_x > 0) { AV_COPY32(s->mv_cache[m][scan8[0] - 1 - 1 * 8], h->cur_pic.motion_val[m][b_xy - h->b_stride - 1]); s->ref_cache[m][scan8[0] - 1 - 1 * 8] = -(s->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride - 1] + 3] == -1) ? PART_NOT_AVAILABLE : 1; +(s->intra4x4_pred_mode[s->mb2br_xy[mb_xy - h->mb_stride - 1] + 3] == -1) ? PART_NOT_AVAILABLE : 1; } else s->ref_cache[m][scan8[0] - 1 - 1 * 8] = PART_NOT_AVAILABLE; } else @@ -809,7 +811,7 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type) mb_type = MB_TYPE_16x16; } else if (mb_type == 8 || mb_type == 33) { /* INTRA4x4 */ -int8_t *i4x4 = s->intra4x4_pred_mode + h->mb2br_xy[s->mb_xy]; +int8_t *i4x4 = s->intra4x4_pred_mode + s->mb2br_xy[s->mb_xy]; int8_t *i4x4_cache = s->intra4x4_pred_mode_cache; memset(s->intra4x4_pred_mode_cache, -1, 8 * 5 * sizeof(int8_t)); @@ -817,15 +819,15 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type) if (mb_type == 8) { if (s->mb_x > 0) { for (i = 0; i < 4; i++) -s->intra4x4_pred_mode_cache[scan8[0] - 1 + i * 8] = s->intra4x4_pred_mode[h->mb2br_xy[mb_xy - 1] + 6 - i]; +s->intra4x4_pred_mode_cache[scan8[0] - 1 + i * 8] = s->intra4x4_pred_mode[s->mb2br_xy[mb_xy - 1] + 6 - i]; if (s->intra4x4_pred_mode_cache[scan8[0] - 1] == -1) s->left_samples_available = 0x5F5F; } if (s->mb_y > 0) { -s->intra4x4_pred_mode_cache[4 + 8 * 0] = s->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride] + 0]; -s->intra4x4_pred_mode_cache[5 + 8 * 0] = s->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride] + 1]; -s->intra4x4_pred_mode_cache[6 + 8 * 0] = s->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride] + 2]; -s->intra4x4_pred_mode_cache[7 + 8 * 0] = s->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride] + 3]; +s->intra4x4_pred_mode_cache[4 + 8 * 0] = s->intra4x4_pred_mode[s->mb2br
[FFmpeg-cvslog] svq3: move mb2br_xy to the SVQ3Context
ffmpeg | branch: master | Anton Khirnov | Wed Mar 23 10:03:50 2016 +0100| [549fc77273636d0d02175362af5dcd60c79f7633] | committer: Anton Khirnov svq3: move mb2br_xy to the SVQ3Context > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=549fc77273636d0d02175362af5dcd60c79f7633 --- libavcodec/svq3.c | 49 - 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index 3c8be4b..8c56995 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -94,6 +94,8 @@ typedef struct SVQ3Context { int mb_x, mb_y; int mb_xy; +uint32_t *mb2br_xy; + int chroma_pred_mode; int intra16x16_pred_mode; @@ -739,7 +741,7 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type) */ for (m = 0; m < 2; m++) { -if (s->mb_x > 0 && s->intra4x4_pred_mode[h->mb2br_xy[mb_xy - 1] + 6] != -1) { +if (s->mb_x > 0 && s->intra4x4_pred_mode[s->mb2br_xy[mb_xy - 1] + 6] != -1) { for (i = 0; i < 4; i++) AV_COPY32(s->mv_cache[m][scan8[0] - 1 + i * 8], h->cur_pic.motion_val[m][b_xy - 1 + i * h->b_stride]); @@ -752,21 +754,21 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type) h->cur_pic.motion_val[m][b_xy - h->b_stride], 4 * 2 * sizeof(int16_t)); memset(&s->ref_cache[m][scan8[0] - 1 * 8], - (s->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride]] == -1) ? PART_NOT_AVAILABLE : 1, 4); + (s->intra4x4_pred_mode[s->mb2br_xy[mb_xy - h->mb_stride]] == -1) ? PART_NOT_AVAILABLE : 1, 4); if (s->mb_x < h->mb_width - 1) { AV_COPY32(s->mv_cache[m][scan8[0] + 4 - 1 * 8], h->cur_pic.motion_val[m][b_xy - h->b_stride + 4]); s->ref_cache[m][scan8[0] + 4 - 1 * 8] = -(s->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride + 1] + 6] == -1 || - s->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride]] == -1) ? PART_NOT_AVAILABLE : 1; +(s->intra4x4_pred_mode[s->mb2br_xy[mb_xy - h->mb_stride + 1] + 6] == -1 || + s->intra4x4_pred_mode[s->mb2br_xy[mb_xy - h->mb_stride]] == -1) ? PART_NOT_AVAILABLE : 1; } else s->ref_cache[m][scan8[0] + 4 - 1 * 8] = PART_NOT_AVAILABLE; if (s->mb_x > 0) { AV_COPY32(s->mv_cache[m][scan8[0] - 1 - 1 * 8], h->cur_pic.motion_val[m][b_xy - h->b_stride - 1]); s->ref_cache[m][scan8[0] - 1 - 1 * 8] = -(s->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride - 1] + 3] == -1) ? PART_NOT_AVAILABLE : 1; +(s->intra4x4_pred_mode[s->mb2br_xy[mb_xy - h->mb_stride - 1] + 3] == -1) ? PART_NOT_AVAILABLE : 1; } else s->ref_cache[m][scan8[0] - 1 - 1 * 8] = PART_NOT_AVAILABLE; } else @@ -802,7 +804,7 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type) mb_type = MB_TYPE_16x16; } else if (mb_type == 8 || mb_type == 33) { /* INTRA4x4 */ -int8_t *i4x4 = s->intra4x4_pred_mode + h->mb2br_xy[s->mb_xy]; +int8_t *i4x4 = s->intra4x4_pred_mode + s->mb2br_xy[s->mb_xy]; int8_t *i4x4_cache = s->intra4x4_pred_mode_cache; memset(s->intra4x4_pred_mode_cache, -1, 8 * 5 * sizeof(int8_t)); @@ -810,15 +812,15 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type) if (mb_type == 8) { if (s->mb_x > 0) { for (i = 0; i < 4; i++) -s->intra4x4_pred_mode_cache[scan8[0] - 1 + i * 8] = s->intra4x4_pred_mode[h->mb2br_xy[mb_xy - 1] + 6 - i]; +s->intra4x4_pred_mode_cache[scan8[0] - 1 + i * 8] = s->intra4x4_pred_mode[s->mb2br_xy[mb_xy - 1] + 6 - i]; if (s->intra4x4_pred_mode_cache[scan8[0] - 1] == -1) s->left_samples_available = 0x5F5F; } if (s->mb_y > 0) { -s->intra4x4_pred_mode_cache[4 + 8 * 0] = s->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride] + 0]; -s->intra4x4_pred_mode_cache[5 + 8 * 0] = s->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride] + 1]; -s->intra4x4_pred_mode_cache[6 + 8 * 0] = s->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride] + 2]; -s->intra4x4_pred_mode_cache[7 + 8 * 0] = s->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride] + 3]; +s->intra4x4_pred_mode_cache[4 + 8 * 0] = s->intra4x4_pred_mode[s->mb2br_xy[mb_xy - h->mb_stride] + 0]; +s->intra4x4_pred_mode_cache[5 + 8 * 0] = s->intra4x4_pred_mode[s->mb2br_xy[mb_xy - h->mb_stride] + 1];
[FFmpeg-cvslog] avutil/log: added test case for av_log_format_line2
ffmpeg | branch: master | Andreas Weis | Wed Apr 27 08:15:18 2016 +0200| [333207224fd8b81a8376c0b6d39bdf2421d53180] | committer: Michael Niedermayer avutil/log: added test case for av_log_format_line2 Signed-off-by: Andreas Weis Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=333207224fd8b81a8376c0b6d39bdf2421d53180 --- libavutil/log.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a/libavutil/log.c b/libavutil/log.c index 0efba7a..7e279ad 100644 --- a/libavutil/log.c +++ b/libavutil/log.c @@ -444,6 +444,17 @@ void avpriv_report_missing_feature(void *avc, const char *msg, ...) // LCOV_EXCL_START #include +static int call_log_format_line2(const char *fmt, char *buffer, int buffer_size, ...) +{ +va_list args; +int ret; +int print_prefix=1; +va_start(args, buffer_size); +ret = av_log_format_line2(NULL, AV_LOG_INFO, fmt, args, buffer, buffer_size, &print_prefix); +va_end(args); +return ret; +} + int main(int argc, char **argv) { int i; @@ -458,6 +469,25 @@ int main(int argc, char **argv) } av_log(NULL, AV_LOG_PANIC, "\n"); } +{ +int result; +char buffer[4]; +result = call_log_format_line2("foo", NULL, 0); +if(result != 3) { +printf("Test NULL buffer failed.\n"); +return 1; +} +result = call_log_format_line2("foo", buffer, 2); +if(result != 3 || strncmp(buffer, "f", 2)) { +printf("Test buffer too small failed.\n"); +return 1; +} +result = call_log_format_line2("foo", buffer, 4); +if(result != 3 || strncmp(buffer, "foo", 4)) { +printf("Test buffer sufficiently big failed.\n"); +return 1; +} +} return 0; } // LCOV_EXCL_STOP ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avutil/log: added av_log_format_line2 which returns buffer length
ffmpeg | branch: master | Andreas Weis | Wed Apr 27 08:15:17 2016 +0200| [fb9187129c3d07ac6d0f7deaa27f1248394d8f91] | committer: Michael Niedermayer avutil/log: added av_log_format_line2 which returns buffer length The new function behaves the same as av_log_format_line, but also forwards the return value from the underlying snprintf call. This will allow callers to accurately determine the size requirements for the line buffer. Signed-off-by: Andreas Weis Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fb9187129c3d07ac6d0f7deaa27f1248394d8f91 --- doc/APIchanges |4 libavutil/log.c | 11 ++- libavutil/log.h | 17 + libavutil/version.h |4 ++-- 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index de72807..d777dc0 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -15,6 +15,10 @@ libavutil: 2015-08-28 API changes, most recent first: +2016-04-27 - xxx - lavu 55.23.100 - log.h + Add a new function av_log_format_line2() which returns number of bytes + written to the target buffer. + 2016-xx-xx - xxx - lavc 57.37.100 - avcodec.h Add a new audio/video encoding and decoding API with decoupled input and output -- avcodec_send_packet(), avcodec_receive_frame(), diff --git a/libavutil/log.c b/libavutil/log.c index 4583519..0efba7a 100644 --- a/libavutil/log.c +++ b/libavutil/log.c @@ -284,10 +284,19 @@ static void format_line(void *avcl, int level, const char *fmt, va_list vl, void av_log_format_line(void *ptr, int level, const char *fmt, va_list vl, char *line, int line_size, int *print_prefix) { +av_log_format_line2(ptr, level, fmt, vl, line, line_size, print_prefix); +} + +int av_log_format_line2(void *ptr, int level, const char *fmt, va_list vl, +char *line, int line_size, int *print_prefix) +{ AVBPrint part[4]; +int ret; + format_line(ptr, level, fmt, vl, part, print_prefix, NULL); -snprintf(line, line_size, "%s%s%s%s", part[0].str, part[1].str, part[2].str, part[3].str); +ret = snprintf(line, line_size, "%s%s%s%s", part[0].str, part[1].str, part[2].str, part[3].str); av_bprint_finalize(part+3, NULL); +return ret; } void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl) diff --git a/libavutil/log.h b/libavutil/log.h index 321748c..9b1d66f 100644 --- a/libavutil/log.h +++ b/libavutil/log.h @@ -317,6 +317,23 @@ AVClassCategory av_default_get_category(void *ptr); void av_log_format_line(void *ptr, int level, const char *fmt, va_list vl, char *line, int line_size, int *print_prefix); +/** + * Format a line of log the same way as the default callback. + * @param line buffer to receive the formatted line; + * may be NULL if line_size is 0 + * @param line_size size of the buffer; at most line_size-1 characters will + * be written to the buffer, plus one null terminator + * @param print_prefix used to store whether the prefix must be printed; + * must point to a persistent integer initially set to 1 + * @return Returns a negative value if an error occured, otherwise returns + * the number of characters that would have been written for a + * sufficiently large buffer, not including the terminating null + * character. If the return value is not less than line_size, it means + * that the log message was truncated to fit the buffer. + */ +int av_log_format_line2(void *ptr, int level, const char *fmt, va_list vl, +char *line, int line_size, int *print_prefix); + #if FF_API_DLOG /** * av_dlog macros diff --git a/libavutil/version.h b/libavutil/version.h index 24bd0d0..57759da 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -64,8 +64,8 @@ */ #define LIBAVUTIL_VERSION_MAJOR 55 -#define LIBAVUTIL_VERSION_MINOR 22 -#define LIBAVUTIL_VERSION_MICRO 101 +#define LIBAVUTIL_VERSION_MINOR 23 +#define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ LIBAVUTIL_VERSION_MINOR, \ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] configure: Don't require nonfree for nvenc
ffmpeg | branch: master | Timo Rothenpieler | Sat Apr 23 18:55:51 2016 +0200| [bc4137d4aa3a75c6b20c6710d07b50dab0a9] | committer: Timo Rothenpieler configure: Don't require nonfree for nvenc As the nvEncodeApi.h header is now MIT licensed, this can be dropped. The loaded CUDA and NVENC libraries are part of the nvidia driver, and thus count as system libraries. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bc4137d4aa3a75c6b20c6710d07b50dab0a9 --- configure |1 - 1 file changed, 1 deletion(-) diff --git a/configure b/configure index ef0b689..6bfc48f 100755 --- a/configure +++ b/configure @@ -4964,7 +4964,6 @@ die_license_disabled gpl x11grab die_license_disabled nonfree cuda die_license_disabled nonfree libfaac die_license_disabled nonfree libnpp -die_license_disabled nonfree nvenc enabled gpl && die_license_disabled_gpl nonfree libfdk_aac enabled gpl && die_license_disabled_gpl nonfree openssl ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/nvenc: Add missing lossless presets to doc string
ffmpeg | branch: master | Timo Rothenpieler | Wed Apr 27 22:22:29 2016 +0200| [c4312b1cf44bda8c8e86a4616554a27b67f244e2] | committer: Timo Rothenpieler avcodec/nvenc: Add missing lossless presets to doc string > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c4312b1cf44bda8c8e86a4616554a27b67f244e2 --- libavcodec/nvenc.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c index 7063f75..c9b4048 100644 --- a/libavcodec/nvenc.c +++ b/libavcodec/nvenc.c @@ -1507,7 +1507,7 @@ static const enum AVPixelFormat pix_fmts_nvenc[] = { #define OFFSET(x) offsetof(NvencContext, x) #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM static const AVOption options[] = { -{ "preset", "Set the encoding preset (one of slow = hq 2pass, medium = hq, fast = hp, hq, hp, bd, ll, llhq, llhp, default)", OFFSET(preset), AV_OPT_TYPE_STRING, { .str = "medium" }, 0, 0, VE }, +{ "preset", "Set the encoding preset (one of slow = hq 2pass, medium = hq, fast = hp, hq, hp, bd, ll, llhq, llhp, lossless, losslesshp, default)", OFFSET(preset), AV_OPT_TYPE_STRING, { .str = "medium" }, 0, 0, VE }, { "profile", "Set the encoding profile (high, main, baseline or high444p)", OFFSET(profile), AV_OPT_TYPE_STRING, { .str = "main" }, 0, 0, VE }, { "level", "Set the encoding level restriction (auto, 1.0, 1.0b, 1.1, 1.2, ..., 4.2, 5.0, 5.1)", OFFSET(level), AV_OPT_TYPE_STRING, { .str = "auto" }, 0, 0, VE }, { "tier", "Set the encoding tier (main or high)", OFFSET(tier), AV_OPT_TYPE_STRING, { .str = "main" }, 0, 0, VE }, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/riff: assign g721 and g723 codec tags to g726 decoder
ffmpeg | branch: master | Piotr Bandurski | Wed Apr 27 20:32:04 2016 +0200| [55e6323090610c5bb5faf29a32bc023c588ec598] | committer: Carl Eugen Hoyos avformat/riff: assign g721 and g723 codec tags to g726 decoder > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=55e6323090610c5bb5faf29a32bc023c588ec598 --- libavformat/riff.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/riff.c b/libavformat/riff.c index 5150f4d..5bc8491 100644 --- a/libavformat/riff.c +++ b/libavformat/riff.c @@ -444,6 +444,8 @@ const AVCodecTag ff_codec_wav_tags[] = { { AV_CODEC_ID_AMR_NB, 0x0038 }, /* rogue format number */ { AV_CODEC_ID_G723_1, 0x0042 }, { AV_CODEC_ID_ADPCM_G726, 0x0045 }, +{ AV_CODEC_ID_ADPCM_G726, 0x0014 }, +{ AV_CODEC_ID_ADPCM_G726, 0x0040 }, { AV_CODEC_ID_MP2, 0x0050 }, { AV_CODEC_ID_MP3, 0x0055 }, { AV_CODEC_ID_AMR_NB, 0x0057 }, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avutil/log: Fix occured typo
ffmpeg | branch: master | Michael Niedermayer | Wed Apr 27 23:21:08 2016 +0200| [492011f3c6d729665a0aa67690d1ce410c2a6a06] | committer: Michael Niedermayer avutil/log: Fix occured typo Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=492011f3c6d729665a0aa67690d1ce410c2a6a06 --- libavutil/log.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/log.h b/libavutil/log.h index 9b1d66f..0acc1b9 100644 --- a/libavutil/log.h +++ b/libavutil/log.h @@ -325,7 +325,7 @@ void av_log_format_line(void *ptr, int level, const char *fmt, va_list vl, * be written to the buffer, plus one null terminator * @param print_prefix used to store whether the prefix must be printed; * must point to a persistent integer initially set to 1 - * @return Returns a negative value if an error occured, otherwise returns + * @return Returns a negative value if an error occurred, otherwise returns * the number of characters that would have been written for a * sufficiently large buffer, not including the terminating null * character. If the return value is not less than line_size, it means ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] update for 3.0.2
ffmpeg | branch: release/3.0 | Michael Niedermayer | Thu Apr 28 01:40:54 2016 +0200| [ad559492dc75e7e6d74c48889eb6b90918a39126] | committer: Michael Niedermayer update for 3.0.2 Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ad559492dc75e7e6d74c48889eb6b90918a39126 --- Changelog| 19 +++ RELEASE |2 +- doc/Doxyfile |2 +- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/Changelog b/Changelog index 8776e0d..5cb30a0 100644 --- a/Changelog +++ b/Changelog @@ -1,6 +1,25 @@ Entries are sorted chronologically from oldest to youngest within each release, releases are sorted from youngest to oldest. + +version 3.0.2: +- avcodec/ttaenc: Reallocate packet if its too small +- configure: build fix for P5600 with mips code restructuring +- mips: add support for R6 +- pgssubdec: fix subpicture output colorspace and range +- avcodec/ac3dec: Reset SPX when switching from EAC3 to AC3 +- avfilter/vf_drawtext: Check return code of load_glyph() +- avformat/mux: Check that deinit is set before calling it +- avcodec/takdec: add code that got somehow lost in process of REing +- avcodec/apedec: fix decoding of stereo files with one channel full of silence +- avcodec/avpacket: Fix off by 5 error +- avcodec/h264: Fix for H.264 configuration parsing +- avcodec/bmp_parser: Ensure remaining_size is not too small in startcode packet crossing corner case +- avcodec/pngdec: Fix alpha detection with skip_frame +- Changelog: Make formating consistent +- avfilter/src_movie: fix how we check for overflows with seek_point +- avcodec/j2kenc: Add attribution to OpenJPEG project: + version 3.0.1: - avcodec/libutvideodec: copy frame so it has reference counters when refcounted_frames is set - avformat/rtpdec_jpeg: fix low contrast image on low quality setting diff --git a/RELEASE b/RELEASE index cb2b00e..b502146 100644 --- a/RELEASE +++ b/RELEASE @@ -1 +1 @@ -3.0.1 +3.0.2 diff --git a/doc/Doxyfile b/doc/Doxyfile index c001ef7..845d8dc 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 3.0.1 +PROJECT_NUMBER = 3.0.2 # With the PROJECT_LOGO tag one can specify a logo or icon that is included # in the documentation. The maximum height of the logo should not exceed 55 ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/ttaenc: Reallocate packet if its too small
ffmpeg | branch: release/3.0 | Michael Niedermayer | Tue Apr 26 19:17:19 2016 +0200| [8d0cfa68b9a49f96e90f6c3704c18d1edbd91b33] | committer: Michael Niedermayer avcodec/ttaenc: Reallocate packet if its too small Fixes assertion failure Fixes Ticket5394 Signed-off-by: Michael Niedermayer (cherry picked from commit 005c61c6b8982f977e415aa69d2d2b42e6b7f3f2) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8d0cfa68b9a49f96e90f6c3704c18d1edbd91b33 --- libavcodec/ttaenc.c | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/libavcodec/ttaenc.c b/libavcodec/ttaenc.c index 0df1fcb..2f1c8db 100644 --- a/libavcodec/ttaenc.c +++ b/libavcodec/ttaenc.c @@ -114,9 +114,12 @@ static int tta_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, { TTAEncContext *s = avctx->priv_data; PutBitContext pb; -int ret, i, out_bytes, cur_chan = 0, res = 0, samples = 0; +int ret, i, out_bytes, cur_chan, res, samples; +int64_t pkt_size = frame->nb_samples * 2LL * avctx->channels * s->bps; -if ((ret = ff_alloc_packet2(avctx, avpkt, frame->nb_samples * 2 * avctx->channels * s->bps, 0)) < 0) +pkt_alloc: +cur_chan = 0, res = 0, samples = 0; +if ((ret = ff_alloc_packet2(avctx, avpkt, pkt_size, 0)) < 0) return ret; init_put_bits(&pb, avpkt->data, avpkt->size); @@ -174,6 +177,14 @@ static int tta_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, rice->k1++; unary = 1 + (outval >> k); +if (unary + 100LL > put_bits_left(&pb)) { +if (pkt_size < INT_MAX/2) { +pkt_size *= 2; +av_packet_unref(avpkt); +goto pkt_alloc; +} else +return AVERROR(ENOMEM); +} do { if (unary > 31) { put_bits(&pb, 31, 0x7FFF); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/riff: support for matrox m703 mpeg-2
ffmpeg | branch: master | Александр Слободенюк | Tue Apr 26 17:11:26 2016 +0300| [688664e02d2faa12dcaaabd5a84a338d2e05828c] | committer: Michael Niedermayer avformat/riff: support for matrox m703 mpeg-2 Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=688664e02d2faa12dcaaabd5a84a338d2e05828c --- libavformat/riff.c |1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/riff.c b/libavformat/riff.c index 5bc8491..ca249f9 100644 --- a/libavformat/riff.c +++ b/libavformat/riff.c @@ -169,6 +169,7 @@ const AVCodecTag ff_codec_bmp_tags[] = { { AV_CODEC_ID_MPEG2VIDEO, MKTAG('E', 'M', '2', 'V') }, /* Matrox MPEG-2 intra-only */ { AV_CODEC_ID_MPEG2VIDEO, MKTAG('M', '7', '0', '1') }, +{ AV_CODEC_ID_MPEG2VIDEO, MKTAG('M', '7', '0', '3') }, { AV_CODEC_ID_MPEG2VIDEO, MKTAG('M', '7', '0', '5') }, { AV_CODEC_ID_MPEG2VIDEO, MKTAG('m', 'p', 'g', 'v') }, { AV_CODEC_ID_MPEG1VIDEO, MKTAG('B', 'W', '1', '0') }, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] configure: Allow choice in choosing a symlink command
ffmpeg | branch: master | Dave Yeo | Mon Apr 25 07:39:08 2016 -0700| [3cb3dddeb49003cd7c1503889b60ce652aafd912] | committer: Michael Niedermayer configure: Allow choice in choosing a symlink command Signed-off-by: Dave Yeo Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3cb3dddeb49003cd7c1503889b60ce652aafd912 --- configure |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/configure b/configure index c7512b8..89754fd 100755 --- a/configure +++ b/configure @@ -314,6 +314,7 @@ Toolchain options: --nm=NM use nm tool NM [$nm_default] --ar=AR use archive tool AR [$ar_default] --as=AS use assembler AS [$as_default] + --ln_s=LN_S use symbolic link tool LN_S [$ln_s_default] --strip=STRIPuse strip tool STRIP [$strip_default] --windres=WINDRESuse windows resource compiler WINDRES [$windres_default] --yasmexe=EXEuse yasm-compatible assembler EXE [$yasmexe_default] @@ -2137,6 +2138,7 @@ CMDLINE_SET=" host_os install ld +ln_s logfile malloc_prefix nm @@ -3078,7 +3080,7 @@ host_cc_default="gcc" cp_f="cp -f" doxygen_default="doxygen" install="install" -ln_s="ln -s -f" +ln_s_default="ln -s -f" nm_default="nm -g" objformat="elf" pkg_config_default=pkg-config @@ -4001,7 +4003,7 @@ test -n "$cc_type" && enable $cc_type || : ${dep_cc_default:=$cc} : ${ld_default:=$cc} : ${host_ld_default:=$host_cc} -set_default ar as objcc dep_cc ld host_ld windres +set_default ar as objcc dep_cc ld ln_s host_ld windres probe_cc as "$as" asflags_filter=$_flags_filter ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] configure: Do not create/install versioned DLLs on OS/2.
ffmpeg | branch: master | Dmitriy Kuminov | Thu Apr 14 01:45:01 2016 +0400| [5d7696fe2b402c20a3b01c7acd2012b0daa53a28] | committer: Michael Niedermayer configure: Do not create/install versioned DLLs on OS/2. Only one DLL for each module must be present on OS/2: SLIBNAME_WITH_MAJOR (the same as on Windows). Creating other DLLs makes no sense as they can't be used. Signed-off-by: Dave Yeo Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5d7696fe2b402c20a3b01c7acd2012b0daa53a28 --- configure | 23 --- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/configure b/configure index 6bfc48f..c7512b8 100755 --- a/configure +++ b/configure @@ -4716,7 +4716,6 @@ case $target_os in ;; os/2*) strip="lxlite -CS" -ln_s="cp -f" objformat="aout" add_cppflags -D_GNU_SOURCE add_ldflags -Zomf -Zbin-files -Zargs-wild -Zmap @@ -4724,16 +4723,18 @@ case $target_os in LIBSUF="_s.a" SLIBPREF="" SLIBSUF=".dll" -SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)' -SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(NAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)' -SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(NAME).def; \ -echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(NAME).def; \ -echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(NAME).def; \ -echo EXPORTS >> $(SUBDIR)$(NAME).def; \ -emxexp $(OBJS) >> $(SUBDIR)$(NAME).def' -SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(NAME).def; \ -emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib $(SUBDIR)$(NAME).def;' -SLIB_INSTALL_EXTRA_LIB='$(LIBPREF)$(NAME)_dll.a $(LIBPREF)$(NAME)_dll.lib' +SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)' +SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(FULLNAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)' +SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(FULLNAME).def; \ +echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(FULLNAME).def; \ +echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(FULLNAME).def; \ +echo EXPORTS >> $(SUBDIR)$(FULLNAME).def; \ +emxexp $(OBJS) >> $(SUBDIR)$(FULLNAME).def' +SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(FULLNAME)_dll.a $(SUBDIR)$(FULLNAME).def; \ +emximp -o $(SUBDIR)$(LIBPREF)$(FULLNAME)_dll.lib $(SUBDIR)$(FULLNAME).def;' +SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)' +SLIB_INSTALL_LINKS= +SLIB_INSTALL_EXTRA_LIB='$(LIBPREF)$(FULLNAME)_dll.a $(LIBPREF)$(FULLNAME)_dll.lib' enable dos_paths enable_weak os2threads ;; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Changelog: Fix minor formating inconsistency
ffmpeg | branch: release/3.0 | Michael Niedermayer | Thu Apr 28 03:03:39 2016 +0200| [c66f4d1ae64dffaf456d05cbdade02054446f499] | committer: Michael Niedermayer Changelog: Fix minor formating inconsistency Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c66f4d1ae64dffaf456d05cbdade02054446f499 --- Changelog |1 + 1 file changed, 1 insertion(+) diff --git a/Changelog b/Changelog index 5cb30a0..248f8b5 100644 --- a/Changelog +++ b/Changelog @@ -20,6 +20,7 @@ version 3.0.2: - avfilter/src_movie: fix how we check for overflows with seek_point - avcodec/j2kenc: Add attribution to OpenJPEG project: + version 3.0.1: - avcodec/libutvideodec: copy frame so it has reference counters when refcounted_frames is set - avformat/rtpdec_jpeg: fix low contrast image on low quality setting ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Tag n3.0.2 : FFmpeg 3.0.2 release
[ffmpeg] [branch: refs/tags/n3.0.2] Tag:16566ecee9010515ff1216f953a406ebe4c53530 > http://git.videolan.org/gitweb.cgi/ffmpeg.git?a=tag;h=16566ecee9010515ff1216f953a406ebe4c53530 Tagger: Michael Niedermayer Date: Thu Apr 28 03:04:25 2016 +0200 FFmpeg 3.0.2 release ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] [ffmpeg-web] branch master updated. fbe0f6f web/download: add FFmpeg 3.0.2
The branch, master has been updated via fbe0f6ffc834ee53e5ff13699f675b9022f4da23 (commit) from 8d5702e4957f29b8d390dd5a24208b516cf3c8be (commit) - Log - commit fbe0f6ffc834ee53e5ff13699f675b9022f4da23 Author: Michael Niedermayer AuthorDate: Thu Apr 28 03:44:34 2016 +0200 Commit: Michael Niedermayer CommitDate: Thu Apr 28 03:44:34 2016 +0200 web/download: add FFmpeg 3.0.2 diff --git a/src/download b/src/download index e3a35e0..746d098 100644 --- a/src/download +++ b/src/download @@ -1,10 +1,10 @@ -http://ffmpeg.org/releases/ffmpeg-3.0.1.tar.bz2"; class="btn btn-success"> +http://ffmpeg.org/releases/ffmpeg-3.0.2.tar.bz2"; class="btn btn-success"> Download - ffmpeg-3.0.1.tar.bz2 + ffmpeg-3.0.2.tar.bz2 More releases @@ -270,10 +270,10 @@ - FFmpeg 3.0.1 "Einstein" + FFmpeg 3.0.2 "Einstein" -3.0.1 was released on 2016-03-29. It is the latest stable FFmpeg release +3.0.2 was released on 2016-04-28. It is the latest stable FFmpeg release from the 3.0 release branch, which was cut from master on 2016-02-14. It includes the following library versions: @@ -291,19 +291,19 @@ libpostproc54. 0.100 - Download xz tarball - PGP signature + Download xz tarball + PGP signature - Download bzip2 tarball - PGP signature + Download bzip2 tarball + PGP signature - Download gzip tarball - PGP signature + Download gzip tarball + PGP signature - http://git.videolan.org/?p=ffmpeg.git;a=shortlog;h=n3.0.1";>Changelog + http://git.videolan.org/?p=ffmpeg.git;a=shortlog;h=n3.0.2";>Changelog http://git.videolan.org/?p=ffmpeg.git;a=blob;f=RELEASE_NOTES;hb=release/3.0";>Release Notes --- Summary of changes: src/download | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) hooks/post-receive -- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/avpacket: Fix off by 5 error
ffmpeg | branch: release/2.7 | Michael Niedermayer | Wed Apr 20 22:38:26 2016 +0200| [cff516d9e841388c3cf805dd179f7305b84050f3] | committer: Michael Niedermayer avcodec/avpacket: Fix off by 5 error Fixes out of array read Fixes: mozilla bug 1266129 Found-by: Tyson Smith Tested-by: Tyson Smith Signed-off-by: Michael Niedermayer (cherry picked from commit 9f36ea57ae6eefb42432220feab0350494f4144c) Conflicts: libavcodec/avpacket.c > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cff516d9e841388c3cf805dd179f7305b84050f3 --- libavcodec/avpacket.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c index b73cf21..230ddb0 100644 --- a/libavcodec/avpacket.c +++ b/libavcodec/avpacket.c @@ -411,10 +411,12 @@ int av_packet_split_side_data(AVPacket *pkt){ p = pkt->data + pkt->size - 8 - 5; for (i=1; ; i++){ size = AV_RB32(p); -if (size>INT_MAX || p - pkt->data < size) +if (size>INT_MAX - 5 || p - pkt->data < size) return 0; if (p[4]&128) break; +if (p - pkt->data < size + 5) +return 0; p-= size+5; } @@ -425,7 +427,7 @@ int av_packet_split_side_data(AVPacket *pkt){ p= pkt->data + pkt->size - 8 - 5; for (i=0; ; i++){ size= AV_RB32(p); -av_assert0(size<=INT_MAX && p - pkt->data >= size); +av_assert0(size<=INT_MAX - 5 && p - pkt->data >= size); pkt->side_data[i].data = av_mallocz(size + FF_INPUT_BUFFER_PADDING_SIZE); pkt->side_data[i].size = size; pkt->side_data[i].type = p[4]&127; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/imgconvert: Support non-planar colorspaces while padding
ffmpeg | branch: release/2.7 | Przemysław Sobala | Fri Sep 18 15:40:58 2015 +0200| [873ca2839052563b3f43b6f8a553fdde9371f76a] | committer: Michael Niedermayer avcodec/imgconvert: Support non-planar colorspaces while padding Signed-off-by: Michael Niedermayer (cherry picked from commit 0d097a869c38850c9ac09bccef60a229470f489b) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=873ca2839052563b3f43b6f8a553fdde9371f76a --- libavcodec/imgconvert.c | 37 +++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c index 8cb6099..8336460 100644 --- a/libavcodec/imgconvert.c +++ b/libavcodec/imgconvert.c @@ -236,9 +236,41 @@ int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, int x_shift; int yheight; int i, y; +int max_step[4]; -if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB || -!is_yuv_planar(desc)) return -1; +if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) +return -1; + +if (!is_yuv_planar(desc)) { +if (src) +return -1; //TODO: Not yet implemented + +av_image_fill_max_pixsteps(max_step, NULL, desc); + +if (padtop || padleft) { +memset(dst->data[0], color[0], +dst->linesize[0] * padtop + (padleft * max_step[0])); +} + +if (padleft || padright) { +optr = dst->data[0] + dst->linesize[0] * padtop + +(dst->linesize[0] - (padright * max_step[0])); +yheight = height - 1 - (padtop + padbottom); +for (y = 0; y < yheight; y++) { +memset(optr, color[0], (padleft + padright) * max_step[0]); +optr += dst->linesize[0]; +} +} + +if (padbottom || padright) { +optr = dst->data[0] + dst->linesize[0] * (height - padbottom) - +(padright * max_step[0]); +memset(optr, color[0], dst->linesize[0] * padbottom + +(padright * max_step[0])); +} + +return 0; +} for (i = 0; i < 3; i++) { x_shift = i ? desc->log2_chroma_w : 0; @@ -284,6 +316,7 @@ int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, (padbottom >> y_shift) + (padright >> x_shift)); } } + return 0; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/h264: Fix for H.264 configuration parsing
ffmpeg | branch: release/2.7 | Ivan | Tue Apr 12 16:32:04 2016 -0400| [0696a555b6a516ce569bb2320b512dc790e747b4] | committer: Michael Niedermayer avcodec/h264: Fix for H.264 configuration parsing Sometimes video fails to decode if H.264 configuration changes mid stream. The reason is that configuration parser assumes that nal_ref_idc is equal to 11b while actually some codecs but 01b there. The H.264 spec is somewhat vague about this but it looks like it allows any non-zero nal_ref_idc for sps/pps. Signed-off-by: Michael Niedermayer (cherry picked from commit 3a727606c474d3d0b9efa3c900294a84bdb5e331) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0696a555b6a516ce569bb2320b512dc790e747b4 --- libavcodec/h264.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 1f5f4a0..692cd62 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -1737,7 +1737,7 @@ static int is_extra(const uint8_t *buf, int buf_size) const uint8_t *p= buf+6; while(cnt--){ int nalsize= AV_RB16(p) + 2; -if(nalsize > buf_size - (p-buf) || p[2]!=0x67) +if(nalsize > buf_size - (p-buf) || (p[2] & 0x9F) != 7) return 0; p += nalsize; } @@ -1746,7 +1746,7 @@ static int is_extra(const uint8_t *buf, int buf_size) return 0; while(cnt--){ int nalsize= AV_RB16(p) + 2; -if(nalsize > buf_size - (p-buf) || p[2]!=0x68) +if(nalsize > buf_size - (p-buf) || (p[2] & 0x9F) != 8) return 0; p += nalsize; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/takdec: add code that got somehow lost in process of REing
ffmpeg | branch: release/2.7 | Paul B Mahol | Wed Apr 20 22:45:05 2016 +0200| [cec42e6f4de3b040fac34eb99dc1acbb2cfdcbee] | committer: Michael Niedermayer avcodec/takdec: add code that got somehow lost in process of REing Signed-off-by: Paul B Mahol (cherry picked from commit 38797a8033d061ade58b30b8ac86da222fe42a84) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cec42e6f4de3b040fac34eb99dc1acbb2cfdcbee --- libavcodec/takdec.c |1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/takdec.c b/libavcodec/takdec.c index 28f884a..fbec0e0 100644 --- a/libavcodec/takdec.c +++ b/libavcodec/takdec.c @@ -224,6 +224,7 @@ static void decode_lpc(int32_t *coeffs, int mode, int length) int a3 = coeffs[2]; int a4 = a3 + a1; int a5 = a4 + a2; +coeffs[2] = a5; coeffs += 3; for (i = 0; i < length - 3; i++) { a3 += *coeffs; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] indeo2: Fix banding artefacts
ffmpeg | branch: release/2.7 | Luca Barbato | Mon Feb 22 19:58:19 2016 -0500| [fbe2f77e3f7371e838e865bbdb7e781f33323e88] | committer: Michael Niedermayer indeo2: Fix banding artefacts Rename luma table to delta table and change how it is used. CC: libav-sta...@libav.org Signed-off-by: Vittorio Giovara Signed-off-by: Diego Biurrun (cherry picked from commit f8c34f4b8d62afad3f63cf3d9617d73735bef8c1) (cherry picked from commit 73f3c8f73edf0a69502233b2c50fa9e7104f99ec) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fbe2f77e3f7371e838e865bbdb7e781f33323e88 --- libavcodec/indeo2.c | 15 +++-- libavcodec/indeo2data.h | 162 +-- 2 files changed, 138 insertions(+), 39 deletions(-) diff --git a/libavcodec/indeo2.c b/libavcodec/indeo2.c index 39735c2..b265668 100644 --- a/libavcodec/indeo2.c +++ b/libavcodec/indeo2.c @@ -146,6 +146,7 @@ static int ir2_decode_frame(AVCodecContext *avctx, AVFrame *picture = data; AVFrame * const p= s->picture; int start, ret; +int ltab, ctab; if ((ret = ff_reget_buffer(avctx, p)) < 0) return ret; @@ -167,34 +168,36 @@ static int ir2_decode_frame(AVCodecContext *avctx, init_get_bits(&s->gb, buf + start, (buf_size - start) * 8); +ltab = buf[0x22] & 3; +ctab = buf[0x22] >> 2; if (s->decode_delta) { /* intraframe */ if ((ret = ir2_decode_plane(s, avctx->width, avctx->height, p->data[0], p->linesize[0], -ir2_luma_table)) < 0) +ir2_delta_table[ltab])) < 0) return ret; /* swapped U and V */ if ((ret = ir2_decode_plane(s, avctx->width >> 2, avctx->height >> 2, p->data[2], p->linesize[2], -ir2_luma_table)) < 0) +ir2_delta_table[ctab])) < 0) return ret; if ((ret = ir2_decode_plane(s, avctx->width >> 2, avctx->height >> 2, p->data[1], p->linesize[1], -ir2_luma_table)) < 0) +ir2_delta_table[ctab])) < 0) return ret; } else { /* interframe */ if ((ret = ir2_decode_plane_inter(s, avctx->width, avctx->height, p->data[0], p->linesize[0], - ir2_luma_table)) < 0) + ir2_delta_table[ltab])) < 0) return ret; /* swapped U and V */ if ((ret = ir2_decode_plane_inter(s, avctx->width >> 2, avctx->height >> 2, p->data[2], p->linesize[2], - ir2_luma_table)) < 0) + ir2_delta_table[ctab])) < 0) return ret; if ((ret = ir2_decode_plane_inter(s, avctx->width >> 2, avctx->height >> 2, p->data[1], p->linesize[1], - ir2_luma_table)) < 0) + ir2_delta_table[ctab])) < 0) return ret; } diff --git a/libavcodec/indeo2data.h b/libavcodec/indeo2data.h index 8fd664c..e05c91f 100644 --- a/libavcodec/indeo2data.h +++ b/libavcodec/indeo2data.h @@ -103,39 +103,135 @@ static const uint16_t ir2_codes[IR2_CODES][2] = { #endif }; -static const uint8_t ir2_luma_table[256] = { -0x80, 0x80, 0x84, 0x84, 0x7C, 0x7C, 0x7F, 0x85, -0x81, 0x7B, 0x85, 0x7F, 0x7B, 0x81, 0x8C, 0x8C, -0x74, 0x74, 0x83, 0x8D, 0x7D, 0x73, 0x8D, 0x83, -0x73, 0x7D, 0x77, 0x89, 0x89, 0x77, 0x89, 0x77, -0x77, 0x89, 0x8C, 0x95, 0x74, 0x6B, 0x95, 0x8C, -0x6B, 0x74, 0x7C, 0x90, 0x84, 0x70, 0x90, 0x7C, -0x70, 0x84, 0x96, 0x96, 0x6A, 0x6A, 0x82, 0x98, -0x7E, 0x68, 0x98, 0x82, 0x68, 0x7E, 0x97, 0xA2, -0x69, 0x5E, 0xA2, 0x97, 0x5E, 0x69, 0xA2, 0xA2, -0x5E, 0x5E, 0x8B, 0xA3, 0x75, 0x5D, 0xA3, 0x8B, -0x5D, 0x75, 0x71, 0x95, 0x8F, 0x6B, 0x95, 0x71, -0x6B, 0x8F, 0x78, 0x9D, 0x88, 0x63, 0x9D, 0x78, -0x63, 0x88, 0x7F, 0xA7, 0x81, 0x59, 0xA7, 0x7F, -0x59, 0x81, 0xA4, 0xB1, 0x5C, 0x4F, 0xB1, 0xA4, -0x4F, 0x5C, 0x96, 0xB1, 0x6A, 0x4F, 0xB1, 0x96, -0x4F, 0x6A, 0xB2, 0xB2, 0x4E, 0x4E, 0x65, 0x9B, -0x9B, 0x65, 0x9B, 0x65, 0x65, 0x9B, 0x89, 0xB4, -0x77, 0x4C, 0xB4, 0x89, 0x4C, 0x77, 0x6A, 0xA3, -0x96, 0x5D, 0xA3, 0x6A, 0x5D, 0x96, 0x73, 0xAC, -0x8D, 0x54, 0xAC, 0x73, 0x54, 0x8D, 0xB4, 0xC3, -0x4C, 0x3D, 0xC3, 0xB4, 0x3D, 0x4C, 0xA4, 0xC3, -0x5C, 0x3D, 0xC3, 0xA4, 0x3D, 0x5C, 0xC4, 0xC4, -0x3C, 0x3C, 0x96, 0xC6, 0x6A, 0x3A, 0xC6, 0x96, -0x3A, 0x6A, 0x7C, 0xBA, 0x84, 0x46, 0xBA, 0x7C, -0x46, 0x84, 0x5B, 0xAB, 0xA5, 0x55, 0xAB, 0x5B, -0x55, 0xA5, 0x63, 0xB4, 0x9D,
[FFmpeg-cvslog] avutil/pixdesc: Make get_color_type() aware of CIE XYZ formats
ffmpeg | branch: release/2.7 | Michael Niedermayer | Mon Feb 22 03:31:34 2016 +0100| [b8148973c59b717e9eff92e55825698a660da972] | committer: Michael Niedermayer avutil/pixdesc: Make get_color_type() aware of CIE XYZ formats Signed-off-by: Michael Niedermayer (cherry picked from commit 1ec7a703806049265991723a8826bd61555edef4) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b8148973c59b717e9eff92e55825698a660da972 --- libavutil/pixdesc.c |4 1 file changed, 4 insertions(+) diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index 32dc4b8..29913fd 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -2208,6 +2208,7 @@ enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt) #define FF_COLOR_GRAY 1 /**< gray color space */ #define FF_COLOR_YUV 2 /**< YUV color space. 16 <= Y <= 235, 16 <= U, V <= 240 */ #define FF_COLOR_YUV_JPEG 3 /**< YUV color space. 0 <= Y <= 255, 0 <= U, V <= 255 */ +#define FF_COLOR_XYZ 4 #define pixdesc_has_alpha(pixdesc) \ ((pixdesc)->nb_components == 2 || (pixdesc)->nb_components == 4 || (pixdesc)->flags & AV_PIX_FMT_FLAG_PAL) @@ -2223,6 +2224,9 @@ static int get_color_type(const AVPixFmtDescriptor *desc) { if(desc->name && !strncmp(desc->name, "yuvj", 4)) return FF_COLOR_YUV_JPEG; +if(desc->name && !strncmp(desc->name, "xyz", 3)) +return FF_COLOR_XYZ; + if(desc->flags & AV_PIX_FMT_FLAG_RGB) return FF_COLOR_RGB; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/ttaenc: Reallocate packet if its too small
ffmpeg | branch: release/2.7 | Michael Niedermayer | Tue Apr 26 19:17:19 2016 +0200| [d94d786bf06bc87c53305cfb9ffd13dce1ff58b1] | committer: Michael Niedermayer avcodec/ttaenc: Reallocate packet if its too small Fixes assertion failure Fixes Ticket5394 Signed-off-by: Michael Niedermayer (cherry picked from commit 005c61c6b8982f977e415aa69d2d2b42e6b7f3f2) Conflicts: libavcodec/ttaenc.c > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d94d786bf06bc87c53305cfb9ffd13dce1ff58b1 --- libavcodec/ttaenc.c | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/libavcodec/ttaenc.c b/libavcodec/ttaenc.c index ccd41a9..37624a9 100644 --- a/libavcodec/ttaenc.c +++ b/libavcodec/ttaenc.c @@ -114,9 +114,12 @@ static int tta_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, { TTAEncContext *s = avctx->priv_data; PutBitContext pb; -int ret, i, out_bytes, cur_chan = 0, res = 0, samples = 0; +int ret, i, out_bytes, cur_chan, res, samples; +int64_t pkt_size = frame->nb_samples * 2LL * avctx->channels * s->bps; -if ((ret = ff_alloc_packet2(avctx, avpkt, frame->nb_samples * 2 * avctx->channels * s->bps)) < 0) +pkt_alloc: +cur_chan = 0, res = 0, samples = 0; +if ((ret = ff_alloc_packet2(avctx, avpkt, pkt_size)) < 0) return ret; init_put_bits(&pb, avpkt->data, avpkt->size); @@ -174,6 +177,14 @@ static int tta_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, rice->k1++; unary = 1 + (outval >> k); +if (unary + 100LL > put_bits_left(&pb)) { +if (pkt_size < INT_MAX/2) { +pkt_size *= 2; +av_packet_unref(avpkt); +goto pkt_alloc; +} else +return AVERROR(ENOMEM); +} do { if (unary > 31) { put_bits(&pb, 31, 0x7FFF); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/cache: Fix memleak of tree entries
ffmpeg | branch: release/2.7 | Michael Niedermayer | Wed Mar 2 14:09:23 2016 +0100| [dc92c6045f94a56fcf9bdee5225749809b444a7a] | committer: Michael Niedermayer avformat/cache: Fix memleak of tree entries Found-by: jamrial Signed-off-by: Michael Niedermayer (cherry picked from commit 554f6e930ce05a4c5449efcaae36bdafe2d9de74) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dc92c6045f94a56fcf9bdee5225749809b444a7a --- libavformat/cache.c |7 +++ 1 file changed, 7 insertions(+) diff --git a/libavformat/cache.c b/libavformat/cache.c index d3d12bb..7cb6c22 100644 --- a/libavformat/cache.c +++ b/libavformat/cache.c @@ -282,6 +282,12 @@ resolve_eof: return ret; } +static int enu_free(void *opaque, void *elem) +{ +av_free(elem); +return 0; +} + static int cache_close(URLContext *h) { Context *c= h->priv_data; @@ -291,6 +297,7 @@ static int cache_close(URLContext *h) close(c->fd); ffurl_close(c->inner); +av_tree_enumerate(c->root, NULL, NULL, enu_free); av_tree_destroy(c->root); return 0; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/ac3dec: Reset SPX when switching from EAC3 to AC3
ffmpeg | branch: release/2.7 | Michael Niedermayer | Mon Apr 25 04:08:21 2016 +0200| [49fc747b4874e9c21fc37811c612add2d1eb7eda] | committer: Michael Niedermayer avcodec/ac3dec: Reset SPX when switching from EAC3 to AC3 Fixes Ticket5319 Signed-off-by: Michael Niedermayer (cherry picked from commit 9ac154d1facd4756db6918f866dccf3e3ffb698c) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=49fc747b4874e9c21fc37811c612add2d1eb7eda --- libavcodec/ac3dec.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index 234b469..d06b281 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -901,11 +901,13 @@ static int decode_audio_block(AC3DecodeContext *s, int blk) ff_eac3_default_spx_band_struct, &s->num_spx_bands, s->spx_band_sizes); -} else { -for (ch = 1; ch <= fbw_channels; ch++) { -s->channel_uses_spx[ch] = 0; -s->first_spx_coords[ch] = 1; -} +} +} +if (!s->eac3 || !s->spx_in_use) { +s->spx_in_use = 0; +for (ch = 1; ch <= fbw_channels; ch++) { +s->channel_uses_spx[ch] = 0; +s->first_spx_coords[ch] = 1; } } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/concatdec: set safe mode to enabled instead of auto
ffmpeg | branch: release/2.7 | Michael Niedermayer | Tue Jan 19 22:13:14 2016 +0100| [72b224e3f67a3c2f9cb8954a92e0bc3450ac3634] | committer: Michael Niedermayer avformat/concatdec: set safe mode to enabled instead of auto This is safer, as a selected demuxer could still mean that it was auto-detected by a user application Reviewed-previously-by: Nicolas George Reviewed-previously-by: Andreas Cadhalpun Signed-off-by: Michael Niedermayer (cherry picked from commit 689211d5727231c3fe92762d224dbadebdbf4e30) Conflicts: libavformat/concatdec.c > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=72b224e3f67a3c2f9cb8954a92e0bc3450ac3634 --- doc/demuxers.texi |6 -- libavformat/concatdec.c |2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/demuxers.texi b/doc/demuxers.texi index 6f9effc..45949db 100644 --- a/doc/demuxers.texi +++ b/doc/demuxers.texi @@ -98,7 +98,7 @@ All subsequent file-related directives apply to that file. @item @code{ffconcat version 1.0} Identify the script type and version. It also sets the @option{safe} option -to 1 if it was to its default -1. +to 1 if it was -1. To make FFmpeg recognize the format automatically, this directive must appears exactly as is (no extra space or byte-order-mark) on the very first @@ -145,7 +145,9 @@ component. If set to 0, any file name is accepted. -The default is -1, it is equivalent to 1 if the format was automatically +The default is 1. + +-1 is equivalent to 1 if the format was automatically probed and 0 otherwise. @item auto_convert diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c index 07db9f9..0b14347 100644 --- a/libavformat/concatdec.c +++ b/libavformat/concatdec.c @@ -625,7 +625,7 @@ static int concat_seek(AVFormatContext *avf, int stream, static const AVOption options[] = { { "safe", "enable safe mode", - OFFSET(safe), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 1, DEC }, + OFFSET(safe), AV_OPT_TYPE_INT, {.i64 = 1}, -1, 1, DEC }, { "auto_convert", "automatically convert bitstream format", OFFSET(auto_convert), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, DEC }, { NULL } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avutil/frame: Free destination qp_table_buf in frame_copy_props()
ffmpeg | branch: release/2.7 | Michael Niedermayer | Sat Feb 13 20:57:26 2016 +0100| [46e791a9b35f2479058fe02a3d3a0d84edc05e46] | committer: Michael Niedermayer avutil/frame: Free destination qp_table_buf in frame_copy_props() Fixes memleak Fixes: Ticket4899 Signed-off-by: Michael Niedermayer (cherry picked from commit 4099e4a77d2d49e2308415d92766ad1511f62f9a) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=46e791a9b35f2479058fe02a3d3a0d84edc05e46 --- libavutil/frame.c |1 + 1 file changed, 1 insertion(+) diff --git a/libavutil/frame.c b/libavutil/frame.c index 4596927..e6d1a21 100644 --- a/libavutil/frame.c +++ b/libavutil/frame.c @@ -348,6 +348,7 @@ static int frame_copy_props(AVFrame *dst, const AVFrame *src, int force_copy) dst->qscale_table = NULL; dst->qstride = 0; dst->qscale_type = 0; +av_buffer_unref(&dst->qp_table_buf); if (src->qp_table_buf) { dst->qp_table_buf = av_buffer_ref(src->qp_table_buf); if (dst->qp_table_buf) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/mjpegdec: Fix decoding slightly odd progressive jpeg
ffmpeg | branch: release/2.7 | Michael Niedermayer | Sun Feb 28 18:10:23 2016 +0100| [6fe1f5646e12c53794ccf69f05a32664074be93a] | committer: Michael Niedermayer avcodec/mjpegdec: Fix decoding slightly odd progressive jpeg Fixes: ebd58db6-dc86-11e5-91c2-59daeddf50c7.jpg Signed-off-by: Michael Niedermayer (cherry picked from commit c6f4720b8664e6e22eb5b3da6bb48ed5b113f746) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6fe1f5646e12c53794ccf69f05a32664074be93a --- libavcodec/mjpegdec.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 9d080e8..1daa6a4 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -1376,12 +1376,10 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss, return AVERROR_INVALIDDATA; } -if (!Al) { -// s->coefs_finished is a bitmask for coefficients coded -// ss and se are parameters telling start and end coefficients -s->coefs_finished[c] |= (2ULL << se) - (1ULL << ss); -last_scan = !~s->coefs_finished[c]; -} +// s->coefs_finished is a bitmask for coefficients coded +// ss and se are parameters telling start and end coefficients +s->coefs_finished[c] |= (2ULL << se) - (1ULL << ss); +last_scan = !Al && !~s->coefs_finished[c]; if (s->interlaced && s->bottom_field) data += linesize >> 1; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] swscale/utils: Fix chrSrcHSubSample for GBRAP16
ffmpeg | branch: release/2.7 | Michael Niedermayer | Tue Feb 23 23:48:11 2016 +0100| [751e525757512ca65d0b98b4f0ae57b1a489ee8b] | committer: Michael Niedermayer swscale/utils: Fix chrSrcHSubSample for GBRAP16 Fixes part of Ticket5264 Signed-off-by: Michael Niedermayer (cherry picked from commit 67e5bd0c501f7568fc8d93284d0f7eb40663ab06) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=751e525757512ca65d0b98b4f0ae57b1a489ee8b --- libswscale/utils.c |1 + 1 file changed, 1 insertion(+) diff --git a/libswscale/utils.c b/libswscale/utils.c index 8dcc116..644ef74 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -1213,6 +1213,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, srcFormat != AV_PIX_FMT_GBRP12BE && srcFormat != AV_PIX_FMT_GBRP12LE && srcFormat != AV_PIX_FMT_GBRP14BE && srcFormat != AV_PIX_FMT_GBRP14LE && srcFormat != AV_PIX_FMT_GBRP16BE && srcFormat != AV_PIX_FMT_GBRP16LE && +srcFormat != AV_PIX_FMT_GBRAP16BE && srcFormat != AV_PIX_FMT_GBRAP16LE && ((dstW >> c->chrDstHSubSample) <= (srcW >> 1) || (flags & SWS_FAST_BILINEAR))) c->chrSrcHSubSample = 1; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavf/mov: fix sidx with edit lists
ffmpeg | branch: release/2.7 | Rodger Combs | Thu Feb 18 12:57:37 2016 -0600| [46e4028e6949e13c6d6403c4a23de61884e0ace7] | committer: Michael Niedermayer lavf/mov: fix sidx with edit lists (cherry picked from commit 3617e69d50dd9dd07b5011dfb9477a9d1a630354) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=46e4028e6949e13c6d6403c4a23de61884e0ace7 --- libavformat/mov.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index 1f122b4..2d37d49 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -3321,7 +3321,7 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom) } av_log(c->fc, AV_LOG_DEBUG, "calculated into dts %"PRId64"\n", dts); } else { -dts = frag->time; +dts = frag->time - sc->time_offset; av_log(c->fc, AV_LOG_DEBUG, "found frag time %"PRId64 ", using it for dts\n", dts); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/utils: fix dts from pts code in compute_pkt_fields() during ascending delay
ffmpeg | branch: release/2.7 | Michael Niedermayer | Tue Mar 8 02:42:10 2016 +0100| [7b1803a427f967828e103beb260aa2a9ed1989f0] | committer: Michael Niedermayer avformat/utils: fix dts from pts code in compute_pkt_fields() during ascending delay Signed-off-by: Michael Niedermayer (cherry picked from commit de1de4932419d0fb49c9c23f62e68cdbe90d0ee3) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7b1803a427f967828e103beb260aa2a9ed1989f0 --- libavformat/utils.c |5 +++-- tests/ref/fate/mkv |2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libavformat/utils.c b/libavformat/utils.c index d5e6581..7cbd466 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1143,12 +1143,13 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st, } } -if (pkt->pts != AV_NOPTS_VALUE && delay <= MAX_REORDER_DELAY && has_decode_delay_been_guessed(st)) { +if (pkt->pts != AV_NOPTS_VALUE && delay <= MAX_REORDER_DELAY) { st->pts_buffer[0] = pkt->pts; for (i = 0; ipts_buffer[i] > st->pts_buffer[i + 1]; i++) FFSWAP(int64_t, st->pts_buffer[i], st->pts_buffer[i + 1]); -pkt->dts = select_from_pts_buffer(st, st->pts_buffer, pkt->dts); +if(has_decode_delay_been_guessed(st)) +pkt->dts = select_from_pts_buffer(st, st->pts_buffer, pkt->dts); } // We skipped it above so we try here. if (!onein_oneout) diff --git a/tests/ref/fate/mkv b/tests/ref/fate/mkv index aea378a..765798c 100644 --- a/tests/ref/fate/mkv +++ b/tests/ref/fate/mkv @@ -25,9 +25,9 @@ 1,264,264, 21, 609, 0xc0dc255c 1,285,285, 21, 619, 0x9ac52dd1 0,292,292, 41,16751, 0xf293ab46, F=0x0 -0,292,417, 41,22029, 0x3696462b, F=0x0 1,306,306, 21, 574, 0xf6410d4d 1,327,327, 22, 565, 0xfd561191 +0,334,417, 41,22029, 0x3696462b, F=0x0 1,350,350, 21, 713, 0x48425147 1,371,371, 21, 537, 0x09bbf515 0,375,375, 41, 5044, 0xa0344ae6, F=0x0 ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] MAINTAINERS: add myself as an OS/2 maintainer
ffmpeg | branch: release/2.7 | KO Myung-Hun | Mon Feb 15 13:16:23 2016 +0900| [010fd5deb6cae8bcfb6c774a086f8c139d0906bf] | committer: Michael Niedermayer MAINTAINERS: add myself as an OS/2 maintainer Signed-off-by: Michael Niedermayer (cherry picked from commit 346ec917646c18fc9e26bddf04bfa8f8f1e2e18f) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=010fd5deb6cae8bcfb6c774a086f8c139d0906bf --- MAINTAINERS |1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index d65b749..acc4f9e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -539,6 +539,7 @@ Windows ICL Matthew Oliver ADI/Blackfin DSPMarc Hoffman Sparc Roman Shaposhnik x86 Michael Niedermayer +OS/2KO Myung-Hun Releases ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/vf_drawtext: Check return code of load_glyph()
ffmpeg | branch: release/2.7 | Michael Niedermayer | Sun Apr 24 12:30:20 2016 +0200| [526aca805f778a94654672c5ddc8ef766fee63c5] | committer: Michael Niedermayer avfilter/vf_drawtext: Check return code of load_glyph() Fixes segfault Fixes Ticket5347 Signed-off-by: Michael Niedermayer (cherry picked from commit 2e67a99fbc6b99315925de40fc6fa7161576be10) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=526aca805f778a94654672c5ddc8ef766fee63c5 --- libavfilter/vf_drawtext.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c index 16e3383..a0cb222 100644 --- a/libavfilter/vf_drawtext.c +++ b/libavfilter/vf_drawtext.c @@ -1210,7 +1210,9 @@ static int draw_text(AVFilterContext *ctx, AVFrame *frame, dummy.code = code; glyph = av_tree_find(s->glyphs, &dummy, glyph_cmp, NULL); if (!glyph) { -load_glyph(ctx, &glyph, code); +ret = load_glyph(ctx, &glyph, code); +if (ret < 0) +return ret; } y_min = FFMIN(glyph->bbox.yMin, y_min); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avutil/channel_layout: AV_CH_LAYOUT_6POINT1_BACK not reachable in parsing
ffmpeg | branch: release/2.7 | Martin Cracauer | Tue Dec 1 17:59:36 2015 -0500| [2a73404558d4f8ac116e7dfe149403e82bc4f6d5] | committer: Michael Niedermayer avutil/channel_layout: AV_CH_LAYOUT_6POINT1_BACK not reachable in parsing Trying to make heads and tails out of DTS 6.1 I can across this typo. I also noticed that this wiki page is incorrect or misleading, the channel order for 6.1 given does not match the source code. At the least it should be clarified that the layout given does not apply to DTS. https://trac.ffmpeg.org/wiki/AudioChannelManipulation Signed-off-by: Michael Niedermayer (cherry picked from commit 73d1398f0c4ce2de16790f46e05a79242137d153) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2a73404558d4f8ac116e7dfe149403e82bc4f6d5 --- libavutil/channel_layout.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/channel_layout.c b/libavutil/channel_layout.c index 45249c4..7aceb81 100644 --- a/libavutil/channel_layout.c +++ b/libavutil/channel_layout.c @@ -94,7 +94,7 @@ static const struct { { "6.0(front)", 6, AV_CH_LAYOUT_6POINT0_FRONT }, { "hexagonal", 6, AV_CH_LAYOUT_HEXAGONAL }, { "6.1", 7, AV_CH_LAYOUT_6POINT1 }, -{ "6.1", 7, AV_CH_LAYOUT_6POINT1_BACK }, +{ "6.1(back)", 7, AV_CH_LAYOUT_6POINT1_BACK }, { "6.1(front)", 7, AV_CH_LAYOUT_6POINT1_FRONT }, { "7.0", 7, AV_CH_LAYOUT_7POINT0 }, { "7.0(front)", 7, AV_CH_LAYOUT_7POINT0_FRONT }, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/rtpdec_jpeg: fix low contrast image on low quality setting
ffmpeg | branch: release/2.7 | Ico Doornekamp | Thu Mar 24 14:31:38 2016 +0100| [e112096885c556e45be5f973a3cbb4cfb8bf48fe] | committer: Michael Niedermayer avformat/rtpdec_jpeg: fix low contrast image on low quality setting Original mail and my own followup on ffmpeg-user earlier today: I have a device sending out a MJPEG/RTP stream on a low quality setting. Decoding and displaying the video with libavformat results in a washed out, low contrast, greyish image. Playing the same stream with VLC results in proper color representation. Screenshots for comparison: http://zevv.nl/div/libav/shot-ffplay.jpg http://zevv.nl/div/libav/shot-vlc.jpg A pcap capture of a few seconds of video and SDP file for playing the stream are available at http://zevv.nl/div/libav/mjpeg.pcap http://zevv.nl/div/libav/mjpeg.sdp I believe the problem might be in the calculation of the quantization tables in the function create_default_qtables(), the attached patch solves the issue for me. The problem is that the argument 'q' is of the type uint8_t. According to the JPEG standard, if 1 <= q <= 50, the scale factor 'S' should be 5000 / Q. Because the create_default_qtables() reuses the variable 'q' to store the result of this calculation, for small values of q < 19, q wil subsequently overflow and give wrong results in the calculated quantization tables. The patch below uses a new variable 'S' (same name as in RFC2435) with the proper range to store the result of the division. Signed-off-by: Michael Niedermayer (cherry picked from commit e3e6a2cff4af9542455d416faec4584d5e823d5d) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e112096885c556e45be5f973a3cbb4cfb8bf48fe --- libavformat/rtpdec_jpeg.c |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libavformat/rtpdec_jpeg.c b/libavformat/rtpdec_jpeg.c index 6bf88f8..32655cc 100644 --- a/libavformat/rtpdec_jpeg.c +++ b/libavformat/rtpdec_jpeg.c @@ -193,16 +193,17 @@ static void create_default_qtables(uint8_t *qtables, uint8_t q) { int factor = q; int i; +uint16_t S; factor = av_clip(q, 1, 99); if (q < 50) -q = 5000 / factor; +S = 5000 / factor; else -q = 200 - factor * 2; +S = 200 - factor * 2; for (i = 0; i < 128; i++) { -int val = (default_quantizers[i] * q + 50) / 100; +int val = (default_quantizers[i] * S + 50) / 100; /* Limit the quantizers to 1 <= q <= 255. */ val = av_clip(val, 1, 255); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/resample: Remove disabled and faulty code
ffmpeg | branch: release/2.7 | Michael Niedermayer | Wed Mar 16 19:40:32 2016 +0100| [24bd4b363ecd647f087d641e8f6b3f7847b1114e] | committer: Michael Niedermayer avcodec/resample: Remove disabled and faulty code Fixes Ticket5345 Signed-off-by: Michael Niedermayer (cherry picked from commit 50ef7361cb5f78c94da2323f3bae86c6bbd618c8) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=24bd4b363ecd647f087d641e8f6b3f7847b1114e --- libavcodec/resample.c |6 -- 1 file changed, 6 deletions(-) diff --git a/libavcodec/resample.c b/libavcodec/resample.c index c45aa16..ec311c7 100644 --- a/libavcodec/resample.c +++ b/libavcodec/resample.c @@ -290,12 +290,6 @@ int audio_resample(ReSampleContext *s, short *output, short *input, int nb_sampl short *output_bak = NULL; int lenout; -if (s->input_channels == s->output_channels && s->ratio == 1.0 && 0) { -/* nothing to do */ -memcpy(output, input, nb_samples * s->input_channels * sizeof(short)); -return nb_samples; -} - if (s->sample_fmt[0] != AV_SAMPLE_FMT_S16) { int istride[1] = { s->sample_size[0] }; int ostride[1] = { 2 }; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] postproc: fix unaligned access
ffmpeg | branch: release/2.7 | Carl Eugen Hoyos | Tue Feb 23 15:50:28 2016 +0100| [c7b34fa7335562211cfe1702b6e4e44c66674695] | committer: Michael Niedermayer postproc: fix unaligned access Based on 59074310 by Andreas Cadhalpun. Fixes ticket #5259. (cherry picked from commit 2aa21eec1adcb3737be59f0eab7081c5a790faa9) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c7b34fa7335562211cfe1702b6e4e44c66674695 --- libpostproc/postprocess.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c index 3b86f93..1dc719c 100644 --- a/libpostproc/postprocess.c +++ b/libpostproc/postprocess.c @@ -973,7 +973,7 @@ void pp_postprocess(const uint8_t * src[3], const int srcStride[3], int i; const int count= FFMAX(mbHeight * absQPStride, mbWidth); for(i=0; i<(count>>2); i++){ -((uint32_t*)c->stdQPTable)[i] = (((const uint32_t*)QP_store)[i]>>1) & 0x7F7F7F7F; +AV_WN32(c->stdQPTable + (i<<2), AV_RN32(QP_store + (i<<2)) >> 1 & 0x7F7F7F7F); } for(i<<=2; istdQPTable[i] = QP_store[i]>>1; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/avpacket: clear priv in av_init_packet()
ffmpeg | branch: release/2.7 | Michael Niedermayer | Wed Feb 24 15:48:28 2016 +0100| [c6950985cb91ba42a920fbd6d7ae6a9591c29728] | committer: Michael Niedermayer avcodec/avpacket: clear priv in av_init_packet() This should fix leaving uninitialized pointers in priv which can confuse user applications. See: https://github.com/golang/go/issues/14426 Only or release branches Reviewed-by: Derek Buitenhuis Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c6950985cb91ba42a920fbd6d7ae6a9591c29728 --- libavcodec/avpacket.c |1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c index aae67c5..b73cf21 100644 --- a/libavcodec/avpacket.c +++ b/libavcodec/avpacket.c @@ -58,6 +58,7 @@ void av_init_packet(AVPacket *pkt) #if FF_API_DESTRUCT_PACKET FF_DISABLE_DEPRECATION_WARNINGS pkt->destruct = NULL; +pkt->priv = NULL; FF_ENABLE_DEPRECATION_WARNINGS #endif pkt->buf = NULL; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/j2kenc: Add attribution to OpenJPEG project:
ffmpeg | branch: release/2.7 | Aaron Boxer | Thu Mar 31 16:02:14 2016 -0400| [1bccba1893cffee4778d79bb94185ad715e76838] | committer: Michael Niedermayer avcodec/j2kenc: Add attribution to OpenJPEG project: http://ghostscript.com/~tor/gs-browse/gs/openjpeg/libopenjpeg/t1.c Signed-off-by: Michael Niedermayer (cherry picked from commit b6b4b0a65e02495edf9d7e5b23bef99a92921147) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1bccba1893cffee4778d79bb94185ad715e76838 --- libavcodec/j2kenc.c | 38 ++ 1 file changed, 38 insertions(+) diff --git a/libavcodec/j2kenc.c b/libavcodec/j2kenc.c index 593ceb4..d044948 100644 --- a/libavcodec/j2kenc.c +++ b/libavcodec/j2kenc.c @@ -17,8 +17,46 @@ * 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 + * + * ** + * + * + * + * This source code incorporates work covered by the following copyright and + * permission notice: + * + * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium + * Copyright (c) 2002-2007, Professor Benoit Macq + * Copyright (c) 2001-2003, David Janssens + * Copyright (c) 2002-2003, Yannick Verschueren + * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe + * Copyright (c) 2005, Herve Drolon, FreeImage Team + * Copyright (c) 2007, Callum Lerwick + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ + /** * JPEG2000 image encoder * @file ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] pgssubdec: fix subpicture output colorspace and range
ffmpeg | branch: release/2.7 | Jan Ekström | Sun Apr 24 17:30:56 2016 +0300| [3f69797e9b2f2d7060c5f7833479ab085bbca50f] | committer: Michael Niedermayer pgssubdec: fix subpicture output colorspace and range Functionality used before didn't widen the values from limited to full range. Additionally, now the decoder uses BT.709 where it should be used according to the video resolution. Default for not yet set colorimetry is BT.709 due to most observed HDMV content being HD. BT.709 coefficients were gathered from the first two parts of BT.709 to BT.2020 conversion guide in ARIB STD-B62 (Pt. 1, Chapter 6.2.2). They were additionally confirmed by manually calculating values. Fixes #4637 (cherry picked from commit 9779b6262471d553c1ed811ff7312564e39d8adf) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3f69797e9b2f2d7060c5f7833479ab085bbca50f --- libavcodec/pgssubdec.c | 10 -- libavutil/colorspace.h | 10 ++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/libavcodec/pgssubdec.c b/libavcodec/pgssubdec.c index e567f53..6ff6cc4 100644 --- a/libavcodec/pgssubdec.c +++ b/libavcodec/pgssubdec.c @@ -354,8 +354,14 @@ static int parse_palette_segment(AVCodecContext *avctx, cb= bytestream_get_byte(&buf); alpha = bytestream_get_byte(&buf); -YUV_TO_RGB1(cb, cr); -YUV_TO_RGB2(r, g, b, y); +/* Default to BT.709 colorimetry. In case of <= 576 height use BT.601 */ +if (avctx->height <= 0 || avctx->height > 576) { +YUV_TO_RGB1_CCIR_BT709(cb, cr); +} else { +YUV_TO_RGB1_CCIR(cb, cr); +} + +YUV_TO_RGB2_CCIR(r, g, b, y); ff_dlog(avctx, "Color %d := (%d,%d,%d,%d)\n", color_id, r, g, b, alpha); diff --git a/libavutil/colorspace.h b/libavutil/colorspace.h index 826ffd5..7d3f711 100644 --- a/libavutil/colorspace.h +++ b/libavutil/colorspace.h @@ -41,6 +41,16 @@ b_add = FIX(1.77200*255.0/224.0) * cb + ONE_HALF;\ } +#define YUV_TO_RGB1_CCIR_BT709(cb1, cr1)\ +{\ +cb = (cb1) - 128;\ +cr = (cr1) - 128;\ +r_add = FIX(1.5747*255.0/224.0) * cr + ONE_HALF;\ +g_add = - FIX(0.1873*255.0/224.0) * cb - FIX(0.4682*255.0/224.0) * cr + \ +ONE_HALF;\ +b_add = FIX(1.8556*255.0/224.0) * cb + ONE_HALF;\ +} + #define YUV_TO_RGB2_CCIR(r, g, b, y1)\ {\ y = ((y1) - 16) * FIX(255.0/219.0);\ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/bmp_parser: Ensure remaining_size is not too small in startcode packet crossing corner case
ffmpeg | branch: release/2.7 | Michael Niedermayer | Thu Apr 14 15:10:31 2016 +0200| [62e87d065b9bae0f9d5319a88c8af0a0c3bdd084] | committer: Michael Niedermayer avcodec/bmp_parser: Ensure remaining_size is not too small in startcode packet crossing corner case Fixes Ticket 5438 Signed-off-by: Michael Niedermayer (cherry picked from commit 8e26bdd59bf559d00c7e60c53fff292de10139ff) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=62e87d065b9bae0f9d5319a88c8af0a0c3bdd084 --- libavcodec/bmp_parser.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/bmp_parser.c b/libavcodec/bmp_parser.c index c9493dc..7ab32a0 100644 --- a/libavcodec/bmp_parser.c +++ b/libavcodec/bmp_parser.c @@ -63,7 +63,7 @@ restart: continue; } bpc->pc.frame_start_found++; -bpc->remaining_size = bpc->fsize + i - 17; +bpc->remaining_size = bpc->fsize + FFMAX(i - 17, 0); if (bpc->pc.index + i > 17) { next = i - 17; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/h264: Execute error concealment before marking the frame as done.
ffmpeg | branch: release/2.7 | Michael Niedermayer | Fri Feb 19 01:31:16 2016 +0100| [8dce138510b917bcbabd1bfbd356cb929498a353] | committer: Michael Niedermayer avcodec/h264: Execute error concealment before marking the frame as done. Fixes race condition causing artifacts Fixes Ticket4122 Signed-off-by: Michael Niedermayer (cherry picked from commit 98a0053d0f90e3309dc1038b1bae3a48bbd9067c) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8dce138510b917bcbabd1bfbd356cb929498a353 --- libavcodec/h264.c | 41 + libavcodec/h264_picture.c | 41 - 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 9a00214..1f5f4a0 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -1642,6 +1642,47 @@ again: ret = 0; end: + +#if CONFIG_ERROR_RESILIENCE +sl = h->slice_ctx; +/* + * FIXME: Error handling code does not seem to support interlaced + * when slices span multiple rows + * The ff_er_add_slice calls don't work right for bottom + * fields; they cause massive erroneous error concealing + * Error marking covers both fields (top and bottom). + * This causes a mismatched s->error_count + * and a bad error table. Further, the error count goes to + * INT_MAX when called for bottom field, because mb_y is + * past end by one (callers fault) and resync_mb_y != 0 + * causes problems for the first MB line, too. + */ +if (!FIELD_PICTURE(h) && h->current_slice && !h->sps.new && h->enable_er) { +int use_last_pic = h->last_pic_for_ec.f->buf[0] && !sl->ref_count[0]; + +ff_h264_set_erpic(&sl->er.cur_pic, h->cur_pic_ptr); + +if (use_last_pic) { +ff_h264_set_erpic(&sl->er.last_pic, &h->last_pic_for_ec); +sl->ref_list[0][0].parent = &h->last_pic_for_ec; +memcpy(sl->ref_list[0][0].data, h->last_pic_for_ec.f->data, sizeof(sl->ref_list[0][0].data)); +memcpy(sl->ref_list[0][0].linesize, h->last_pic_for_ec.f->linesize, sizeof(sl->ref_list[0][0].linesize)); +sl->ref_list[0][0].reference = h->last_pic_for_ec.reference; +} else if (sl->ref_count[0]) { +ff_h264_set_erpic(&sl->er.last_pic, sl->ref_list[0][0].parent); +} else +ff_h264_set_erpic(&sl->er.last_pic, NULL); + +if (sl->ref_count[1]) +ff_h264_set_erpic(&sl->er.next_pic, sl->ref_list[1][0].parent); + +sl->er.ref_count = sl->ref_count[0]; + +ff_er_frame_end(&sl->er); +if (use_last_pic) +memset(&sl->ref_list[0][0], 0, sizeof(sl->ref_list[0][0])); +} +#endif /* CONFIG_ERROR_RESILIENCE */ /* clean up */ if (h->cur_pic_ptr && !h->droppable) { ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX, diff --git a/libavcodec/h264_picture.c b/libavcodec/h264_picture.c index bf1471d..0ac5400 100644 --- a/libavcodec/h264_picture.c +++ b/libavcodec/h264_picture.c @@ -181,47 +181,6 @@ int ff_h264_field_end(H264Context *h, H264SliceContext *sl, int in_setup) h->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU) ff_vdpau_h264_picture_complete(h); -#if CONFIG_ERROR_RESILIENCE -av_assert0(sl == h->slice_ctx); -/* - * FIXME: Error handling code does not seem to support interlaced - * when slices span multiple rows - * The ff_er_add_slice calls don't work right for bottom - * fields; they cause massive erroneous error concealing - * Error marking covers both fields (top and bottom). - * This causes a mismatched s->error_count - * and a bad error table. Further, the error count goes to - * INT_MAX when called for bottom field, because mb_y is - * past end by one (callers fault) and resync_mb_y != 0 - * causes problems for the first MB line, too. - */ -if (!FIELD_PICTURE(h) && h->current_slice && !h->sps.new && h->enable_er) { -int use_last_pic = h->last_pic_for_ec.f->buf[0] && !sl->ref_count[0]; - -ff_h264_set_erpic(&sl->er.cur_pic, h->cur_pic_ptr); - -if (use_last_pic) { -ff_h264_set_erpic(&sl->er.last_pic, &h->last_pic_for_ec); -sl->ref_list[0][0].parent = &h->last_pic_for_ec; -memcpy(sl->ref_list[0][0].data, h->last_pic_for_ec.f->data, sizeof(sl->ref_list[0][0].data)); -memcpy(sl->ref_list[0][0].linesize, h->last_pic_for_ec.f->linesize, sizeof(sl->ref_list[0][0].linesize)); -sl->ref_list[0][0].reference = h->last_pic_for_ec.reference; -} else if (sl->ref_count[0]) { -ff_h264_set_erpic(&sl->er.last_pic, sl->ref_list[0][0].parent); -} else -ff_h264_set_erpic(&sl->er.last_pic, NULL); - -if (sl->ref_count[1]) -ff_h264_set_erpic(&sl->er.next_pic, sl->ref_list[1][0].parent); - -sl->er.ref_count = sl->ref_count[0];
[FFmpeg-cvslog] avcodec/apedec: fix decoding of stereo files with one channel full of silence
ffmpeg | branch: release/2.7 | Paul B Mahol | Tue Apr 12 10:51:30 2016 +0200| [7e2c69516910ff6170cd687a9cd057f2f01afa2c] | committer: Michael Niedermayer avcodec/apedec: fix decoding of stereo files with one channel full of silence Signed-off-by: Paul B Mahol (cherry picked from commit 9149e9c0baaec122bc3da925d6068dffa60b5427) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7e2c69516910ff6170cd687a9cd057f2f01afa2c --- libavcodec/apedec.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c index 9984b40..2cd77d4 100644 --- a/libavcodec/apedec.c +++ b/libavcodec/apedec.c @@ -1372,7 +1372,7 @@ static void ape_unpack_stereo(APEContext *ctx, int count) int32_t *decoded0 = ctx->decoded[0]; int32_t *decoded1 = ctx->decoded[1]; -if (ctx->frameflags & APE_FRAMECODE_STEREO_SILENCE) { +if ((ctx->frameflags & APE_FRAMECODE_STEREO_SILENCE) == APE_FRAMECODE_STEREO_SILENCE) { /* We are pure silence, so we're done. */ av_log(ctx->avctx, AV_LOG_DEBUG, "pure silence stereo\n"); return; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] swscale/x86/output: Fix yuv2planeX_16* with unaligned destination
ffmpeg | branch: release/2.7 | Michael Niedermayer | Wed Feb 17 00:14:56 2016 +0100| [13b75ba30a221987f25b9a5463e7eedb72a58075] | committer: Michael Niedermayer swscale/x86/output: Fix yuv2planeX_16* with unaligned destination Reviewed-by: BBB Signed-off-by: Michael Niedermayer (cherry picked from commit f6492a2ea8df80be0ed9591aee4019cef0e36e99) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=13b75ba30a221987f25b9a5463e7eedb72a58075 --- libswscale/x86/output.asm | 23 --- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/libswscale/x86/output.asm b/libswscale/x86/output.asm index 9570969..133817c 100644 --- a/libswscale/x86/output.asm +++ b/libswscale/x86/output.asm @@ -54,8 +54,8 @@ SECTION .text ; int32_t if $output_size is 16. $filter is 12-bits. $filterSize is a multiple ; of 2. $offset is either 0 or 3. $dither holds 8 values. ;- -%macro yuv2planeX_mainloop 1 -.pixelloop: +%macro yuv2planeX_mainloop 2 +.pixelloop_%2: %assign %%i 0 ; the rep here is for the 8bit output mmx case, where dither covers ; 8 pixels but we can only handle 2 pixels per register, and thus 4 @@ -82,7 +82,7 @@ SECTION .text movam2, m1 %endif ; %1 == 8/9/10/16 movsx cntr_reg, fltsizem -.filterloop_ %+ %%i: +.filterloop_%2_ %+ %%i: ; input pixels mov r6, [srcq+gprsize*cntr_reg-2*gprsize] %if %1 == 16 @@ -129,7 +129,7 @@ SECTION .text %endif ; %1 == 8/9/10/16 sub cntr_reg, 2 -jg .filterloop_ %+ %%i +jg .filterloop_%2_ %+ %%i %if %1 == 16 psrad m2, 31 - %1 @@ -156,7 +156,7 @@ SECTION .text %endif ; mmxext/sse2/sse4/avx pminsw m2, [yuv2yuvX_%1_upper] %endif ; %1 == 9/10/16 -mova [dstq+r5*2], m2 +mov%2 [dstq+r5*2], m2 %endif ; %1 == 8/9/10/16 add r5, mmsize/2 @@ -164,7 +164,7 @@ SECTION .text %assign %%i %%i+2 %endrep -jg .pixelloop +jg .pixelloop_%2 %endmacro %macro yuv2planeX_fn 3 @@ -235,7 +235,16 @@ cglobal yuv2planeX_%1, %3, 8, %2, filter, fltsize, src, dst, w, dither, offset xor r5, r5 -yuv2planeX_mainloop %1 +%if mmsize == 8 || %1 == 8 +yuv2planeX_mainloop %1, a +%else ; mmsize == 16 +test dstq, 15 +jnz .unaligned +yuv2planeX_mainloop %1, a +REP_RET +.unaligned: +yuv2planeX_mainloop %1, u +%endif ; mmsize == 8/16 %if %1 == 8 %if ARCH_X86_32 ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/rtpenc: Fix integer overflow in NTP_TO_RTP_FORMAT
ffmpeg | branch: release/2.7 | Boris Nagels | Sun Mar 6 16:31:36 2016 +0100| [f00f588a6ed4ad855756f9abf3c67e55ec7cdbc0] | committer: Michael Niedermayer avformat/rtpenc: Fix integer overflow in NTP_TO_RTP_FORMAT RTCP synchronization packet was broken since commit in ffmpeg version > 2.8.3 (commit: e04b039b1528f4c7df5c2b93865651bfea168a19) Since this commit (2e814d0329aded98c811d0502839618f08642685) "rtpenc: Simplify code by introducing a macro for rescaling NTP timestamps", NTP_TO_RTP_FORMAT uses av_rescale_rnd() function to add the data to the packet. This causes an overflow in the av_rescale_rnd() function and it will return INT64_MIN. Causing the NTP stamp in the RTCP packet to have an invalid value. Github: Closes #182 Reverting commit '2e814d0329aded98c811d0502839618f08642685' solves the problem. (cherry picked from commit 1109ed7973c7fd1e7001898adc4976590d862122) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f00f588a6ed4ad855756f9abf3c67e55ec7cdbc0 --- libavformat/rtpenc.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c index 31569d6..00b69f5 100644 --- a/libavformat/rtpenc.c +++ b/libavformat/rtpenc.c @@ -271,7 +271,8 @@ static void rtcp_send_sr(AVFormatContext *s1, int64_t ntp_time, int bye) avio_w8(s1->pb, RTCP_SR); avio_wb16(s1->pb, 6); /* length in words - 1 */ avio_wb32(s1->pb, s->ssrc); -avio_wb64(s1->pb, NTP_TO_RTP_FORMAT(ntp_time)); +avio_wb32(s1->pb, ntp_time / 100); +avio_wb32(s1->pb, ((ntp_time % 100) << 32) / 100); avio_wb32(s1->pb, rtp_ts); avio_wb32(s1->pb, s->packet_count); avio_wb32(s1->pb, s->octet_count); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/mjpegenc_common: Store approximate aspect if exact cannot be stored
ffmpeg | branch: release/2.7 | Michael Niedermayer | Sat Mar 19 15:41:30 2016 +0100| [c6bb7659726728d9c523b168f08c8d04aec75433] | committer: Michael Niedermayer avcodec/mjpegenc_common: Store approximate aspect if exact cannot be stored Fixes Ticket5244 Signed-off-by: Michael Niedermayer (cherry picked from commit 068026b0f7845e0f1850094d974f60d181480d64) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c6bb7659726728d9c523b168f08c8d04aec75433 --- libavcodec/mjpegenc_common.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/libavcodec/mjpegenc_common.c b/libavcodec/mjpegenc_common.c index daa5b69..01ebab9 100644 --- a/libavcodec/mjpegenc_common.c +++ b/libavcodec/mjpegenc_common.c @@ -119,6 +119,16 @@ static void jpeg_put_comments(AVCodecContext *avctx, PutBitContext *p) uint8_t *ptr; if (avctx->sample_aspect_ratio.num > 0 && avctx->sample_aspect_ratio.den > 0) { +AVRational sar = avctx->sample_aspect_ratio; + +if (sar.num > 65535 || sar.den > 65535) { +if (!av_reduce(&sar.num, &sar.den, avctx->sample_aspect_ratio.num, avctx->sample_aspect_ratio.den, 65535)) +av_log(avctx, AV_LOG_WARNING, +"Cannot store exact aspect ratio %d:%d\n", +avctx->sample_aspect_ratio.num, +avctx->sample_aspect_ratio.den); +} + /* JFIF header */ put_marker(p, APP0); put_bits(p, 16, 16); @@ -128,8 +138,8 @@ static void jpeg_put_comments(AVCodecContext *avctx, PutBitContext *p) * released revision. */ put_bits(p, 16, 0x0102); put_bits(p, 8, 0); /* units type: 0 - aspect ratio */ -put_bits(p, 16, avctx->sample_aspect_ratio.num); -put_bits(p, 16, avctx->sample_aspect_ratio.den); +put_bits(p, 16, sar.num); +put_bits(p, 16, sar.den); put_bits(p, 8, 0); /* thumbnail width */ put_bits(p, 8, 0); /* thumbnail height */ } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/src_movie: fix how we check for overflows with seek_point
ffmpeg | branch: release/2.7 | Marios Titas | Sat Apr 2 21:11:44 2016 +0300| [3d9f1c0dbbcba0164ec5f0bd3497c481afc43062] | committer: Michael Niedermayer avfilter/src_movie: fix how we check for overflows with seek_point Currently, if the movie source filter is used and a seek_point is specified on a file that has a negative start time, ffmpeg will fail. An easy way to reproduce this is as follows: $ ffmpeg -vsync passthrough -filter_complex 'color=d=10,setpts=PTS-1/TB' test.mp4 $ ffmpeg -filter_complex 'movie=filename=test.mp4:seek_point=2' -f null - The problem is caused by checking for int64_t overflow the wrong way. In general, to check whether a + b overflows, it is not enough to do: a > INT64_MAX - b because b might be negative; the correct way is: b > 0 && > a > INT64_MAX - b Signed-off-by: Michael Niedermayer (cherry picked from commit c1f9734f977f59bc0034096afbe8e43e40d93a5d) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3d9f1c0dbbcba0164ec5f0bd3497c481afc43062 --- libavfilter/src_movie.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/src_movie.c b/libavfilter/src_movie.c index 908c03e..6df52f7 100644 --- a/libavfilter/src_movie.c +++ b/libavfilter/src_movie.c @@ -240,7 +240,7 @@ static av_cold int movie_common_init(AVFilterContext *ctx) timestamp = movie->seek_point; // add the stream start time, should it exist if (movie->format_ctx->start_time != AV_NOPTS_VALUE) { -if (timestamp > INT64_MAX - movie->format_ctx->start_time) { +if (timestamp > 0 && movie->format_ctx->start_time > INT64_MAX - timestamp) { av_log(ctx, AV_LOG_ERROR, "%s: seek value overflow with start_time:%"PRId64" seek_point:%"PRId64"\n", movie->file_name, movie->format_ctx->start_time, movie->seek_point); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] swscale/input: Fix GBRAP16 input
ffmpeg | branch: release/2.7 | Michael Niedermayer | Tue Feb 23 23:14:03 2016 +0100| [19257891d176b9862f30d0b300a9cec73141c99b] | committer: Michael Niedermayer swscale/input: Fix GBRAP16 input Fixes part of Ticket5264 Signed-off-by: Michael Niedermayer (cherry picked from commit df36257a53561a51af969a6ea6319dd2579509b9) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=19257891d176b9862f30d0b300a9cec73141c99b --- libswscale/input.c | 20 1 file changed, 20 insertions(+) diff --git a/libswscale/input.c b/libswscale/input.c index 1f04fc2..3c4e0cd 100644 --- a/libswscale/input.c +++ b/libswscale/input.c @@ -818,6 +818,19 @@ static av_always_inline void planar_rgb16_to_y(uint8_t *_dst, const uint8_t *_sr } } +static av_always_inline void planar_rgb16_to_a(uint8_t *_dst, const uint8_t *_src[4], + int width, int bpc, int is_be, int32_t *rgb2yuv) +{ +int i; +const uint16_t **src = (const uint16_t **)_src; +uint16_t *dst= (uint16_t *)_dst; +int shift = bpc < 16 ? bpc : 14; + +for (i = 0; i < width; i++) { +dst[i] = rdpx(src[3] + i) << (14 - shift); +} +} + static av_always_inline void planar_rgb16_to_uv(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *_src[4], int width, int bpc, int is_be, int32_t *rgb2yuv) @@ -846,6 +859,11 @@ static void planar_rgb##nbits##endian_name##_to_y(uint8_t *dst, const uint8_t *s { \ planar_rgb16_to_y(dst, src, w, nbits, endian, rgb2yuv); \ } \ +static void planar_rgb##nbits##endian_name##_to_a(uint8_t *dst, const uint8_t *src[4], \ + int w, int32_t *rgb2yuv) \ +{ \ +planar_rgb16_to_a(dst, src, w, nbits, endian, rgb2yuv); \ +} \ static void planar_rgb##nbits##endian_name##_to_uv(uint8_t *dstU, uint8_t *dstV,\ const uint8_t *src[4], int w, int32_t *rgb2yuv) \ { \ @@ -1172,6 +1190,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) c->readLumPlanar = planar_rgb14le_to_y; break; case AV_PIX_FMT_GBRAP16LE: +c->readAlpPlanar = planar_rgb16le_to_a; case AV_PIX_FMT_GBRP16LE: c->readLumPlanar = planar_rgb16le_to_y; break; @@ -1188,6 +1207,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) c->readLumPlanar = planar_rgb14be_to_y; break; case AV_PIX_FMT_GBRAP16BE: +c->readAlpPlanar = planar_rgb16be_to_a; case AV_PIX_FMT_GBRP16BE: c->readLumPlanar = planar_rgb16be_to_y; break; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] swscale/x86/output: Move code into yuv2planeX_mainloop
ffmpeg | branch: release/2.7 | Michael Niedermayer | Wed Feb 17 04:15:29 2016 +0100| [34e76d75a0f085ad37c2f9b283247b75a17e11d6] | committer: Michael Niedermayer swscale/x86/output: Move code into yuv2planeX_mainloop Reviewed-by: BBB Signed-off-by: Michael Niedermayer (cherry picked from commit d07f6e5f1c36be675e0900edba3e40a32f05f0f4) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=34e76d75a0f085ad37c2f9b283247b75a17e11d6 --- libswscale/x86/output.asm | 141 +++-- 1 file changed, 72 insertions(+), 69 deletions(-) diff --git a/libswscale/x86/output.asm b/libswscale/x86/output.asm index 9ea4af9..9570969 100644 --- a/libswscale/x86/output.asm +++ b/libswscale/x86/output.asm @@ -54,75 +54,7 @@ SECTION .text ; int32_t if $output_size is 16. $filter is 12-bits. $filterSize is a multiple ; of 2. $offset is either 0 or 3. $dither holds 8 values. ;- - -%macro yuv2planeX_fn 3 - -%if ARCH_X86_32 -%define cntr_reg fltsizeq -%define movsx mov -%else -%define cntr_reg r7 -%define movsx movsxd -%endif - -cglobal yuv2planeX_%1, %3, 8, %2, filter, fltsize, src, dst, w, dither, offset -%if %1 == 8 || %1 == 9 || %1 == 10 -pxorm6, m6 -%endif ; %1 == 8/9/10 - -%if %1 == 8 -%if ARCH_X86_32 -%assign pad 0x2c - (stack_offset & 15) -SUB rsp, pad -%define m_dith m7 -%else ; x86-64 -%define m_dith m9 -%endif ; x86-32 - -; create registers holding dither -movqm_dith, [ditherq]; dither -testoffsetd, offsetd -jz .no_rot -%if mmsize == 16 -punpcklqdq m_dith, m_dith -%endif ; mmsize == 16 -PALIGNR m_dith, m_dith, 3, m0 -.no_rot: -%if mmsize == 16 -punpcklbw m_dith, m6 -%if ARCH_X86_64 -punpcklwd m8, m_dith, m6 -pslld m8, 12 -%else ; x86-32 -punpcklwd m5, m_dith, m6 -pslld m5, 12 -%endif ; x86-32/64 -punpckhwd m_dith, m6 -pslld m_dith, 12 -%if ARCH_X86_32 -mova [rsp+ 0], m5 -mova [rsp+16], m_dith -%endif -%else ; mmsize == 8 -punpcklbw m5, m_dith, m6 -punpckhbw m_dith, m6 -punpcklwd m4, m5, m6 -punpckhwd m5, m6 -punpcklwd m3, m_dith, m6 -punpckhwd m_dith, m6 -pslld m4, 12 -pslld m5, 12 -pslld m3, 12 -pslld m_dith, 12 -mova [rsp+ 0], m4 -mova [rsp+ 8], m5 -mova [rsp+16], m3 -mova [rsp+24], m_dith -%endif ; mmsize == 8/16 -%endif ; %1 == 8 - -xor r5, r5 - +%macro yuv2planeX_mainloop 1 .pixelloop: %assign %%i 0 ; the rep here is for the 8bit output mmx case, where dither covers @@ -233,6 +165,77 @@ cglobal yuv2planeX_%1, %3, 8, %2, filter, fltsize, src, dst, w, dither, offset %assign %%i %%i+2 %endrep jg .pixelloop +%endmacro + +%macro yuv2planeX_fn 3 + +%if ARCH_X86_32 +%define cntr_reg fltsizeq +%define movsx mov +%else +%define cntr_reg r7 +%define movsx movsxd +%endif + +cglobal yuv2planeX_%1, %3, 8, %2, filter, fltsize, src, dst, w, dither, offset +%if %1 == 8 || %1 == 9 || %1 == 10 +pxorm6, m6 +%endif ; %1 == 8/9/10 + +%if %1 == 8 +%if ARCH_X86_32 +%assign pad 0x2c - (stack_offset & 15) +SUB rsp, pad +%define m_dith m7 +%else ; x86-64 +%define m_dith m9 +%endif ; x86-32 + +; create registers holding dither +movqm_dith, [ditherq]; dither +testoffsetd, offsetd +jz .no_rot +%if mmsize == 16 +punpcklqdq m_dith, m_dith +%endif ; mmsize == 16 +PALIGNR m_dith, m_dith, 3, m0 +.no_rot: +%if mmsize == 16 +punpcklbw m_dith, m6 +%if ARCH_X86_64 +punpcklwd m8, m_dith, m6 +pslld m8, 12 +%else ; x86-32 +punpcklwd m5, m_dith, m6 +pslld m5, 12 +%endif ; x86-32/64 +punpckhwd m_dith, m6 +pslld m_dith, 12 +%if ARCH_X86_32 +mova [rsp+ 0], m5 +mova [rsp+16], m_dith +%endif +%else ; mmsize == 8 +punpcklbw m5, m_dith, m6 +punpckhbw m_dith, m6 +punpcklwd m4, m5, m6 +punpckhwd m5, m6 +punpcklwd m3, m_dith, m6 +punpckhwd m_dith, m6 +pslld m4, 12 +pslld m5, 12 +pslld m3, 12 +pslld m_dith, 12 +mova [rsp+ 0], m4 +mova [rsp+ 8], m5 +mova [rsp+16], m3 +mova [rsp+24], m_dith +%endif ; mmsize == 8/16 +%endif ; %1 == 8 + +xor r5, r5 + +yuv2planeX_mainloop %1 %if %1 == 8 %if ARCH_X86_32 ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] indeo2data: K&R formatting cosmetics
ffmpeg | branch: release/2.7 | Luca Barbato | Mon Feb 22 19:58:18 2016 -0500| [51f686fa77a030f98652238e4047c7d964296227] | committer: Michael Niedermayer indeo2data: K&R formatting cosmetics Signed-off-by: Vittorio Giovara Signed-off-by: Diego Biurrun (cherry picked from commit d4066a702407352a0648af882c34ea81a404fa2b) (cherry picked from commit 522ab0b9a92962edda7156a91a494a1e2b8a7f64) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=51f686fa77a030f98652238e4047c7d964296227 --- libavcodec/indeo2data.h | 208 +++ 1 file changed, 104 insertions(+), 104 deletions(-) diff --git a/libavcodec/indeo2data.h b/libavcodec/indeo2data.h index 0d6d82f..8fd664c 100644 --- a/libavcodec/indeo2data.h +++ b/libavcodec/indeo2data.h @@ -27,115 +27,115 @@ #define IR2_CODES 143 static const uint16_t ir2_codes[IR2_CODES][2] = { #ifdef BITSTREAM_READER_LE -{0x, 3}, {0x0004, 3}, {0x0006, 3}, {0x0001, 5}, -{0x0009, 5}, {0x0019, 5}, {0x000D, 5}, {0x001D, 5}, -{0x0023, 6}, {0x0013, 6}, {0x0033, 6}, {0x000B, 6}, -{0x002B, 6}, {0x001B, 6}, {0x0007, 8}, {0x0087, 8}, -{0x0027, 8}, {0x00A7, 8}, {0x0067, 8}, {0x00E7, 8}, -{0x0097, 8}, {0x0057, 8}, {0x0037, 8}, {0x00B7, 8}, -{0x00F7, 8}, {0x000F, 9}, {0x008F, 9}, {0x018F, 9}, -{0x014F, 9}, {0x00CF, 9}, {0x002F, 9}, {0x012F, 9}, -{0x01AF, 9}, {0x006F, 9}, {0x00EF, 9}, {0x01EF, 9}, -{0x001F, 10}, {0x021F, 10}, {0x011F, 10}, {0x031F, 10}, -{0x009F, 10}, {0x029F, 10}, {0x019F, 10}, {0x039F, 10}, -{0x005F, 10}, {0x025F, 10}, {0x015F, 10}, {0x035F, 10}, -{0x00DF, 10}, {0x02DF, 10}, {0x01DF, 10}, {0x03DF, 10}, -{0x003F, 13}, {0x103F, 13}, {0x083F, 13}, {0x183F, 13}, -{0x043F, 13}, {0x143F, 13}, {0x0C3F, 13}, {0x1C3F, 13}, -{0x023F, 13}, {0x123F, 13}, {0x0A3F, 13}, {0x1A3F, 13}, -{0x063F, 13}, {0x163F, 13}, {0x0E3F, 13}, {0x1E3F, 13}, -{0x013F, 13}, {0x113F, 13}, {0x093F, 13}, {0x193F, 13}, -{0x053F, 13}, {0x153F, 13}, {0x0D3F, 13}, {0x1D3F, 13}, -{0x033F, 13}, {0x133F, 13}, {0x0B3F, 13}, {0x1B3F, 13}, -{0x073F, 13}, {0x173F, 13}, {0x0F3F, 13}, {0x1F3F, 13}, -{0x00BF, 13}, {0x10BF, 13}, {0x08BF, 13}, {0x18BF, 13}, -{0x04BF, 13}, {0x14BF, 13}, {0x0CBF, 13}, {0x1CBF, 13}, -{0x02BF, 13}, {0x12BF, 13}, {0x0ABF, 13}, {0x1ABF, 13}, -{0x06BF, 13}, {0x16BF, 13}, {0x0EBF, 13}, {0x1EBF, 13}, -{0x01BF, 13}, {0x11BF, 13}, {0x09BF, 13}, {0x19BF, 13}, -{0x05BF, 13}, {0x15BF, 13}, {0x0DBF, 13}, {0x1DBF, 13}, -{0x03BF, 13}, {0x13BF, 13}, {0x0BBF, 13}, {0x1BBF, 13}, -{0x07BF, 13}, {0x17BF, 13}, {0x0FBF, 13}, {0x1FBF, 13}, -{0x007F, 14}, {0x207F, 14}, {0x107F, 14}, {0x307F, 14}, -{0x087F, 14}, {0x287F, 14}, {0x187F, 14}, {0x387F, 14}, -{0x047F, 14}, {0x247F, 14}, {0x147F, 14}, {0x0002, 3}, -{0x0011, 5}, {0x0005, 5}, {0x0015, 5}, {0x0003, 6}, -{0x003B, 6}, {0x0047, 8}, {0x00C7, 8}, {0x0017, 8}, -{0x00D7, 8}, {0x0077, 8}, {0x010F, 9}, {0x004F, 9}, -{0x01CF, 9}, {0x00AF, 9}, {0x016F, 9}, +{ 0x, 3 }, { 0x0004, 3 }, { 0x0006, 3 }, { 0x0001, 5 }, +{ 0x0009, 5 }, { 0x0019, 5 }, { 0x000D, 5 }, { 0x001D, 5 }, +{ 0x0023, 6 }, { 0x0013, 6 }, { 0x0033, 6 }, { 0x000B, 6 }, +{ 0x002B, 6 }, { 0x001B, 6 }, { 0x0007, 8 }, { 0x0087, 8 }, +{ 0x0027, 8 }, { 0x00A7, 8 }, { 0x0067, 8 }, { 0x00E7, 8 }, +{ 0x0097, 8 }, { 0x0057, 8 }, { 0x0037, 8 }, { 0x00B7, 8 }, +{ 0x00F7, 8 }, { 0x000F, 9 }, { 0x008F, 9 }, { 0x018F, 9 }, +{ 0x014F, 9 }, { 0x00CF, 9 }, { 0x002F, 9 }, { 0x012F, 9 }, +{ 0x01AF, 9 }, { 0x006F, 9 }, { 0x00EF, 9 }, { 0x01EF, 9 }, +{ 0x001F, 10 }, { 0x021F, 10 }, { 0x011F, 10 }, { 0x031F, 10 }, +{ 0x009F, 10 }, { 0x029F, 10 }, { 0x019F, 10 }, { 0x039F, 10 }, +{ 0x005F, 10 }, { 0x025F, 10 }, { 0x015F, 10 }, { 0x035F, 10 }, +{ 0x00DF, 10 }, { 0x02DF, 10 }, { 0x01DF, 10 }, { 0x03DF, 10 }, +{ 0x003F, 13 }, { 0x103F, 13 }, { 0x083F, 13 }, { 0x183F, 13 }, +{ 0x043F, 13 }, { 0x143F, 13 }, { 0x0C3F, 13 }, { 0x1C3F, 13 }, +{ 0x023F, 13 }, { 0x123F, 13 }, { 0x0A3F, 13 }, { 0x1A3F, 13 }, +{ 0x063F, 13 }, { 0x163F, 13 }, { 0x0E3F, 13 }, { 0x1E3F, 13 }, +{ 0x013F, 13 }, { 0x113F, 13 }, { 0x093F, 13 }, { 0x193F, 13 }, +{ 0x053F, 13 }, { 0x153F, 13 }, { 0x0D3F, 13 }, { 0x1D3F, 13 }, +{ 0x033F, 13 }, { 0x133F, 13 }, { 0x0B3F, 13 }, { 0x1B3F, 13 }, +{ 0x073F, 13 }, { 0x173F, 13 }, { 0x0F3F, 13 }, { 0x1F3F, 13 }, +{ 0x00BF, 13 }, { 0x10BF, 13 }, { 0x08BF, 13 }, { 0x18BF, 13 }, +{ 0x04BF, 13 }, { 0x14BF, 13 }, { 0x0CBF, 13 }, { 0x1CBF, 13 }, +{ 0x02BF, 13 }, { 0x12BF, 13 }, { 0x0ABF, 13 }, { 0x1ABF, 13 }, +{ 0x06BF, 13 }, { 0x16BF, 13 }, { 0x0EBF, 13 }, { 0x1EBF, 13 }, +{ 0x01BF, 13 }, { 0x11BF, 13 }, { 0x09BF, 13 }, { 0x19BF, 13 }, +{ 0x05BF, 13 }, { 0x15BF, 13 }, { 0x0DBF, 13 }, { 0x1DBF, 13 }, +{ 0x03BF, 13 }, { 0x13BF, 13 }, { 0x0BBF, 13 }, { 0x1BBF, 13 }, +{ 0x07BF, 13 }, { 0x17BF, 13 }, { 0x0FBF, 13 }, { 0x1FBF, 13 }, +{ 0
[FFmpeg-cvslog] avcodec/libutvideodec: copy frame so it has reference counters when refcounted_frames is set
ffmpeg | branch: release/2.7 | Michael Niedermayer | Thu Mar 24 20:55:30 2016 +0100| [f3da3e2aed9d9af1e49f79266b15dc987c0cdcf9] | committer: Michael Niedermayer avcodec/libutvideodec: copy frame so it has reference counters when refcounted_frames is set Reviewed-by: maintainer Signed-off-by: Michael Niedermayer (cherry picked from commit 0cd9ff4e3aa23318a855c21d60b1c9035b2b99d2) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f3da3e2aed9d9af1e49f79266b15dc987c0cdcf9 --- libavcodec/libutvideodec.cpp | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libavcodec/libutvideodec.cpp b/libavcodec/libutvideodec.cpp index e4b87a8..93fbcb4 100644 --- a/libavcodec/libutvideodec.cpp +++ b/libavcodec/libutvideodec.cpp @@ -222,9 +222,19 @@ static int utvideo_decode_frame(AVCodecContext *avctx, void *data, pic->data[0] = utv->buffer + utv->buf_size + pic->linesize[0]; break; } +pic->width = w; +pic->height = h; +pic->format = avctx->pix_fmt; + +if (avctx->refcounted_frames) { +int ret = av_frame_ref((AVFrame*)data, pic); +if (ret < 0) + return ret; +} else { +av_frame_move_ref((AVFrame*)data, pic); +} *got_frame = 1; -av_frame_move_ref((AVFrame*)data, pic); return avpkt->size; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avutil/random_seed: Add the runtime in cycles of the main loop to the entropy pool
ffmpeg | branch: release/2.7 | Michael Niedermayer | Wed Dec 9 15:18:53 2015 +0100| [91b6d89d0a5ed5ac1aa3ca60d6f8dca93b50d461] | committer: Michael Niedermayer avutil/random_seed: Add the runtime in cycles of the main loop to the entropy pool This should theoretically improve the randomness slightly Signed-off-by: Michael Niedermayer (cherry picked from commit 2540d884f3fd7cfac503e048112098967be2569a) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=91b6d89d0a5ed5ac1aa3ca60d6f8dca93b50d461 --- libavutil/random_seed.c |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavutil/random_seed.c b/libavutil/random_seed.c index 8aa8c38..5af8e9e 100644 --- a/libavutil/random_seed.c +++ b/libavutil/random_seed.c @@ -97,8 +97,13 @@ static uint32_t get_generic_seed(void) last_t = t; } -if(TEST) +if(TEST) { buffer[0] = buffer[1] = 0; +} else { +#ifdef AV_READ_TIME +buffer[111] += AV_READ_TIME(); +#endif +} av_sha_init(sha, 160); av_sha_update(sha, (const uint8_t *)buffer, sizeof(buffer)); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog