[FFmpeg-cvslog] avfilter/vf_[color/chroma]key: lower lower limit for similarity option
ffmpeg | branch: master | Paul B Mahol | Thu Oct 27 10:20:09 2022 +0200| [0e5e3b37c0a653c2f08a4e83db1c225e335f0037] | committer: Paul B Mahol avfilter/vf_[color/chroma]key: lower lower limit for similarity option > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0e5e3b37c0a653c2f08a4e83db1c225e335f0037 --- libavfilter/vf_chromakey.c | 4 ++-- libavfilter/vf_colorkey.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libavfilter/vf_chromakey.c b/libavfilter/vf_chromakey.c index 3bfacda7e4..fdd610cb19 100644 --- a/libavfilter/vf_chromakey.c +++ b/libavfilter/vf_chromakey.c @@ -348,7 +348,7 @@ static const AVFilterPad chromakey_outputs[] = { static const AVOption chromakey_options[] = { { "color", "set the chromakey key color", OFFSET(chromakey_rgba), AV_OPT_TYPE_COLOR, { .str = "black" }, 0, 0, FLAGS }, -{ "similarity", "set the chromakey similarity value", OFFSET(similarity), AV_OPT_TYPE_FLOAT, { .dbl = 0.01 }, 0.01, 1.0, FLAGS }, +{ "similarity", "set the chromakey similarity value", OFFSET(similarity), AV_OPT_TYPE_FLOAT, { .dbl = 0.01 }, 0.1, 1.0, FLAGS }, { "blend", "set the chromakey key blend value", OFFSET(blend), AV_OPT_TYPE_FLOAT, { .dbl = 0.0 }, 0.0, 1.0, FLAGS }, { "yuv", "color parameter is in yuv instead of rgb", OFFSET(is_yuv), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS }, { NULL } @@ -381,7 +381,7 @@ const AVFilter ff_vf_chromakey = { static const AVOption chromahold_options[] = { { "color", "set the chromahold key color", OFFSET(chromakey_rgba), AV_OPT_TYPE_COLOR, { .str = "black" }, 0, 0, FLAGS }, -{ "similarity", "set the chromahold similarity value", OFFSET(similarity), AV_OPT_TYPE_FLOAT, { .dbl = 0.01 }, 0.01, 1.0, FLAGS }, +{ "similarity", "set the chromahold similarity value", OFFSET(similarity), AV_OPT_TYPE_FLOAT, { .dbl = 0.01 }, 0.1, 1.0, FLAGS }, { "blend", "set the chromahold blend value", OFFSET(blend), AV_OPT_TYPE_FLOAT, { .dbl = 0.0 }, 0.0, 1.0, FLAGS }, { "yuv", "color parameter is in yuv instead of rgb", OFFSET(is_yuv), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS }, { NULL } diff --git a/libavfilter/vf_colorkey.c b/libavfilter/vf_colorkey.c index cd4987e26b..9979f4ad0d 100644 --- a/libavfilter/vf_colorkey.c +++ b/libavfilter/vf_colorkey.c @@ -217,7 +217,7 @@ static const AVFilterPad colorkey_outputs[] = { static const AVOption colorkey_options[] = { { "color", "set the colorkey key color", OFFSET(colorkey_rgba), AV_OPT_TYPE_COLOR, { .str = "black" }, 0, 0, FLAGS }, -{ "similarity", "set the colorkey similarity value", OFFSET(similarity), AV_OPT_TYPE_FLOAT, { .dbl = 0.01 }, 0.01, 1.0, FLAGS }, +{ "similarity", "set the colorkey similarity value", OFFSET(similarity), AV_OPT_TYPE_FLOAT, { .dbl = 0.01 }, 0.1, 1.0, FLAGS }, { "blend", "set the colorkey key blend value", OFFSET(blend), AV_OPT_TYPE_FLOAT, { .dbl = 0.0 }, 0.0, 1.0, FLAGS }, { NULL } }; @@ -241,7 +241,7 @@ const AVFilter ff_vf_colorkey = { static const AVOption colorhold_options[] = { { "color", "set the colorhold key color", OFFSET(colorkey_rgba), AV_OPT_TYPE_COLOR, { .str = "black" }, 0, 0, FLAGS }, -{ "similarity", "set the colorhold similarity value", OFFSET(similarity), AV_OPT_TYPE_FLOAT, { .dbl = 0.01 }, 0.01, 1.0, FLAGS }, +{ "similarity", "set the colorhold similarity value", OFFSET(similarity), AV_OPT_TYPE_FLOAT, { .dbl = 0.01 }, 0.1, 1.0, FLAGS }, { "blend", "set the colorhold blend value", OFFSET(blend), AV_OPT_TYPE_FLOAT, { .dbl = 0.0 }, 0.0, 1.0, FLAGS }, { NULL } }; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avfilter/vf_threshold: fix handling of zero threshold
ffmpeg | branch: master | Paul B Mahol | Thu Oct 20 19:38:55 2022 +0200| [00b03331a018cf59740153a20c762b714253dd10] | committer: Paul B Mahol avfilter/vf_threshold: fix handling of zero threshold > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=00b03331a018cf59740153a20c762b714253dd10 --- libavfilter/vf_threshold_init.h | 4 ++-- libavfilter/x86/vf_threshold.asm | 23 --- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/libavfilter/vf_threshold_init.h b/libavfilter/vf_threshold_init.h index 7d160ddbb9..64a0a861ba 100644 --- a/libavfilter/vf_threshold_init.h +++ b/libavfilter/vf_threshold_init.h @@ -38,7 +38,7 @@ static void threshold8(const uint8_t *in, const uint8_t *threshold, { for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) -out[x] = in[x] < threshold[x] ? min[x] : max[x]; +out[x] = in[x] <= threshold[x] ? min[x] : max[x]; in+= ilinesize; threshold += tlinesize; @@ -64,7 +64,7 @@ static void threshold16(const uint8_t *iin, const uint8_t *tthreshold, for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) -out[x] = in[x] < threshold[x] ? min[x] : max[x]; +out[x] = in[x] <= threshold[x] ? min[x] : max[x]; in+= ilinesize / 2; threshold += tlinesize / 2; diff --git a/libavfilter/x86/vf_threshold.asm b/libavfilter/x86/vf_threshold.asm index 098069b083..8977a586c0 100644 --- a/libavfilter/x86/vf_threshold.asm +++ b/libavfilter/x86/vf_threshold.asm @@ -22,15 +22,10 @@ %include "libavutil/x86/x86util.asm" -SECTION_RODATA - -pb_128: times 16 db 128 -pb_128_0 : times 8 db 0, 128 - SECTION .text -;%1 depth (8 or 16) ; %2 b or w ; %3 constant -%macro THRESHOLD 3 +;%1 depth (8 or 16) ; %2 b or w +%macro THRESHOLD 2 %if ARCH_X86_64 cglobal threshold%1, 10, 13, 5, in, threshold, min, max, out, ilinesize, tlinesize, flinesize, slinesize, olinesize, w, h, x mov wd, dword wm @@ -45,7 +40,6 @@ cglobal threshold%1, 5, 7, 5, in, threshold, min, max, out, w, x %define olinesizeq r9mp %define hd r11mp %endif -VBROADCASTI128 m4, [%3] %if %1 == 16 add wq, wq ; w *= 2 (16 bits instead of 8) %endif @@ -63,9 +57,8 @@ cglobal threshold%1, 5, 7, 5, in, threshold, min, max, out, w, x movum0, [thresholdq + xq] movum2, [minq + xq] movum3, [maxq + xq] -pxorm0, m4 -pxorm1, m4 -pcmpgt%2m0, m1 +pminu%2 m0, m1 +pcmpeq%2m0, m1 PBLENDVBm3, m2, m0 movu [outq + xq], m3 add xq, mmsize @@ -82,11 +75,11 @@ RET %endmacro INIT_XMM sse4 -THRESHOLD 8, b, pb_128 -THRESHOLD 16, w, pb_128_0 +THRESHOLD 8, b +THRESHOLD 16, w %if HAVE_AVX2_EXTERNAL INIT_YMM avx2 -THRESHOLD 8, b, pb_128 -THRESHOLD 16, w, pb_128_0 +THRESHOLD 8, b +THRESHOLD 16, w %endif ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] libavcodec: Fix a comment typo
ffmpeg | branch: master | Martin Storsjö | Mon Oct 3 13:17:43 2022 +0300| [4bc79769f90534dfeb1d36aac4ab2bbef80a4efd] | committer: Martin Storsjö libavcodec: Fix a comment typo Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4bc79769f90534dfeb1d36aac4ab2bbef80a4efd --- libavcodec/packet.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/packet.h b/libavcodec/packet.h index 404d520071..f28e7e7011 100644 --- a/libavcodec/packet.h +++ b/libavcodec/packet.h @@ -161,7 +161,7 @@ enum AVPacketSideDataType { * the packet may contain "dual mono" audio specific to Japanese DTV * and if it is true, recommends only the selected channel to be used. * @code - * u8selected channels (0=mail/left, 1=sub/right, 2=both) + * u8selected channels (0=main/left, 1=sub/right, 2=both) * @endcode */ AV_PKT_DATA_JP_DUALMONO, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avcodec/mpeg12dec: Remove redundant function call
ffmpeg | branch: master | Andreas Rheinhardt | Sun Oct 23 14:29:47 2022 +0200| [495d738b1b07fd25198760bd932a83fbb17a96b9] | committer: Andreas Rheinhardt avcodec/mpeg12dec: Remove redundant function call Redundant since dcb29d37d4ffedc84e44df99f8d22ecf27e0f2cd. Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=495d738b1b07fd25198760bd932a83fbb17a96b9 --- libavcodec/mpeg12dec.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index 56bf73df11..c942be158e 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -2797,7 +2797,6 @@ static int mpeg_decode_frame(AVCodecContext *avctx, AVFrame *picture, } #endif -s2->codec_tag = ff_toupper4(avctx->codec_tag); if (s->mpeg_enc_ctx_allocated == 0 && ( s2->codec_tag == AV_RL32("VCR2") || s2->codec_tag == AV_RL32("BW10") )) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avformat/mux: Constify validate_codec_tag()
ffmpeg | branch: master | Andreas Rheinhardt | Sun Oct 23 14:45:57 2022 +0200| [9aa7397db13e649b3d2d04cdb33920d7a9000d87] | committer: Andreas Rheinhardt avformat/mux: Constify validate_codec_tag() Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9aa7397db13e649b3d2d04cdb33920d7a9000d87 --- libavformat/mux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mux.c b/libavformat/mux.c index a7517dae0a..37fe19358d 100644 --- a/libavformat/mux.c +++ b/libavformat/mux.c @@ -144,7 +144,7 @@ error: return ret; } -static int validate_codec_tag(AVFormatContext *s, AVStream *st) +static int validate_codec_tag(const AVFormatContext *s, const AVStream *st) { const AVCodecTag *avctag; enum AVCodecID id = AV_CODEC_ID_NONE; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avformat/mux: Don't call ff_toupper4() unnecessarily
ffmpeg | branch: master | Andreas Rheinhardt | Sun Oct 23 14:42:24 2022 +0200| [5da8b522c85c2fb877917c1df6388312803fb36e] | committer: Andreas Rheinhardt avformat/mux: Don't call ff_toupper4() unnecessarily Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5da8b522c85c2fb877917c1df6388312803fb36e --- libavformat/mux.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/mux.c b/libavformat/mux.c index 5d89458f82..a7517dae0a 100644 --- a/libavformat/mux.c +++ b/libavformat/mux.c @@ -148,6 +148,7 @@ static int validate_codec_tag(AVFormatContext *s, AVStream *st) { const AVCodecTag *avctag; enum AVCodecID id = AV_CODEC_ID_NONE; +unsigned uppercase_tag = ff_toupper4(st->codecpar->codec_tag); int64_t tag = -1; /** @@ -159,7 +160,7 @@ static int validate_codec_tag(AVFormatContext *s, AVStream *st) for (int n = 0; s->oformat->codec_tag[n]; n++) { avctag = s->oformat->codec_tag[n]; while (avctag->id != AV_CODEC_ID_NONE) { -if (ff_toupper4(avctag->tag) == ff_toupper4(st->codecpar->codec_tag)) { +if (ff_toupper4(avctag->tag) == uppercase_tag) { id = avctag->id; if (id == st->codecpar->codec_id) return 1; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avcodec/mpeg12: Avoid indirection when accessing rl_vlc tables
ffmpeg | branch: master | Andreas Rheinhardt | Fri Oct 21 23:17:07 2022 +0200| [11dfa4d15963a7ad71b763261d6d7e3dcded9965] | committer: Andreas Rheinhardt avcodec/mpeg12: Avoid indirection when accessing rl_vlc tables Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=11dfa4d15963a7ad71b763261d6d7e3dcded9965 --- libavcodec/eamad.c | 3 +-- libavcodec/mdec.c | 3 +-- libavcodec/mpeg12.c | 19 +++ libavcodec/mpeg12dec.c | 28 libavcodec/mpeg12vlc.h | 14 +++--- libavcodec/speedhqdec.c | 6 -- 6 files changed, 36 insertions(+), 37 deletions(-) diff --git a/libavcodec/eamad.c b/libavcodec/eamad.c index de8f488f65..45012c62b8 100644 --- a/libavcodec/eamad.c +++ b/libavcodec/eamad.c @@ -128,7 +128,6 @@ static inline void idct_put(MadContext *t, AVFrame *frame, int16_t *block, static inline int decode_block_intra(MadContext *s, int16_t * block) { int level, i, j, run; -RLTable *rl = &ff_rl_mpeg1; const uint8_t *scantable = ff_zigzag_direct; int16_t *quant_matrix = s->quant_matrix; @@ -142,7 +141,7 @@ static inline int decode_block_intra(MadContext *s, int16_t * block) /* now quantify & encode AC coefficients */ for (;;) { UPDATE_CACHE(re, &s->gb); -GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0); +GET_RL_VLC(level, run, re, &s->gb, ff_mpeg1_rl_vlc, TEX_VLC_BITS, 2, 0); if (level == 127) { break; diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c index a1f85aa0cf..640b671a0f 100644 --- a/libavcodec/mdec.c +++ b/libavcodec/mdec.c @@ -63,7 +63,6 @@ static inline int mdec_decode_block_intra(MDECContext *a, int16_t *block, int n) { int level, diff, i, j, run; int component; -RLTable *rl = &ff_rl_mpeg1; const uint8_t *const scantable = a->permutated_scantable; const uint16_t *quant_matrix = a->quant_matrix; const int qscale = a->qscale; @@ -84,7 +83,7 @@ static inline int mdec_decode_block_intra(MDECContext *a, int16_t *block, int n) /* now quantify & encode AC coefficients */ for (;;) { UPDATE_CACHE(re, &a->gb); -GET_RL_VLC(level, run, re, &a->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0); +GET_RL_VLC(level, run, re, &a->gb, ff_mpeg1_rl_vlc, TEX_VLC_BITS, 2, 0); if (level == 127) { break; diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index df6aba9d74..351ebf420f 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -63,7 +63,8 @@ static const uint8_t table_mb_btype[11][2] = { { 2, 5 }, // 0x1E MB_QUANT|MB_FOR|MB_BACK|MB_PAT }; -av_cold void ff_init_2d_vlc_rl(RLTable *rl, unsigned static_size, int flags) +av_cold void ff_init_2d_vlc_rl(const RLTable *rl, RL_VLC_ELEM rl_vlc[], + unsigned static_size, int flags) { int i; VLCElem table[680] = { 0 }; @@ -94,9 +95,9 @@ av_cold void ff_init_2d_vlc_rl(RLTable *rl, unsigned static_size, int flags) level = rl->table_level[code]; } } -rl->rl_vlc[0][i].len = len; -rl->rl_vlc[0][i].level = level; -rl->rl_vlc[0][i].run = run; +rl_vlc[i].len = len; +rl_vlc[i].level = level; +rl_vlc[i].run = run; } } @@ -122,6 +123,9 @@ VLC ff_mb_ptype_vlc; VLC ff_mb_btype_vlc; VLC ff_mb_pat_vlc; +RL_VLC_ELEM ff_mpeg1_rl_vlc[680]; +RL_VLC_ELEM ff_mpeg2_rl_vlc[674]; + static av_cold void mpeg12_init_vlcs(void) { INIT_VLC_STATIC(&ff_dc_lum_vlc, DC_VLC_BITS, 12, @@ -147,8 +151,8 @@ static av_cold void mpeg12_init_vlcs(void) &table_mb_btype[0][1], 2, 1, &table_mb_btype[0][0], 2, 1, 64); -INIT_2D_VLC_RL(ff_rl_mpeg1, 680, 0); -INIT_2D_VLC_RL(ff_rl_mpeg2, 674, 0); +INIT_2D_VLC_RL(ff_rl_mpeg1, ff_mpeg1_rl_vlc, 0); +INIT_2D_VLC_RL(ff_rl_mpeg2, ff_mpeg2_rl_vlc, 0); } av_cold void ff_mpeg12_init_vlcs(void) @@ -231,7 +235,6 @@ int ff_mpeg1_decode_block_intra(GetBitContext *gb, int16_t *block, int index, int qscale) { int dc, diff, i = 0, component; -RLTable *rl = &ff_rl_mpeg1; /* DC coefficient */ component = index <= 3 ? 0 : index - 4 + 1; @@ -256,7 +259,7 @@ int ff_mpeg1_decode_block_intra(GetBitContext *gb, while (1) { int level, run, j; -GET_RL_VLC(level, run, re, gb, rl->rl_vlc[0], +GET_RL_VLC(level, run, re, gb, ff_mpeg1_rl_vlc, TEX_VLC_BITS, 2, 0); if (level != 0) { diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index c942be158e..914516bbd9 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -152,7 +152,6 @@ static inline int mpeg1_decode_block_inter(MpegEncContext *s, int16_t *bl
[FFmpeg-cvslog] avcodec/mpeg12enc: Pass tables explicitly in ff_mpeg1_init_uni_ac_vlc
ffmpeg | branch: master | Andreas Rheinhardt | Sat Oct 22 01:33:11 2022 +0200| [178dcbb96fd9fe11896e468e42e68559ea01d92f] | committer: Andreas Rheinhardt avcodec/mpeg12enc: Pass tables explicitly in ff_mpeg1_init_uni_ac_vlc This will allow to remove ff_rl_mpeg2 soon and remove all uses of RLTable in MPEG-1/2/SpeedHQ later. Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=178dcbb96fd9fe11896e468e42e68559ea01d92f --- libavcodec/mpeg12enc.c | 19 --- libavcodec/mpeg12vlc.h | 3 ++- libavcodec/speedhqenc.c | 3 ++- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c index 5d991ac99e..e0775d6b96 100644 --- a/libavcodec/mpeg12enc.c +++ b/libavcodec/mpeg12enc.c @@ -94,7 +94,10 @@ typedef struct MPEG12EncContext { #define A53_MAX_CC_COUNT 0x1f #endif /* CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER */ -av_cold void ff_mpeg1_init_uni_ac_vlc(const RLTable *rl, uint8_t *uni_ac_vlc_len) +av_cold void ff_mpeg1_init_uni_ac_vlc(const int8_t max_level[], + const uint8_t index_run[], + const uint16_t table_vlc[][2], + uint8_t uni_ac_vlc_len[]) { int i; @@ -107,16 +110,16 @@ av_cold void ff_mpeg1_init_uni_ac_vlc(const RLTable *rl, uint8_t *uni_ac_vlc_len int len, code; int alevel = FFABS(level); -if (alevel > rl->max_level[0][run]) +if (alevel > max_level[run]) code = 111; /* rl->n */ else -code = rl->index_run[0][run] + alevel - 1; +code = index_run[run] + alevel - 1; if (code < 111) { /* rl->n */ /* length of VLC and sign */ -len = rl->table_vlc[code][1] + 1; +len = table_vlc[code][1] + 1; } else { -len = rl->table_vlc[111 /* rl->n */][1] + 6; +len = table_vlc[MPEG12_RL_NB_ELEMS][1] + 6; if (alevel < 128) len += 8; @@ -1078,8 +1081,10 @@ static av_cold void mpeg12_encode_init_static(void) ff_rl_init(&ff_rl_mpeg1, mpeg12_static_rl_table_store[0]); ff_rl_init(&ff_rl_mpeg2, mpeg12_static_rl_table_store[1]); -ff_mpeg1_init_uni_ac_vlc(&ff_rl_mpeg1, uni_mpeg1_ac_vlc_len); -ff_mpeg1_init_uni_ac_vlc(&ff_rl_mpeg2, uni_mpeg2_ac_vlc_len); +ff_mpeg1_init_uni_ac_vlc(ff_rl_mpeg1.max_level[0], ff_rl_mpeg1.index_run[0], + ff_mpeg1_vlc_table, uni_mpeg1_ac_vlc_len); +ff_mpeg1_init_uni_ac_vlc(ff_rl_mpeg2.max_level[0], ff_rl_mpeg2.index_run[0], + ff_mpeg2_vlc_table, uni_mpeg2_ac_vlc_len); /* build unified dc encoding tables */ for (int i = -255; i < 256; i++) { diff --git a/libavcodec/mpeg12vlc.h b/libavcodec/mpeg12vlc.h index c810697370..5a04834bee 100644 --- a/libavcodec/mpeg12vlc.h +++ b/libavcodec/mpeg12vlc.h @@ -67,6 +67,7 @@ extern RL_VLC_ELEM ff_mpeg2_rl_vlc[]; void ff_init_2d_vlc_rl(const RLTable *rl, RL_VLC_ELEM rl_vlc[], unsigned static_size, int flags); -void ff_mpeg1_init_uni_ac_vlc(const RLTable *rl, uint8_t *uni_ac_vlc_len); +void ff_mpeg1_init_uni_ac_vlc(const int8_t max_level[], const uint8_t index_run[], + const uint16_t table_vlc[][2], uint8_t uni_ac_vlc_len[]); #endif /* AVCODEC_MPEG12VLC_H */ diff --git a/libavcodec/speedhqenc.c b/libavcodec/speedhqenc.c index 58b5e858a8..44ee62b9c2 100644 --- a/libavcodec/speedhqenc.c +++ b/libavcodec/speedhqenc.c @@ -88,7 +88,8 @@ static av_cold void speedhq_init_static_data(void) speedhq_chr_dc_uni[i + 255] = bits + (code << 8); } -ff_mpeg1_init_uni_ac_vlc(&ff_rl_speedhq, uni_speedhq_ac_vlc_len); +ff_mpeg1_init_uni_ac_vlc(ff_rl_speedhq.max_level[0], ff_rl_speedhq.index_run[0], + ff_speedhq_vlc_table, uni_speedhq_ac_vlc_len); } av_cold int ff_speedhq_encode_init(MpegEncContext *s) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avcodec/mpeg12data: Remove unused ff_rl_mpeg2
ffmpeg | branch: master | Andreas Rheinhardt | Sat Oct 22 02:03:29 2022 +0200| [6bb0760a91576d53de960f8377d3ee341f14ec28] | committer: Andreas Rheinhardt avcodec/mpeg12data: Remove unused ff_rl_mpeg2 Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6bb0760a91576d53de960f8377d3ee341f14ec28 --- libavcodec/mpeg12data.c | 8 libavcodec/mpeg12vlc.h | 1 - 2 files changed, 9 deletions(-) diff --git a/libavcodec/mpeg12data.c b/libavcodec/mpeg12data.c index 398f70dd8a..5803999153 100644 --- a/libavcodec/mpeg12data.c +++ b/libavcodec/mpeg12data.c @@ -172,14 +172,6 @@ RLTable ff_rl_mpeg1 = { mpeg1_level, }; -RLTable ff_rl_mpeg2 = { -111, -111, -ff_mpeg2_vlc_table, -mpeg1_run, -mpeg1_level, -}; - const uint8_t ff_mpeg12_mbAddrIncrTable[36][2] = { {0x1, 1}, {0x3, 3}, diff --git a/libavcodec/mpeg12vlc.h b/libavcodec/mpeg12vlc.h index dc7f0269bf..71027d468f 100644 --- a/libavcodec/mpeg12vlc.h +++ b/libavcodec/mpeg12vlc.h @@ -53,7 +53,6 @@ void ff_mpeg12_init_vlcs(void); #define MPEG12_RL_NB_ELEMS 111 extern RLTable ff_rl_mpeg1; -extern RLTable ff_rl_mpeg2; extern const uint16_t ff_mpeg1_vlc_table[MPEG12_RL_NB_ELEMS + 2][2]; extern const uint16_t ff_mpeg2_vlc_table[MPEG12_RL_NB_ELEMS + 2][2]; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avcodec/mpeg12enc: Don't initialize ff_rl_mpeg2 unnecessarily
ffmpeg | branch: master | Andreas Rheinhardt | Sat Oct 22 01:39:09 2022 +0200| [06fafbe01e2a07dd636f512101d95caaa58302b1] | committer: Andreas Rheinhardt avcodec/mpeg12enc: Don't initialize ff_rl_mpeg2 unnecessarily ff_rl_mpeg1 and ff_rl_mpeg2 differ only in RLTable.table_vlc, which ff_rl_init() does not use to initialize RLTable.max_level, RLTable.max_run and RLTable.index_run. This implies that these tables agree for ff_rl_mpeg1 and ff_rl_mpeg2; hence one can just use one of them and avoid calling ff_rl_init() ff_rl_mpeg2 alltogether. Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=06fafbe01e2a07dd636f512101d95caaa58302b1 --- libavcodec/mpeg12enc.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c index e0775d6b96..4d10b42bf2 100644 --- a/libavcodec/mpeg12enc.c +++ b/libavcodec/mpeg12enc.c @@ -1076,14 +1076,13 @@ void ff_mpeg1_encode_mb(MpegEncContext *s, int16_t block[8][64], static av_cold void mpeg12_encode_init_static(void) { -static uint8_t mpeg12_static_rl_table_store[2][2][2*MAX_RUN + MAX_LEVEL + 3]; +static uint8_t mpeg12_static_rl_table_store[2][2*MAX_RUN + MAX_LEVEL + 3]; -ff_rl_init(&ff_rl_mpeg1, mpeg12_static_rl_table_store[0]); -ff_rl_init(&ff_rl_mpeg2, mpeg12_static_rl_table_store[1]); +ff_rl_init(&ff_rl_mpeg1, mpeg12_static_rl_table_store); ff_mpeg1_init_uni_ac_vlc(ff_rl_mpeg1.max_level[0], ff_rl_mpeg1.index_run[0], ff_mpeg1_vlc_table, uni_mpeg1_ac_vlc_len); -ff_mpeg1_init_uni_ac_vlc(ff_rl_mpeg2.max_level[0], ff_rl_mpeg2.index_run[0], +ff_mpeg1_init_uni_ac_vlc(ff_rl_mpeg1.max_level[0], ff_rl_mpeg1.index_run[0], ff_mpeg2_vlc_table, uni_mpeg2_ac_vlc_len); /* build unified dc encoding tables */ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avcodec/mpeg12enc: Avoid unnecessary indirection
ffmpeg | branch: master | Andreas Rheinhardt | Fri Oct 21 23:49:55 2022 +0200| [19ede649a00c10baef68216bbf72609e2ba2ab9b] | committer: Andreas Rheinhardt avcodec/mpeg12enc: Avoid unnecessary indirection Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=19ede649a00c10baef68216bbf72609e2ba2ab9b --- libavcodec/mpeg12data.c | 8 libavcodec/mpeg12enc.c | 4 ++-- libavcodec/mpeg12vlc.h | 5 + 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/libavcodec/mpeg12data.c b/libavcodec/mpeg12data.c index e301310b9f..398f70dd8a 100644 --- a/libavcodec/mpeg12data.c +++ b/libavcodec/mpeg12data.c @@ -64,7 +64,7 @@ const unsigned char ff_mpeg12_vlc_dc_chroma_bits[12] = { 2, 2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, }; -static const uint16_t mpeg1_vlc[113][2] = { +const uint16_t ff_mpeg1_vlc_table[MPEG12_RL_NB_ELEMS + 2][2] = { { 0x3, 2 }, { 0x4, 4 }, { 0x5, 5 }, { 0x6, 7 }, { 0x26, 8 }, { 0x21, 8 }, { 0xa, 10 }, { 0x1d, 12 }, { 0x18, 12 }, { 0x13, 12 }, { 0x10, 12 }, { 0x1a, 13 }, @@ -97,7 +97,7 @@ static const uint16_t mpeg1_vlc[113][2] = { { 0x2, 2 }, /* EOB */ }; -static const uint16_t mpeg2_vlc[113][2] = { +const uint16_t ff_mpeg2_vlc_table[MPEG12_RL_NB_ELEMS + 2][2] = { {0x02, 2}, {0x06, 3}, {0x07, 4}, {0x1c, 5}, {0x1d, 5}, {0x05, 6}, {0x04, 6}, {0x7b, 7}, {0x7c, 7}, {0x23, 8}, {0x22, 8}, {0xfa, 8}, @@ -167,7 +167,7 @@ static const int8_t mpeg1_run[111] = { RLTable ff_rl_mpeg1 = { 111, 111, -mpeg1_vlc, +ff_mpeg1_vlc_table, mpeg1_run, mpeg1_level, }; @@ -175,7 +175,7 @@ RLTable ff_rl_mpeg1 = { RLTable ff_rl_mpeg2 = { 111, 111, -mpeg2_vlc, +ff_mpeg2_vlc_table, mpeg1_run, mpeg1_level, }; diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c index c3df924b64..5d991ac99e 100644 --- a/libavcodec/mpeg12enc.c +++ b/libavcodec/mpeg12enc.c @@ -709,7 +709,7 @@ static void mpeg1_encode_block(MpegEncContext *s, int16_t *block, int n) { int alevel, level, last_non_zero, dc, diff, i, j, run, last_index, sign; int code, component; -const uint16_t (*table_vlc)[2] = ff_rl_mpeg1.table_vlc; +const uint16_t (*table_vlc)[2] = ff_mpeg1_vlc_table; last_index = s->block_last_index[n]; @@ -722,7 +722,7 @@ static void mpeg1_encode_block(MpegEncContext *s, int16_t *block, int n) s->last_dc[component] = dc; i = 1; if (s->intra_vlc_format) -table_vlc = ff_rl_mpeg2.table_vlc; +table_vlc = ff_mpeg2_vlc_table; } else { /* encode the first coefficient: needs to be done here because * it is handled slightly differently */ diff --git a/libavcodec/mpeg12vlc.h b/libavcodec/mpeg12vlc.h index d0083f1124..c810697370 100644 --- a/libavcodec/mpeg12vlc.h +++ b/libavcodec/mpeg12vlc.h @@ -53,9 +53,14 @@ void ff_mpeg12_init_vlcs(void); #define INIT_2D_VLC_RL(rl, rl_vlc, flags)\ ff_init_2d_vlc_rl(&rl, rl_vlc, FF_ARRAY_ELEMS(rl_vlc), flags) +#define MPEG12_RL_NB_ELEMS 111 + extern RLTable ff_rl_mpeg1; extern RLTable ff_rl_mpeg2; +extern const uint16_t ff_mpeg1_vlc_table[MPEG12_RL_NB_ELEMS + 2][2]; +extern const uint16_t ff_mpeg2_vlc_table[MPEG12_RL_NB_ELEMS + 2][2]; + extern RL_VLC_ELEM ff_mpeg1_rl_vlc[]; extern RL_VLC_ELEM ff_mpeg2_rl_vlc[]; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avcodec/speedhqenc: Avoid unnecessary indirection
ffmpeg | branch: master | Andreas Rheinhardt | Sat Oct 22 00:39:13 2022 +0200| [18412c76e6f087d15a26864999fd2d63df72cdc6] | committer: Andreas Rheinhardt avcodec/speedhqenc: Avoid unnecessary indirection Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=18412c76e6f087d15a26864999fd2d63df72cdc6 --- libavcodec/speedhq.c| 4 ++-- libavcodec/speedhq.h| 7 +++ libavcodec/speedhqenc.c | 8 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/libavcodec/speedhq.c b/libavcodec/speedhq.c index ee37573789..2d6e8ca949 100644 --- a/libavcodec/speedhq.c +++ b/libavcodec/speedhq.c @@ -24,7 +24,7 @@ #include "speedhq.h" /* AC codes: Very similar but not identical to MPEG-2. */ -static const uint16_t speedhq_vlc[123][2] = { +const uint16_t ff_speedhq_vlc_table[SPEEDHQ_RL_NB_ELEMS + 2][2] = { {0x0001, 2}, {0x0003, 3}, {0x000E, 4}, {0x0007, 5}, {0x0017, 5}, {0x0028, 6}, {0x0008, 6}, {0x006F, 7}, {0x001F, 7}, {0x00C4, 8}, {0x0044, 8}, {0x005F, 8}, @@ -101,7 +101,7 @@ static const uint8_t speedhq_run[121] = { RLTable ff_rl_speedhq = { 121, 121, -speedhq_vlc, +ff_speedhq_vlc_table, speedhq_run, speedhq_level, }; diff --git a/libavcodec/speedhq.h b/libavcodec/speedhq.h index 94879eda65..78f11ac6ab 100644 --- a/libavcodec/speedhq.h +++ b/libavcodec/speedhq.h @@ -21,9 +21,16 @@ #ifndef AVCODEC_SPEEDHQ_H #define AVCODEC_SPEEDHQ_H +#include #include "rl.h" #include "libavutil/attributes_internal.h" +#define SPEEDHQ_RL_NB_ELEMS 121 + +FF_VISIBILITY_PUSH_HIDDEN +extern const uint16_t ff_speedhq_vlc_table[SPEEDHQ_RL_NB_ELEMS + 2][2]; + extern RLTable attribute_visibility_hidden ff_rl_speedhq; +FF_VISIBILITY_POP_HIDDEN #endif /* AVCODEC_SPEEDHQ_H */ diff --git a/libavcodec/speedhqenc.c b/libavcodec/speedhqenc.c index 6cf40aac2d..58b5e858a8 100644 --- a/libavcodec/speedhqenc.c +++ b/libavcodec/speedhqenc.c @@ -222,11 +222,11 @@ static void encode_block(MpegEncContext *s, int16_t *block, int n) if (alevel <= ff_rl_speedhq.max_level[0][run]) { code = ff_rl_speedhq.index_run[0][run] + alevel - 1; /* store the VLC & sign at once */ -put_bits_le(&s->pb, ff_rl_speedhq.table_vlc[code][1] + 1, -ff_rl_speedhq.table_vlc[code][0] + (sign << ff_rl_speedhq.table_vlc[code][1])); +put_bits_le(&s->pb, ff_speedhq_vlc_table[code][1] + 1, +ff_speedhq_vlc_table[code][0] | (sign << ff_speedhq_vlc_table[code][1])); } else { /* escape seems to be pretty rare <5% so I do not optimize it; - * the values correspond to ff_rl_speedhq.table_vlc[121] */ + * the values correspond to ff_speedhq_vlc_table[121] */ put_bits_le(&s->pb, 6, 32); /* escape: only clip in this case */ put_bits_le(&s->pb, 6, run); @@ -235,7 +235,7 @@ static void encode_block(MpegEncContext *s, int16_t *block, int n) last_non_zero = i; } } -/* end of block; the values correspond to ff_rl_speedhq.table_vlc[122] */ +/* end of block; the values correspond to ff_speedhq_vlc_table[122] */ put_bits_le(&s->pb, 4, 6); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avcodec/mpeg12enc: Don't initialize unused parts of RLTable
ffmpeg | branch: master | Andreas Rheinhardt | Sat Oct 22 02:54:15 2022 +0200| [a89b9d155b0657906e07bf9fac89f7eb203c30de] | committer: Andreas Rheinhardt avcodec/mpeg12enc: Don't initialize unused parts of RLTable ff_rl_init() initializes RLTable.(max_level|max_run|index_run); max_run is unused by the MPEG-1/2 encoders (as well as SpeedHQ). Furthermore, it initializes these things twice (for two passes), but the second half of this is never used. Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a89b9d155b0657906e07bf9fac89f7eb203c30de --- libavcodec/mpeg12enc.c | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c index 4d10b42bf2..2db1d93d0e 100644 --- a/libavcodec/mpeg12enc.c +++ b/libavcodec/mpeg12enc.c @@ -49,6 +49,7 @@ #include "mpegvideodata.h" #include "mpegvideoenc.h" #include "profiles.h" +#include "rl.h" #if CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER static const uint8_t svcd_scan_offset_placeholder[] = { @@ -62,6 +63,9 @@ static uint8_t fcode_tab[MAX_MV * 2 + 1]; static uint8_t uni_mpeg1_ac_vlc_len[64 * 64 * 2]; static uint8_t uni_mpeg2_ac_vlc_len[64 * 64 * 2]; +static uint8_t mpeg12_max_level[MAX_LEVEL + 1]; +static uint8_t mpeg12_index_run[MAX_RUN + 1]; + /* simple include everything table for dc, first byte is bits * number next 3 are code */ static uint32_t mpeg1_lum_dc_uni[512]; @@ -757,8 +761,8 @@ next_coef: MASK_ABS(sign, alevel); sign &= 1; -if (alevel <= ff_rl_mpeg1.max_level[0][run]) { -code = ff_rl_mpeg1.index_run[0][run] + alevel - 1; +if (alevel <= mpeg12_max_level[run]) { +code = mpeg12_index_run[run] + alevel - 1; /* store the VLC & sign at once */ put_bits(&s->pb, table_vlc[code][1] + 1, (table_vlc[code][0] << 1) + sign); @@ -1076,13 +1080,12 @@ void ff_mpeg1_encode_mb(MpegEncContext *s, int16_t block[8][64], static av_cold void mpeg12_encode_init_static(void) { -static uint8_t mpeg12_static_rl_table_store[2][2*MAX_RUN + MAX_LEVEL + 3]; - -ff_rl_init(&ff_rl_mpeg1, mpeg12_static_rl_table_store); +ff_rl_init_level_run(mpeg12_max_level, mpeg12_index_run, + ff_mpeg12_run, ff_mpeg12_level, MPEG12_RL_NB_ELEMS); -ff_mpeg1_init_uni_ac_vlc(ff_rl_mpeg1.max_level[0], ff_rl_mpeg1.index_run[0], +ff_mpeg1_init_uni_ac_vlc(mpeg12_max_level, mpeg12_index_run, ff_mpeg1_vlc_table, uni_mpeg1_ac_vlc_len); -ff_mpeg1_init_uni_ac_vlc(ff_rl_mpeg1.max_level[0], ff_rl_mpeg1.index_run[0], +ff_mpeg1_init_uni_ac_vlc(mpeg12_max_level, mpeg12_index_run, ff_mpeg2_vlc_table, uni_mpeg2_ac_vlc_len); /* build unified dc encoding tables */ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avcodec/mpeg12: Use ff_rl_mpeg1.table_(run|level) directly
ffmpeg | branch: master | Andreas Rheinhardt | Sat Oct 22 02:12:44 2022 +0200| [a12abf59a9255eef50324245f079a6687c7b4a98] | committer: Andreas Rheinhardt avcodec/mpeg12: Use ff_rl_mpeg1.table_(run|level) directly Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a12abf59a9255eef50324245f079a6687c7b4a98 --- libavcodec/mpeg12.c | 8 libavcodec/mpeg12data.c | 8 libavcodec/mpeg12vlc.h | 3 +++ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index 282e473700..b0e638bfcd 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -152,11 +152,11 @@ static av_cold void mpeg12_init_vlcs(void) &table_mb_btype[0][1], 2, 1, &table_mb_btype[0][0], 2, 1, 64); -ff_init_2d_vlc_rl(ff_mpeg1_vlc_table, ff_mpeg1_rl_vlc, ff_rl_mpeg1.table_run, - ff_rl_mpeg1.table_level, ff_rl_mpeg1.n, +ff_init_2d_vlc_rl(ff_mpeg1_vlc_table, ff_mpeg1_rl_vlc, ff_mpeg12_run, + ff_mpeg12_level, MPEG12_RL_NB_ELEMS, FF_ARRAY_ELEMS(ff_mpeg1_rl_vlc), 0); -ff_init_2d_vlc_rl(ff_mpeg2_vlc_table, ff_mpeg2_rl_vlc, ff_rl_mpeg1.table_run, - ff_rl_mpeg1.table_level, ff_rl_mpeg1.n, +ff_init_2d_vlc_rl(ff_mpeg2_vlc_table, ff_mpeg2_rl_vlc, ff_mpeg12_run, + ff_mpeg12_level, MPEG12_RL_NB_ELEMS, FF_ARRAY_ELEMS(ff_mpeg2_rl_vlc), 0); } diff --git a/libavcodec/mpeg12data.c b/libavcodec/mpeg12data.c index 5803999153..1e3410bf2f 100644 --- a/libavcodec/mpeg12data.c +++ b/libavcodec/mpeg12data.c @@ -130,7 +130,7 @@ const uint16_t ff_mpeg2_vlc_table[MPEG12_RL_NB_ELEMS + 2][2] = { {0x06,4}, /* EOB */ }; -static const int8_t mpeg1_level[111] = { +const int8_t ff_mpeg12_level[MPEG12_RL_NB_ELEMS] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, @@ -147,7 +147,7 @@ static const int8_t mpeg1_level[111] = { 1, 1, 1, 1, 1, 1, 1, }; -static const int8_t mpeg1_run[111] = { +const int8_t ff_mpeg12_run[MPEG12_RL_NB_ELEMS] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -168,8 +168,8 @@ RLTable ff_rl_mpeg1 = { 111, 111, ff_mpeg1_vlc_table, -mpeg1_run, -mpeg1_level, +ff_mpeg12_run, +ff_mpeg12_level, }; const uint8_t ff_mpeg12_mbAddrIncrTable[36][2] = { diff --git a/libavcodec/mpeg12vlc.h b/libavcodec/mpeg12vlc.h index 71027d468f..15275c5269 100644 --- a/libavcodec/mpeg12vlc.h +++ b/libavcodec/mpeg12vlc.h @@ -54,6 +54,9 @@ void ff_mpeg12_init_vlcs(void); extern RLTable ff_rl_mpeg1; +extern const int8_t ff_mpeg12_level[MPEG12_RL_NB_ELEMS]; +extern const int8_t ff_mpeg12_run[MPEG12_RL_NB_ELEMS]; + extern const uint16_t ff_mpeg1_vlc_table[MPEG12_RL_NB_ELEMS + 2][2]; extern const uint16_t ff_mpeg2_vlc_table[MPEG12_RL_NB_ELEMS + 2][2]; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avcodec/mpeg12: Pass parameters explicitly in ff_init_2d_vlc_rl()
ffmpeg | branch: master | Andreas Rheinhardt | Sat Oct 22 01:58:49 2022 +0200| [4a8fe21ab4390affc8da9ff51103d9d32fad0044] | committer: Andreas Rheinhardt avcodec/mpeg12: Pass parameters explicitly in ff_init_2d_vlc_rl() This allows to exploit that ff_rl_mpeg1 and ff_rl_mpeg2 only differ in their VLC table. Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4a8fe21ab4390affc8da9ff51103d9d32fad0044 --- libavcodec/mpeg12.c | 23 ++- libavcodec/mpeg12vlc.h | 8 +++- libavcodec/speedhqdec.c | 4 +++- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index 351ebf420f..282e473700 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -63,14 +63,15 @@ static const uint8_t table_mb_btype[11][2] = { { 2, 5 }, // 0x1E MB_QUANT|MB_FOR|MB_BACK|MB_PAT }; -av_cold void ff_init_2d_vlc_rl(const RLTable *rl, RL_VLC_ELEM rl_vlc[], - unsigned static_size, int flags) +av_cold void ff_init_2d_vlc_rl(const uint16_t table_vlc[][2], RL_VLC_ELEM rl_vlc[], + const int8_t table_run[], const uint8_t table_level[], + int n, unsigned static_size, int flags) { int i; VLCElem table[680] = { 0 }; VLC vlc = { .table = table, .table_allocated = static_size }; av_assert0(static_size <= FF_ARRAY_ELEMS(table)); -init_vlc(&vlc, TEX_VLC_BITS, rl->n + 2, &rl->table_vlc[0][1], 4, 2, &rl->table_vlc[0][0], 4, 2, INIT_VLC_USE_NEW_STATIC | flags); +init_vlc(&vlc, TEX_VLC_BITS, n + 2, &table_vlc[0][1], 4, 2, &table_vlc[0][0], 4, 2, INIT_VLC_USE_NEW_STATIC | flags); for (i = 0; i < vlc.table_size; i++) { int code = vlc.table[i].sym; @@ -84,15 +85,15 @@ av_cold void ff_init_2d_vlc_rl(const RLTable *rl, RL_VLC_ELEM rl_vlc[], run = 0; level = code; } else { -if (code == rl->n) { //esc +if (code == n) { //esc run = 65; level = 0; -} else if (code == rl->n+1) { //eob +} else if (code == n + 1) { //eob run = 0; level = 127; } else { -run = rl->table_run [code] + 1; -level = rl->table_level[code]; +run = table_run [code] + 1; +level = table_level[code]; } } rl_vlc[i].len = len; @@ -151,8 +152,12 @@ static av_cold void mpeg12_init_vlcs(void) &table_mb_btype[0][1], 2, 1, &table_mb_btype[0][0], 2, 1, 64); -INIT_2D_VLC_RL(ff_rl_mpeg1, ff_mpeg1_rl_vlc, 0); -INIT_2D_VLC_RL(ff_rl_mpeg2, ff_mpeg2_rl_vlc, 0); +ff_init_2d_vlc_rl(ff_mpeg1_vlc_table, ff_mpeg1_rl_vlc, ff_rl_mpeg1.table_run, + ff_rl_mpeg1.table_level, ff_rl_mpeg1.n, + FF_ARRAY_ELEMS(ff_mpeg1_rl_vlc), 0); +ff_init_2d_vlc_rl(ff_mpeg2_vlc_table, ff_mpeg2_rl_vlc, ff_rl_mpeg1.table_run, + ff_rl_mpeg1.table_level, ff_rl_mpeg1.n, + FF_ARRAY_ELEMS(ff_mpeg2_rl_vlc), 0); } av_cold void ff_mpeg12_init_vlcs(void) diff --git a/libavcodec/mpeg12vlc.h b/libavcodec/mpeg12vlc.h index 5a04834bee..dc7f0269bf 100644 --- a/libavcodec/mpeg12vlc.h +++ b/libavcodec/mpeg12vlc.h @@ -50,9 +50,6 @@ extern VLC ff_mv_vlc; void ff_mpeg12_init_vlcs(void); -#define INIT_2D_VLC_RL(rl, rl_vlc, flags)\ -ff_init_2d_vlc_rl(&rl, rl_vlc, FF_ARRAY_ELEMS(rl_vlc), flags) - #define MPEG12_RL_NB_ELEMS 111 extern RLTable ff_rl_mpeg1; @@ -64,8 +61,9 @@ extern const uint16_t ff_mpeg2_vlc_table[MPEG12_RL_NB_ELEMS + 2][2]; extern RL_VLC_ELEM ff_mpeg1_rl_vlc[]; extern RL_VLC_ELEM ff_mpeg2_rl_vlc[]; -void ff_init_2d_vlc_rl(const RLTable *rl, RL_VLC_ELEM rl_vlc[], - unsigned static_size, int flags); +void ff_init_2d_vlc_rl(const uint16_t table_vlc[][2], RL_VLC_ELEM rl_vlc[], + const int8_t table_run[], const uint8_t table_level[], + int n, unsigned static_size, int flags); void ff_mpeg1_init_uni_ac_vlc(const int8_t max_level[], const uint8_t index_run[], const uint16_t table_vlc[][2], uint8_t uni_ac_vlc_len[]); diff --git a/libavcodec/speedhqdec.c b/libavcodec/speedhqdec.c index 93b60a4c3d..1ed8cfb9ff 100644 --- a/libavcodec/speedhqdec.c +++ b/libavcodec/speedhqdec.c @@ -566,7 +566,9 @@ static av_cold void speedhq_static_init(void) ff_mpeg12_vlc_dc_chroma_code, 2, 2, INIT_VLC_OUTPUT_LE, 514); -INIT_2D_VLC_RL(ff_rl_speedhq, speedhq_rl_vlc, INIT_VLC_LE); +ff_init_2d_vlc_rl(ff_speedhq_vlc_table, speedhq_rl_vlc, ff_rl_speedhq.table_run, + ff_rl_speedhq.table_level, ff_rl_speedhq.n, + FF_ARRAY_ELEMS(speedhq_rl_vlc), INIT_VLC_LE);
[FFmpeg-cvslog] avcodec/mpeg12data: Remove ff_rl_mpeg1
ffmpeg | branch: master | Andreas Rheinhardt | Sat Oct 22 18:48:40 2022 +0200| [92b81a7c99ef82d8d8810f4432c46fc6ccffb59d] | committer: Andreas Rheinhardt avcodec/mpeg12data: Remove ff_rl_mpeg1 No longer used anywhere. Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=92b81a7c99ef82d8d8810f4432c46fc6ccffb59d --- libavcodec/mpeg12.c | 1 + libavcodec/mpeg12data.c | 8 libavcodec/mpeg12vlc.h | 3 --- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index b0e638bfcd..5d5f39388f 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -37,6 +37,7 @@ #include "mpeg12codecs.h" #include "mpeg12data.h" #include "mpeg12dec.h" +#include "rl.h" #include "startcode.h" static const uint8_t table_mb_ptype[7][2] = { diff --git a/libavcodec/mpeg12data.c b/libavcodec/mpeg12data.c index 1e3410bf2f..a55fa463a4 100644 --- a/libavcodec/mpeg12data.c +++ b/libavcodec/mpeg12data.c @@ -164,14 +164,6 @@ const int8_t ff_mpeg12_run[MPEG12_RL_NB_ELEMS] = { 25, 26, 27, 28, 29, 30, 31, }; -RLTable ff_rl_mpeg1 = { -111, -111, -ff_mpeg1_vlc_table, -ff_mpeg12_run, -ff_mpeg12_level, -}; - const uint8_t ff_mpeg12_mbAddrIncrTable[36][2] = { {0x1, 1}, {0x3, 3}, diff --git a/libavcodec/mpeg12vlc.h b/libavcodec/mpeg12vlc.h index 15275c5269..3ed35968f6 100644 --- a/libavcodec/mpeg12vlc.h +++ b/libavcodec/mpeg12vlc.h @@ -28,7 +28,6 @@ #ifndef AVCODEC_MPEG12VLC_H #define AVCODEC_MPEG12VLC_H -#include "rl.h" #include "vlc.h" #define DC_VLC_BITS 9 @@ -52,8 +51,6 @@ void ff_mpeg12_init_vlcs(void); #define MPEG12_RL_NB_ELEMS 111 -extern RLTable ff_rl_mpeg1; - extern const int8_t ff_mpeg12_level[MPEG12_RL_NB_ELEMS]; extern const int8_t ff_mpeg12_run[MPEG12_RL_NB_ELEMS]; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avcodec/speedhqdec: Use ff_rl_speedhq.table_(run|level) directly
ffmpeg | branch: master | Andreas Rheinhardt | Sat Oct 22 02:26:52 2022 +0200| [65beba7889982468c8c4e2add66ff0d3a790aaa8] | committer: Andreas Rheinhardt avcodec/speedhqdec: Use ff_rl_speedhq.table_(run|level) directly Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=65beba7889982468c8c4e2add66ff0d3a790aaa8 --- libavcodec/speedhq.c| 8 libavcodec/speedhq.h| 2 ++ libavcodec/speedhqdec.c | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/libavcodec/speedhq.c b/libavcodec/speedhq.c index 2d6e8ca949..46ff0cfc53 100644 --- a/libavcodec/speedhq.c +++ b/libavcodec/speedhq.c @@ -60,7 +60,7 @@ const uint16_t ff_speedhq_vlc_table[SPEEDHQ_RL_NB_ELEMS + 2][2] = { {0x0006, 4} /* EOB */ }; -static const uint8_t speedhq_level[121] = { +const uint8_t ff_speedhq_level[121] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, @@ -79,7 +79,7 @@ static const uint8_t speedhq_level[121] = { 1, }; -static const uint8_t speedhq_run[121] = { +const uint8_t ff_speedhq_run[121] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -102,6 +102,6 @@ RLTable ff_rl_speedhq = { 121, 121, ff_speedhq_vlc_table, -speedhq_run, -speedhq_level, +ff_speedhq_run, +ff_speedhq_level, }; diff --git a/libavcodec/speedhq.h b/libavcodec/speedhq.h index 78f11ac6ab..8bc22ab0d7 100644 --- a/libavcodec/speedhq.h +++ b/libavcodec/speedhq.h @@ -28,6 +28,8 @@ #define SPEEDHQ_RL_NB_ELEMS 121 FF_VISIBILITY_PUSH_HIDDEN +extern const uint8_t ff_speedhq_run[SPEEDHQ_RL_NB_ELEMS]; +extern const uint8_t ff_speedhq_level[SPEEDHQ_RL_NB_ELEMS]; extern const uint16_t ff_speedhq_vlc_table[SPEEDHQ_RL_NB_ELEMS + 2][2]; extern RLTable attribute_visibility_hidden ff_rl_speedhq; diff --git a/libavcodec/speedhqdec.c b/libavcodec/speedhqdec.c index 1ed8cfb9ff..ac233b3645 100644 --- a/libavcodec/speedhqdec.c +++ b/libavcodec/speedhqdec.c @@ -566,8 +566,8 @@ static av_cold void speedhq_static_init(void) ff_mpeg12_vlc_dc_chroma_code, 2, 2, INIT_VLC_OUTPUT_LE, 514); -ff_init_2d_vlc_rl(ff_speedhq_vlc_table, speedhq_rl_vlc, ff_rl_speedhq.table_run, - ff_rl_speedhq.table_level, ff_rl_speedhq.n, +ff_init_2d_vlc_rl(ff_speedhq_vlc_table, speedhq_rl_vlc, ff_speedhq_run, + ff_speedhq_level, SPEEDHQ_RL_NB_ELEMS, FF_ARRAY_ELEMS(speedhq_rl_vlc), INIT_VLC_LE); compute_alpha_vlcs(); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avcodec/rl: Add analogue for ff_rl_init() without RLTable
ffmpeg | branch: master | Andreas Rheinhardt | Sat Oct 22 20:46:19 2022 +0200| [0486f0f5d25099f4fce2638cd0388acae2a7afa1] | committer: Andreas Rheinhardt avcodec/rl: Add analogue for ff_rl_init() without RLTable Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0486f0f5d25099f4fce2638cd0388acae2a7afa1 --- libavcodec/rl.c | 17 + libavcodec/rl.h | 10 ++ 2 files changed, 27 insertions(+) diff --git a/libavcodec/rl.c b/libavcodec/rl.c index 645a5362f7..3f8271d37e 100644 --- a/libavcodec/rl.c +++ b/libavcodec/rl.c @@ -24,6 +24,23 @@ #include "rl.h" +av_cold void ff_rl_init_level_run(uint8_t max_level[MAX_LEVEL + 1], + uint8_t index_run[MAX_RUN + 1], + const uint8_t table_run[/* n */], + const uint8_t table_level[/* n*/], + int n) +{ +memset(index_run, n, MAX_RUN + 1); +for (int i = 0; i < n; i++) { +int run = table_run[i]; +int level = table_level[i]; +if (index_run[run] == n) +index_run[run] = i; +if (level > max_level[run]) +max_level[run] = level; +} +} + av_cold void ff_rl_init(RLTable *rl, uint8_t static_store[2][2 * MAX_RUN + MAX_LEVEL + 3]) { diff --git a/libavcodec/rl.h b/libavcodec/rl.h index 07e3da5003..4380fda272 100644 --- a/libavcodec/rl.h +++ b/libavcodec/rl.h @@ -48,6 +48,16 @@ typedef struct RLTable { RL_VLC_ELEM *rl_vlc[32]; ///< decoding only } RLTable; +/** + * Initialize max_level and index_run from table_run and table_level; + * this is equivalent to initializing RLTable.max_level[0] and + * RLTable.index_run[0] with ff_rl_init(). + */ +void ff_rl_init_level_run(uint8_t max_level[MAX_LEVEL + 1], + uint8_t index_run[MAX_RUN + 1], + const uint8_t table_run[/* n */], + const uint8_t table_level[/* n*/], int n); + /** * Initialize index_run, max_level and max_run from n, last, table_vlc, * table_run and table_level. ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avcodec/speedhqenc: Don't initialize unused parts of RLTable
ffmpeg | branch: master | Andreas Rheinhardt | Sat Oct 22 18:55:04 2022 +0200| [4190019ff4672f38835fc0d03206bdf4278a8cb4] | committer: Andreas Rheinhardt avcodec/speedhqenc: Don't initialize unused parts of RLTable ff_rl_init() initializes RLTable.(max_level|max_run|index_run); max_run is unused by the SpeedHQ encoder (as well as MPEG-1/2). Furthermore, it initializes these things twice (for two passes), but the second half of this is never used. Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4190019ff4672f38835fc0d03206bdf4278a8cb4 --- libavcodec/speedhqenc.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/libavcodec/speedhqenc.c b/libavcodec/speedhqenc.c index 44ee62b9c2..65e66afae4 100644 --- a/libavcodec/speedhqenc.c +++ b/libavcodec/speedhqenc.c @@ -36,10 +36,12 @@ #include "mpegvideo.h" #include "mpegvideodata.h" #include "mpegvideoenc.h" +#include "rl.h" #include "speedhq.h" #include "speedhqenc.h" -static uint8_t speedhq_static_rl_table_store[2][2*MAX_RUN + MAX_LEVEL + 3]; +static uint8_t speedhq_max_level[MAX_LEVEL + 1]; +static uint8_t speedhq_index_run[MAX_RUN + 1]; /* Exactly the same as MPEG-2, except little-endian. */ static const uint16_t mpeg12_vlc_dc_lum_code_reversed[12] = { @@ -64,7 +66,8 @@ typedef struct SpeedHQEncContext { static av_cold void speedhq_init_static_data(void) { -ff_rl_init(&ff_rl_speedhq, speedhq_static_rl_table_store); +ff_rl_init_level_run(speedhq_max_level, speedhq_index_run, + ff_speedhq_run, ff_speedhq_level, SPEEDHQ_RL_NB_ELEMS); /* build unified dc encoding tables */ for (int i = -255; i < 256; i++) { @@ -88,7 +91,7 @@ static av_cold void speedhq_init_static_data(void) speedhq_chr_dc_uni[i + 255] = bits + (code << 8); } -ff_mpeg1_init_uni_ac_vlc(ff_rl_speedhq.max_level[0], ff_rl_speedhq.index_run[0], +ff_mpeg1_init_uni_ac_vlc(speedhq_max_level, speedhq_index_run, ff_speedhq_vlc_table, uni_speedhq_ac_vlc_len); } @@ -220,8 +223,8 @@ static void encode_block(MpegEncContext *s, int16_t *block, int n) MASK_ABS(sign, alevel); sign &= 1; -if (alevel <= ff_rl_speedhq.max_level[0][run]) { -code = ff_rl_speedhq.index_run[0][run] + alevel - 1; +if (alevel <= speedhq_max_level[run]) { +code = speedhq_index_run[run] + alevel - 1; /* store the VLC & sign at once */ put_bits_le(&s->pb, ff_speedhq_vlc_table[code][1] + 1, ff_speedhq_vlc_table[code][0] | (sign << ff_speedhq_vlc_table[code][1])); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avcodec/speedhq: Remove unused ff_rl_speedhq
ffmpeg | branch: master | Andreas Rheinhardt | Sat Oct 22 18:56:28 2022 +0200| [e59e14eee11e2efd8b2c58ee1033682ddfe22845] | committer: Andreas Rheinhardt avcodec/speedhq: Remove unused ff_rl_speedhq Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e59e14eee11e2efd8b2c58ee1033682ddfe22845 --- libavcodec/speedhq.c| 9 - libavcodec/speedhq.h| 3 --- libavcodec/speedhqdec.c | 1 - 3 files changed, 13 deletions(-) diff --git a/libavcodec/speedhq.c b/libavcodec/speedhq.c index 46ff0cfc53..eb7de03116 100644 --- a/libavcodec/speedhq.c +++ b/libavcodec/speedhq.c @@ -20,7 +20,6 @@ */ #include -#include "rl.h" #include "speedhq.h" /* AC codes: Very similar but not identical to MPEG-2. */ @@ -97,11 +96,3 @@ const uint8_t ff_speedhq_run[121] = { 23, 24, 25, 26, 27, 28, 29, 30, 31, }; - -RLTable ff_rl_speedhq = { -121, -121, -ff_speedhq_vlc_table, -ff_speedhq_run, -ff_speedhq_level, -}; diff --git a/libavcodec/speedhq.h b/libavcodec/speedhq.h index 8bc22ab0d7..c40991b8b5 100644 --- a/libavcodec/speedhq.h +++ b/libavcodec/speedhq.h @@ -22,7 +22,6 @@ #define AVCODEC_SPEEDHQ_H #include -#include "rl.h" #include "libavutil/attributes_internal.h" #define SPEEDHQ_RL_NB_ELEMS 121 @@ -31,8 +30,6 @@ FF_VISIBILITY_PUSH_HIDDEN extern const uint8_t ff_speedhq_run[SPEEDHQ_RL_NB_ELEMS]; extern const uint8_t ff_speedhq_level[SPEEDHQ_RL_NB_ELEMS]; extern const uint16_t ff_speedhq_vlc_table[SPEEDHQ_RL_NB_ELEMS + 2][2]; - -extern RLTable attribute_visibility_hidden ff_rl_speedhq; FF_VISIBILITY_POP_HIDDEN #endif /* AVCODEC_SPEEDHQ_H */ diff --git a/libavcodec/speedhqdec.c b/libavcodec/speedhqdec.c index ac233b3645..e1e6f9a5f5 100644 --- a/libavcodec/speedhqdec.c +++ b/libavcodec/speedhqdec.c @@ -39,7 +39,6 @@ #include "mathops.h" #include "mpeg12data.h" #include "mpeg12vlc.h" -#include "rl.h" #include "speedhq.h" #define MAX_INDEX (64 - 1) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avcodec/mpegvideo: Don't initialize H264Chroma ctx unnecessarily
ffmpeg | branch: master | Andreas Rheinhardt | Mon Oct 24 03:20:22 2022 +0200| [938c62b368e90e5686d08caf9e2b5d12f06ab884] | committer: Andreas Rheinhardt avcodec/mpegvideo: Don't initialize H264Chroma ctx unnecessarily It is only used by the decoders' lowres code, so only initialize it for decoders. Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=938c62b368e90e5686d08caf9e2b5d12f06ab884 --- configure | 4 ++-- libavcodec/mpegvideo.c | 2 -- libavcodec/mpegvideo_dec.c | 3 +++ 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/configure b/configure index c5a466657f..2cea06ca1b 100755 --- a/configure +++ b/configure @@ -2754,8 +2754,8 @@ me_cmp_select="idctdsp" mpeg_er_select="error_resilience" mpegaudio_select="mpegaudiodsp mpegaudioheader" mpegaudiodsp_select="dct" -mpegvideo_select="blockdsp h264chroma hpeldsp idctdsp videodsp" -mpegvideodec_select="mpegvideo mpeg_er" +mpegvideo_select="blockdsp hpeldsp idctdsp videodsp" +mpegvideodec_select="h264chroma mpegvideo mpeg_er" mpegvideoenc_select="aandcttables fdctdsp me_cmp mpegvideo pixblockdsp qpeldsp" msmpeg4dec_select="h263_decoder" msmpeg4enc_select="h263_encoder" diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index c436dc8001..dbb72f8e94 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -34,7 +34,6 @@ #include "avcodec.h" #include "blockdsp.h" -#include "h264chroma.h" #include "idctdsp.h" #include "mathops.h" #include "mpeg_er.h" @@ -275,7 +274,6 @@ static void gray8(uint8_t *dst, const uint8_t *src, ptrdiff_t linesize, int h) static av_cold int dct_init(MpegEncContext *s) { ff_blockdsp_init(&s->bdsp); -ff_h264chroma_init(&s->h264chroma, 8); //for lowres ff_hpeldsp_init(&s->hdsp, s->avctx->flags); ff_videodsp_init(&s->vdsp, s->avctx->bits_per_raw_sample); diff --git a/libavcodec/mpegvideo_dec.c b/libavcodec/mpegvideo_dec.c index c2d6d8bdd7..12c7144ffb 100644 --- a/libavcodec/mpegvideo_dec.c +++ b/libavcodec/mpegvideo_dec.c @@ -51,6 +51,8 @@ void ff_mpv_decode_init(MpegEncContext *s, AVCodecContext *avctx) /* convert fourcc to upper case */ s->codec_tag = ff_toupper4(avctx->codec_tag); + +ff_h264chroma_init(&s->h264chroma, 8); //for lowres } int ff_mpeg_update_thread_context(AVCodecContext *dst, @@ -83,6 +85,7 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst, memset(s, 0, sizeof(*s)); s->avctx = dst; s->private_ctx = private_ctx; +memcpy(&s->h264chroma, &s1->h264chroma, sizeof(s->h264chroma)); return err; } } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] configure: Remove unnecessary mpeg[12]video_enc->h263dsp dependencies
ffmpeg | branch: master | Andreas Rheinhardt | Mon Oct 24 03:31:15 2022 +0200| [22fc0375e87b7a5395c87ac1ee2a4c795f68f565] | committer: Andreas Rheinhardt configure: Remove unnecessary mpeg[12]video_enc->h263dsp dependencies This effectively reverts 9b78abae19aa18e8427848f4d4367da3822ed627. The underlying issue has been fixed properly in commit cff480e49d73640c980922626e57c9889bb4b18d. Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=22fc0375e87b7a5395c87ac1ee2a4c795f68f565 --- configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 2cea06ca1b..4a57a9aa5c 100755 --- a/configure +++ b/configure @@ -2899,9 +2899,9 @@ mpc7_decoder_select="bswapdsp mpegaudiodsp" mpc8_decoder_select="mpegaudiodsp" mpegvideo_decoder_select="mpegvideodec" mpeg1video_decoder_select="mpegvideodec" -mpeg1video_encoder_select="mpegvideoenc h263dsp" +mpeg1video_encoder_select="mpegvideoenc" mpeg2video_decoder_select="mpegvideodec" -mpeg2video_encoder_select="mpegvideoenc h263dsp" +mpeg2video_encoder_select="mpegvideoenc" mpeg4_decoder_select="h263_decoder mpeg4video_parser" mpeg4_encoder_select="h263_encoder" msa1_decoder_select="mss34dsp" ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] configure: Remove a leftover comment about MSVC C99 support
ffmpeg | branch: master | Martin Storsjö | Wed Oct 19 11:52:55 2022 +0300| [2eb601e86552e215305ad68679a9a4c35de21a9d] | committer: Martin Storsjö configure: Remove a leftover comment about MSVC C99 support Support for building with older versions of MSVC (with the c99wrap/c99conv frontend) was removed in ce943dd6acbfdfc40223c0fb24d4cad438e6499c. Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2eb601e86552e215305ad68679a9a4c35de21a9d --- configure | 6 -- 1 file changed, 6 deletions(-) diff --git a/configure b/configure index 4a57a9aa5c..70c9e41dcc 100755 --- a/configure +++ b/configure @@ -4372,12 +4372,6 @@ case "$toolchain" in esac ;; msvc) -# Check whether the current MSVC version needs the C99 converter. -# From MSVC 2013 (compiler major version 18) onwards, it does actually -# support enough of C99 to build ffmpeg. Default to the new -# behaviour if the regexp was unable to match anything, since this -# successfully parses the version number of existing supported -# versions that require the converter (MSVC 2010 and 2012). cl_major_ver=$(cl.exe 2>&1 | sed -n 's/.*Version \([[:digit:]]\{1,\}\)\..*/\1/p') if [ -z "$cl_major_ver" ] || [ $cl_major_ver -ge 18 ]; then cc_default="cl.exe" ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] swscale: aarch64: Fix yuv2rgb with negative strides
ffmpeg | branch: master | Martin Storsjö | Tue Oct 25 13:13:34 2022 +0300| [cb803a0072cb98945dcd3f1660bd2a975650ce42] | committer: Martin Storsjö swscale: aarch64: Fix yuv2rgb with negative strides Treat the 32 bit stride registers as signed. Alternatively, we could make the stride arguments ptrdiff_t instead of int, and changing all of the assembly to operate on these registers with their full 64 bit width, but that's a much larger and more intrusive change (and risks missing some operation, which would clamp the intermediates to 32 bit still). Fixes: https://trac.ffmpeg.org/ticket/9985 Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cb803a0072cb98945dcd3f1660bd2a975650ce42 --- libswscale/aarch64/yuv2rgb_neon.S | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libswscale/aarch64/yuv2rgb_neon.S b/libswscale/aarch64/yuv2rgb_neon.S index f4b220fb60..f341268c5d 100644 --- a/libswscale/aarch64/yuv2rgb_neon.S +++ b/libswscale/aarch64/yuv2rgb_neon.S @@ -118,8 +118,8 @@ .endm .macro increment_yuv422p -add x6, x6, w7, UXTW // srcU += incU -add x13, x13, w14, UXTW // srcV += incV +add x6, x6, w7, SXTW // srcU += incU +add x13, x13, w14, SXTW // srcV += incV .endm .macro compute_rgba r1 g1 b1 a1 r2 g2 b2 a2 @@ -189,8 +189,8 @@ function ff_\ifmt\()_to_\ofmt\()_neon, export=1 st4 {v16.8B,v17.8B,v18.8B,v19.8B}, [x2], #32 subsw8, w8, #16 // width -= 16 b.gt2b -add x2, x2, w3, UXTW// dst += padding -add x4, x4, w5, UXTW// srcY += paddingY +add x2, x2, w3, SXTW// dst += padding +add x4, x4, w5, SXTW// srcY += paddingY increment_\ifmt subsw1, w1, #1 // height -= 1 b.gt1b ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] Tag n3.4.12 : FFmpeg 3.4.12 release
[ffmpeg] [branch: refs/tags/n3.4.12] Tag:601780b8e4d6c4cf172ed304d01c7e5c1914d7c6 > http://git.videolan.org/gitweb.cgi/ffmpeg.git?a=tag;h=601780b8e4d6c4cf172ed304d01c7e5c1914d7c6 Tagger: Michael Niedermayer Date: Thu Oct 27 22:26:03 2022 +0200 FFmpeg 3.4.12 release ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] [ffmpeg-web] branch master updated. 10606f1 web/download: Add FFmpeg 3.4.12
The branch, master has been updated via 10606f1d0191d6c264529fa89942c899b81cab03 (commit) from fa42194856f8e4545e19d8f2e4ad71933b53fcdb (commit) - Log - commit 10606f1d0191d6c264529fa89942c899b81cab03 Author: Michael Niedermayer AuthorDate: Thu Oct 27 22:51:35 2022 +0200 Commit: Michael Niedermayer CommitDate: Thu Oct 27 22:51:35 2022 +0200 web/download: Add FFmpeg 3.4.12 diff --git a/src/download b/src/download index 4af8ffa..f3b41ca 100644 --- a/src/download +++ b/src/download @@ -522,10 +522,10 @@ libpostproc55. 3.100 - FFmpeg 3.4.11 "Cantor" + FFmpeg 3.4.12 "Cantor" -3.4.11 was released on 2022-05-14. It is the latest stable FFmpeg release +3.4.12 was released on 2022-10-27. It is the latest stable FFmpeg release from the 3.4 release branch, which was cut from master on 2017-10-11. It includes the following library versions: @@ -543,19 +543,19 @@ libpostproc54. 7.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 - https://git.ffmpeg.org/gitweb/ffmpeg.git/shortlog/n3.4.11";>Changelog + https://git.ffmpeg.org/gitweb/ffmpeg.git/shortlog/n3.4.12";>Changelog https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/refs/heads/release/3.4:/RELEASE_NOTES";>Release Notes --- Summary of changes: src/download | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) hooks/post-receive -- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".