* [FFmpeg-devel] [PATCH 2/4] configure, avcodec/Makefile: Make IntraX8 select WMV2DSP, fix MIPS build
2022-07-31 9:37 [FFmpeg-devel] [PATCH 1/4] avcodec/intrax8: Remove unused IDCTDSPContext Andreas Rheinhardt
@ 2022-07-31 9:41 ` Andreas Rheinhardt
2022-07-31 9:41 ` [FFmpeg-devel] [PATCH 3/4] configure: Add msmpeg4(dec|enc) subsystems Andreas Rheinhardt
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Andreas Rheinhardt @ 2022-07-31 9:41 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
IntraX8 uses WMV2DSP directly, so it should have a direct dependency
on it. Also remove the indirect Makefile dependency of the VC-1 decoder
on wmv2dsp.o. Notice that since the addition of the MIPS WMV2DSP
implementation building only the VC-1 decoder would fail, because
no Makefile dependency VC1->wmv2dsp_init_mips.o has been added.
This is of course fixed by this commit.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
configure | 2 +-
libavcodec/Makefile | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index 974768a663..ff075fb950 100755
--- a/configure
+++ b/configure
@@ -2733,7 +2733,7 @@ h264dsp_select="startcode"
hevcparse_select="atsc_a53 golomb"
frame_thread_encoder_deps="encoders threads"
inflate_wrapper_deps="zlib"
-intrax8_select="blockdsp"
+intrax8_select="blockdsp wmv2dsp"
iso_media_select="mpeg4audio"
mdct_select="fft"
mdct15_select="fft"
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index aff7752856..a6311411d3 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -723,7 +723,7 @@ OBJS-$(CONFIG_VBLE_DECODER) += vble.o
OBJS-$(CONFIG_VC1_DECODER) += vc1dec.o vc1_block.o vc1_loopfilter.o \
vc1_mc.o vc1_pred.o vc1.o vc1data.o \
msmpeg4dec.o msmpeg4.o msmpeg4data.o \
- wmv2dsp.o wmv2data.o
+ wmv2data.o
OBJS-$(CONFIG_VC1_CUVID_DECODER) += cuviddec.o
OBJS-$(CONFIG_VC1_MMAL_DECODER) += mmaldec.o
OBJS-$(CONFIG_VC1_QSV_DECODER) += qsvdec.o
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 7+ messages in thread
* [FFmpeg-devel] [PATCH 3/4] configure: Add msmpeg4(dec|enc) subsystems
2022-07-31 9:37 [FFmpeg-devel] [PATCH 1/4] avcodec/intrax8: Remove unused IDCTDSPContext Andreas Rheinhardt
2022-07-31 9:41 ` [FFmpeg-devel] [PATCH 2/4] configure, avcodec/Makefile: Make IntraX8 select WMV2DSP, fix MIPS build Andreas Rheinhardt
@ 2022-07-31 9:41 ` Andreas Rheinhardt
2022-07-31 10:06 ` Martin Storsjö
2022-07-31 9:41 ` [FFmpeg-devel] [PATCH 4/4] avcodec/intrax8: Avoid indirection when accessing VLC table Andreas Rheinhardt
2022-08-03 5:11 ` [FFmpeg-devel] [PATCH 1/4] avcodec/intrax8: Remove unused IDCTDSPContext Andreas Rheinhardt
3 siblings, 1 reply; 7+ messages in thread
From: Andreas Rheinhardt @ 2022-07-31 9:41 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
The msmpeg4 decoders/encoders share a common set of prerequisites,
ergo it makes sense to use common subsystems for them. This also
allows to remove the CONFIG_MSMPEG4_DECODER/ENCODER ad-hoc defines
(which violated the CONFIG_ namespace).
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
configure | 24 ++++++++++++++----------
libavcodec/Makefile | 16 ++++------------
libavcodec/h263dec.c | 4 ++--
libavcodec/mpegvideo_enc.c | 8 ++++----
libavcodec/msmpeg4dec.h | 8 --------
libavcodec/msmpeg4enc.h | 6 ------
libavformat/protocols.c | 1 +
7 files changed, 25 insertions(+), 42 deletions(-)
diff --git a/configure b/configure
index ff075fb950..159d3574ef 100755
--- a/configure
+++ b/configure
@@ -2490,6 +2490,8 @@ CONFIG_EXTRA="
mpegvideo
mpegvideodec
mpegvideoenc
+ msmpeg4dec
+ msmpeg4enc
mss34dsp
pixblockdsp
qpeldsp
@@ -2744,6 +2746,8 @@ mpegaudiodsp_select="dct"
mpegvideo_select="blockdsp h264chroma hpeldsp idctdsp videodsp"
mpegvideodec_select="mpegvideo mpeg_er"
mpegvideoenc_select="aandcttables me_cmp mpegvideo pixblockdsp qpeldsp"
+msmpeg4dec_select="h263_decoder"
+msmpeg4enc_select="h263_encoder"
vc1dsp_select="h264chroma qpeldsp startcode"
rdft_select="fft"
@@ -2893,11 +2897,11 @@ mpeg4_decoder_select="h263_decoder mpeg4video_parser"
mpeg4_encoder_select="h263_encoder"
msa1_decoder_select="mss34dsp"
mscc_decoder_select="inflate_wrapper"
-msmpeg4v1_decoder_select="h263_decoder"
-msmpeg4v2_decoder_select="h263_decoder"
-msmpeg4v2_encoder_select="h263_encoder"
-msmpeg4v3_decoder_select="h263_decoder"
-msmpeg4v3_encoder_select="h263_encoder"
+msmpeg4v1_decoder_select="msmpeg4dec"
+msmpeg4v2_decoder_select="msmpeg4dec"
+msmpeg4v2_encoder_select="msmpeg4enc"
+msmpeg4v3_decoder_select="msmpeg4dec"
+msmpeg4v3_encoder_select="msmpeg4enc"
mss2_decoder_select="mpegvideodec qpeldsp vc1_decoder"
mts2_decoder_select="jpegtables mss34dsp"
mv30_decoder_select="aandcttables blockdsp"
@@ -2968,7 +2972,7 @@ utvideo_encoder_select="bswapdsp huffman llvidencdsp"
vble_decoder_select="llviddsp"
vbn_decoder_select="texturedsp"
vbn_encoder_select="texturedspenc"
-vc1_decoder_select="blockdsp h263_decoder h264qpel intrax8 mpegvideodec vc1dsp"
+vc1_decoder_select="blockdsp h264qpel intrax8 mpegvideodec msmpeg4dec vc1dsp"
vc1image_decoder_select="vc1_decoder"
vorbis_decoder_select="mdct"
vorbis_encoder_select="audio_frame_queue mdct"
@@ -2990,10 +2994,10 @@ wmav1_encoder_select="mdct sinewin wma_freqs"
wmav2_decoder_select="mdct sinewin wma_freqs"
wmav2_encoder_select="mdct sinewin wma_freqs"
wmavoice_decoder_select="lsp rdft dct mdct sinewin"
-wmv1_decoder_select="h263_decoder"
-wmv1_encoder_select="h263_encoder"
-wmv2_decoder_select="blockdsp error_resilience h263_decoder idctdsp intrax8 videodsp wmv2dsp"
-wmv2_encoder_select="h263_encoder wmv2dsp"
+wmv1_decoder_select="msmpeg4dec"
+wmv1_encoder_select="msmpeg4enc"
+wmv2_decoder_select="blockdsp error_resilience idctdsp intrax8 msmpeg4dec videodsp wmv2dsp"
+wmv2_encoder_select="msmpeg4enc wmv2dsp"
wmv3_decoder_select="vc1_decoder"
wmv3image_decoder_select="wmv3_decoder"
xma1_decoder_select="wmapro_decoder"
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index a6311411d3..33b913c4fc 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -141,6 +141,8 @@ OBJS-$(CONFIG_MPEGVIDEODEC) += mpegvideo_dec.o mpegutils.o
OBJS-$(CONFIG_MPEGVIDEOENC) += mpegvideo_enc.o mpeg12data.o \
motion_est.o ratecontrol.o \
mpegvideoencdsp.o
+OBJS-$(CONFIG_MSMPEG4DEC) += msmpeg4dec.o msmpeg4.o msmpeg4data.o
+OBJS-$(CONFIG_MSMPEG4DEC) += msmpeg4enc.o msmpeg4.o msmpeg4data.o
OBJS-$(CONFIG_MSS34DSP) += mss34dsp.o
OBJS-$(CONFIG_PIXBLOCKDSP) += pixblockdsp.o
OBJS-$(CONFIG_QPELDSP) += qpeldsp.o
@@ -527,11 +529,6 @@ OBJS-$(CONFIG_MPEG4_V4L2M2M_ENCODER) += v4l2_m2m_enc.o
OBJS-$(CONFIG_MPL2_DECODER) += mpl2dec.o ass.o
OBJS-$(CONFIG_MSA1_DECODER) += mss3.o
OBJS-$(CONFIG_MSCC_DECODER) += mscc.o
-OBJS-$(CONFIG_MSMPEG4V1_DECODER) += msmpeg4dec.o msmpeg4.o msmpeg4data.o
-OBJS-$(CONFIG_MSMPEG4V2_DECODER) += msmpeg4dec.o msmpeg4.o msmpeg4data.o
-OBJS-$(CONFIG_MSMPEG4V2_ENCODER) += msmpeg4enc.o msmpeg4.o msmpeg4data.o
-OBJS-$(CONFIG_MSMPEG4V3_DECODER) += msmpeg4dec.o msmpeg4.o msmpeg4data.o
-OBJS-$(CONFIG_MSMPEG4V3_ENCODER) += msmpeg4enc.o msmpeg4.o msmpeg4data.o
OBJS-$(CONFIG_MSNSIREN_DECODER) += siren.o
OBJS-$(CONFIG_MSP2_DECODER) += msp2dec.o
OBJS-$(CONFIG_MSRLE_DECODER) += msrle.o msrledec.o
@@ -722,7 +719,6 @@ OBJS-$(CONFIG_VBN_ENCODER) += vbnenc.o
OBJS-$(CONFIG_VBLE_DECODER) += vble.o
OBJS-$(CONFIG_VC1_DECODER) += vc1dec.o vc1_block.o vc1_loopfilter.o \
vc1_mc.o vc1_pred.o vc1.o vc1data.o \
- msmpeg4dec.o msmpeg4.o msmpeg4data.o \
wmv2data.o
OBJS-$(CONFIG_VC1_CUVID_DECODER) += cuviddec.o
OBJS-$(CONFIG_VC1_MMAL_DECODER) += mmaldec.o
@@ -776,12 +772,8 @@ OBJS-$(CONFIG_WMAV2_ENCODER) += wmaenc.o wma.o wma_common.o aactab.o
OBJS-$(CONFIG_WMAVOICE_DECODER) += wmavoice.o \
celp_filters.o \
acelp_vectors.o acelp_filters.o
-OBJS-$(CONFIG_WMV1_DECODER) += msmpeg4dec.o msmpeg4.o msmpeg4data.o
-OBJS-$(CONFIG_WMV1_ENCODER) += msmpeg4enc.o msmpeg4.o msmpeg4data.o
-OBJS-$(CONFIG_WMV2_DECODER) += wmv2dec.o wmv2.o wmv2data.o \
- msmpeg4dec.o msmpeg4.o msmpeg4data.o
-OBJS-$(CONFIG_WMV2_ENCODER) += wmv2enc.o wmv2.o wmv2data.o \
- msmpeg4.o msmpeg4enc.o msmpeg4data.o
+OBJS-$(CONFIG_WMV2_DECODER) += wmv2dec.o wmv2.o wmv2data.o
+OBJS-$(CONFIG_WMV2_ENCODER) += wmv2enc.o wmv2.o wmv2data.o
OBJS-$(CONFIG_WNV1_DECODER) += wnv1.o
OBJS-$(CONFIG_WRAPPED_AVFRAME_DECODER) += wrapped_avframe.o
OBJS-$(CONFIG_WRAPPED_AVFRAME_ENCODER) += wrapped_avframe.o
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index b4f9fa5022..8db0eccd89 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -502,7 +502,7 @@ retry:
/* let's go :-) */
if (CONFIG_WMV2_DECODER && s->msmpeg4_version == 5) {
ret = ff_wmv2_decode_picture_header(s);
- } else if (CONFIG_MSMPEG4_DECODER && s->msmpeg4_version) {
+ } else if (CONFIG_MSMPEG4DEC && s->msmpeg4_version) {
ret = ff_msmpeg4_decode_picture_header(s);
} else if (CONFIG_MPEG4_DECODER && avctx->codec_id == AV_CODEC_ID_MPEG4) {
if (s->avctx->extradata_size && s->picture_number == 0) {
@@ -666,7 +666,7 @@ retry:
if (s->msmpeg4_version && s->msmpeg4_version < 4 &&
s->pict_type == AV_PICTURE_TYPE_I)
- if (!CONFIG_MSMPEG4_DECODER ||
+ if (!CONFIG_MSMPEG4DEC ||
ff_msmpeg4_decode_ext_header(s, buf_size) < 0)
s->er.error_status_table[s->mb_num - 1] = ER_MB_ERROR;
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 86a9b55078..bc41019408 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -852,7 +852,7 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
ff_mpeg1_encode_init(s);
} else if (CONFIG_H263_ENCODER && s->out_format == FMT_H263) {
ff_h263_encode_init(s);
- if (CONFIG_MSMPEG4_ENCODER && s->msmpeg4_version)
+ if (CONFIG_MSMPEG4ENC && s->msmpeg4_version)
ff_msmpeg4_encode_init(s);
}
@@ -2372,7 +2372,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s,
case AV_CODEC_ID_MSMPEG4V2:
case AV_CODEC_ID_MSMPEG4V3:
case AV_CODEC_ID_WMV1:
- if (CONFIG_MSMPEG4_ENCODER)
+ if (CONFIG_MSMPEG4ENC)
ff_msmpeg4_encode_mb(s, s->block, motion_x, motion_y);
break;
case AV_CODEC_ID_WMV2:
@@ -3381,7 +3381,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
}
//not beautiful here but we must write it before flushing so it has to be here
- if (CONFIG_MSMPEG4_ENCODER && s->msmpeg4_version && s->msmpeg4_version<4 && s->pict_type == AV_PICTURE_TYPE_I)
+ if (CONFIG_MSMPEG4ENC && s->msmpeg4_version && s->msmpeg4_version<4 && s->pict_type == AV_PICTURE_TYPE_I)
ff_msmpeg4_encode_ext_header(s);
write_slice_end(s);
@@ -3716,7 +3716,7 @@ static int encode_picture(MpegEncContext *s, int picture_number)
case FMT_H263:
if (CONFIG_WMV2_ENCODER && s->codec_id == AV_CODEC_ID_WMV2)
ff_wmv2_encode_picture_header(s, picture_number);
- else if (CONFIG_MSMPEG4_ENCODER && s->msmpeg4_version)
+ else if (CONFIG_MSMPEG4ENC && s->msmpeg4_version)
ff_msmpeg4_encode_picture_header(s, picture_number);
else if (CONFIG_MPEG4_ENCODER && s->h263_pred) {
ret = ff_mpeg4_encode_picture_header(s, picture_number);
diff --git a/libavcodec/msmpeg4dec.h b/libavcodec/msmpeg4dec.h
index af2591caf5..19b5c12c6c 100644
--- a/libavcodec/msmpeg4dec.h
+++ b/libavcodec/msmpeg4dec.h
@@ -22,7 +22,6 @@
#ifndef AVCODEC_MSMPEG4DEC_H
#define AVCODEC_MSMPEG4DEC_H
-#include "config.h"
#include "avcodec.h"
#include "mpegvideo.h"
@@ -40,11 +39,4 @@ void ff_msmpeg4_decode_motion(MpegEncContext * s, int *mx_ptr, int *my_ptr);
int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * block,
int n, int coded, const uint8_t *scan_table);
-#define CONFIG_MSMPEG4_DECODER (CONFIG_MSMPEG4V1_DECODER || \
- CONFIG_MSMPEG4V2_DECODER || \
- CONFIG_MSMPEG4V3_DECODER || \
- CONFIG_WMV1_DECODER || \
- CONFIG_WMV2_DECODER || \
- CONFIG_VC1_DECODER)
-
#endif
diff --git a/libavcodec/msmpeg4enc.h b/libavcodec/msmpeg4enc.h
index 98044913b1..602e60112d 100644
--- a/libavcodec/msmpeg4enc.h
+++ b/libavcodec/msmpeg4enc.h
@@ -22,7 +22,6 @@
#ifndef AVCODEC_MSMPEG4ENC_H
#define AVCODEC_MSMPEG4ENC_H
-#include "config.h"
#include "mpegvideo.h"
#include "put_bits.h"
#include "rl.h"
@@ -45,9 +44,4 @@ void ff_msmpeg4_encode_motion(MpegEncContext * s, int mx, int my);
void ff_msmpeg4_code012(PutBitContext *pb, int n);
-#define CONFIG_MSMPEG4_ENCODER (CONFIG_MSMPEG4V2_ENCODER || \
- CONFIG_MSMPEG4V3_ENCODER || \
- CONFIG_WMV1_ENCODER || \
- CONFIG_WMV2_ENCODER)
-
#endif
diff --git a/libavformat/protocols.c b/libavformat/protocols.c
index 6ee62a598a..8b7d1b940f 100644
--- a/libavformat/protocols.c
+++ b/libavformat/protocols.c
@@ -17,6 +17,7 @@
*/
#include "libavutil/avstring.h"
+#include "libavutil/log.h"
#include "libavutil/mem.h"
#include "url.h"
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [FFmpeg-devel] [PATCH 3/4] configure: Add msmpeg4(dec|enc) subsystems
2022-07-31 9:41 ` [FFmpeg-devel] [PATCH 3/4] configure: Add msmpeg4(dec|enc) subsystems Andreas Rheinhardt
@ 2022-07-31 10:06 ` Martin Storsjö
2022-07-31 18:33 ` Andreas Rheinhardt
0 siblings, 1 reply; 7+ messages in thread
From: Martin Storsjö @ 2022-07-31 10:06 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: Andreas Rheinhardt
On Sun, 31 Jul 2022, Andreas Rheinhardt wrote:
> The msmpeg4 decoders/encoders share a common set of prerequisites,
> ergo it makes sense to use common subsystems for them. This also
> allows to remove the CONFIG_MSMPEG4_DECODER/ENCODER ad-hoc defines
> (which violated the CONFIG_ namespace).
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> configure | 24 ++++++++++++++----------
> libavcodec/Makefile | 16 ++++------------
> libavcodec/h263dec.c | 4 ++--
> libavcodec/mpegvideo_enc.c | 8 ++++----
> libavcodec/msmpeg4dec.h | 8 --------
> libavcodec/msmpeg4enc.h | 6 ------
> libavformat/protocols.c | 1 +
> 7 files changed, 25 insertions(+), 42 deletions(-)
> diff --git a/libavcodec/Makefile b/libavcodec/Makefile
> index a6311411d3..33b913c4fc 100644
> --- a/libavcodec/Makefile
> +++ b/libavcodec/Makefile
> @@ -141,6 +141,8 @@ OBJS-$(CONFIG_MPEGVIDEODEC) += mpegvideo_dec.o mpegutils.o
> OBJS-$(CONFIG_MPEGVIDEOENC) += mpegvideo_enc.o mpeg12data.o \
> motion_est.o ratecontrol.o \
> mpegvideoencdsp.o
> +OBJS-$(CONFIG_MSMPEG4DEC) += msmpeg4dec.o msmpeg4.o msmpeg4data.o
> +OBJS-$(CONFIG_MSMPEG4DEC) += msmpeg4enc.o msmpeg4.o msmpeg4data.o
Typo on the second line, should be CONFIG_MSMPEG4ENC?
// Martin
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [FFmpeg-devel] [PATCH 3/4] configure: Add msmpeg4(dec|enc) subsystems
2022-07-31 10:06 ` Martin Storsjö
@ 2022-07-31 18:33 ` Andreas Rheinhardt
0 siblings, 0 replies; 7+ messages in thread
From: Andreas Rheinhardt @ 2022-07-31 18:33 UTC (permalink / raw)
To: Martin Storsjö, FFmpeg development discussions and patches
Martin Storsjö:
> On Sun, 31 Jul 2022, Andreas Rheinhardt wrote:
>
>> The msmpeg4 decoders/encoders share a common set of prerequisites,
>> ergo it makes sense to use common subsystems for them. This also
>> allows to remove the CONFIG_MSMPEG4_DECODER/ENCODER ad-hoc defines
>> (which violated the CONFIG_ namespace).
>>
>> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
>> ---
>> configure | 24 ++++++++++++++----------
>> libavcodec/Makefile | 16 ++++------------
>> libavcodec/h263dec.c | 4 ++--
>> libavcodec/mpegvideo_enc.c | 8 ++++----
>> libavcodec/msmpeg4dec.h | 8 --------
>> libavcodec/msmpeg4enc.h | 6 ------
>> libavformat/protocols.c | 1 +
>> 7 files changed, 25 insertions(+), 42 deletions(-)
>
>> diff --git a/libavcodec/Makefile b/libavcodec/Makefile
>> index a6311411d3..33b913c4fc 100644
>> --- a/libavcodec/Makefile
>> +++ b/libavcodec/Makefile
>> @@ -141,6 +141,8 @@ OBJS-$(CONFIG_MPEGVIDEODEC) +=
>> mpegvideo_dec.o mpegutils.o
>> OBJS-$(CONFIG_MPEGVIDEOENC) += mpegvideo_enc.o mpeg12data.o \
>> motion_est.o ratecontrol.o \
>> mpegvideoencdsp.o
>> +OBJS-$(CONFIG_MSMPEG4DEC) += msmpeg4dec.o msmpeg4.o
>> msmpeg4data.o
>> +OBJS-$(CONFIG_MSMPEG4DEC) += msmpeg4enc.o msmpeg4.o
>> msmpeg4data.o
>
> Typo on the second line, should be CONFIG_MSMPEG4ENC?
>
> // Martin
>
Thanks for spotting this. Fixed it locally.
(Using static builds can hide compilation issues (namely if one adds an
unnecessary OBJS if said object's dependencies are not met: in this case
the unnecessary object file will just be ignored) and therefore I tested
this with a shared build by compiling libavcodec.so. Which worked,
because libavcodec.so just treated the unknown encoder as external. I
should have (and now have) compiled the whole of ffmpeg. Sorry.)
- Andreas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 7+ messages in thread
* [FFmpeg-devel] [PATCH 4/4] avcodec/intrax8: Avoid indirection when accessing VLC table
2022-07-31 9:37 [FFmpeg-devel] [PATCH 1/4] avcodec/intrax8: Remove unused IDCTDSPContext Andreas Rheinhardt
2022-07-31 9:41 ` [FFmpeg-devel] [PATCH 2/4] configure, avcodec/Makefile: Make IntraX8 select WMV2DSP, fix MIPS build Andreas Rheinhardt
2022-07-31 9:41 ` [FFmpeg-devel] [PATCH 3/4] configure: Add msmpeg4(dec|enc) subsystems Andreas Rheinhardt
@ 2022-07-31 9:41 ` Andreas Rheinhardt
2022-08-03 5:11 ` [FFmpeg-devel] [PATCH 1/4] avcodec/intrax8: Remove unused IDCTDSPContext Andreas Rheinhardt
3 siblings, 0 replies; 7+ messages in thread
From: Andreas Rheinhardt @ 2022-07-31 9:41 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
To do so, store the pointer to the VLC table and not to the VLC.
This is possible, because all the VLCs of the same type use
the same number of bits.
Also use a const VLCElem*, because the target is static and must
therefore not be modified after its initialization.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/intrax8.c | 24 ++++++++++++------------
libavcodec/intrax8.h | 6 +++---
2 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/libavcodec/intrax8.c b/libavcodec/intrax8.c
index b99e8590b1..e82cb8680e 100644
--- a/libavcodec/intrax8.c
+++ b/libavcodec/intrax8.c
@@ -91,9 +91,9 @@ static av_cold void x8_vlc_init(void)
static void x8_reset_vlc_tables(IntraX8Context *w)
{
- memset(w->j_dc_vlc, 0, sizeof(w->j_dc_vlc));
- memset(w->j_ac_vlc, 0, sizeof(w->j_ac_vlc));
- w->j_orient_vlc = NULL;
+ memset(w->j_dc_vlc_table, 0, sizeof(w->j_dc_vlc_table));
+ memset(w->j_ac_vlc_table, 0, sizeof(w->j_ac_vlc_table));
+ w->j_orient_vlc_table = NULL;
}
static inline void x8_select_ac_table(IntraX8Context *const w, int mode)
@@ -102,23 +102,23 @@ static inline void x8_select_ac_table(IntraX8Context *const w, int mode)
av_assert2(mode < 4);
- if (w->j_ac_vlc[mode])
+ if (w->j_ac_vlc_table[mode])
return;
table_index = get_bits(w->gb, 3);
// 2 modes use same tables
- w->j_ac_vlc[mode] = &j_ac_vlc[w->quant < 13][mode >> 1][table_index];
+ w->j_ac_vlc_table[mode] = j_ac_vlc[w->quant < 13][mode >> 1][table_index].table;
av_assert2(w->j_ac_vlc[mode]);
}
static inline int x8_get_orient_vlc(IntraX8Context *w)
{
- if (!w->j_orient_vlc) {
+ if (!w->j_orient_vlc_table) {
int table_index = get_bits(w->gb, 1 + (w->quant < 13));
- w->j_orient_vlc = &j_orient_vlc[w->quant < 13][table_index];
+ w->j_orient_vlc_table = j_orient_vlc[w->quant < 13][table_index].table;
}
- return get_vlc2(w->gb, w->j_orient_vlc->table, OR_VLC_BITS, OR_VLC_MTD);
+ return get_vlc2(w->gb, w->j_orient_vlc_table, OR_VLC_BITS, OR_VLC_MTD);
}
#define extra_bits(eb) (eb) // 3 bits
@@ -174,7 +174,7 @@ static void x8_get_ac_rlf(IntraX8Context *const w, const int mode,
int i, e;
// x8_select_ac_table(w, mode);
- i = get_vlc2(w->gb, w->j_ac_vlc[mode]->table, AC_VLC_BITS, AC_VLC_MTD);
+ i = get_vlc2(w->gb, w->j_ac_vlc_table[mode], AC_VLC_BITS, AC_VLC_MTD);
if (i < 46) { // [0-45]
int t, l;
@@ -254,13 +254,13 @@ static int x8_get_dc_rlf(IntraX8Context *const w, const int mode,
int i, e, c;
av_assert2(mode < 3);
- if (!w->j_dc_vlc[mode]) {
+ if (!w->j_dc_vlc_table[mode]) {
int table_index = get_bits(w->gb, 3);
// 4 modes, same table
- w->j_dc_vlc[mode] = &j_dc_vlc[w->quant < 13][table_index];
+ w->j_dc_vlc_table[mode] = j_dc_vlc[w->quant < 13][table_index].table;
}
- i = get_vlc2(w->gb, w->j_dc_vlc[mode]->table, DC_VLC_BITS, DC_VLC_MTD);
+ i = get_vlc2(w->gb, w->j_dc_vlc_table[mode], DC_VLC_BITS, DC_VLC_MTD);
/* (i >= 17) { i -= 17; final =1; } */
c = i > 16;
diff --git a/libavcodec/intrax8.h b/libavcodec/intrax8.h
index 3ebbf73434..c994b14abe 100644
--- a/libavcodec/intrax8.h
+++ b/libavcodec/intrax8.h
@@ -27,9 +27,9 @@
#include "mpegpicture.h"
typedef struct IntraX8Context {
- VLC *j_ac_vlc[4]; // they point to the static j_mb_vlc
- VLC *j_orient_vlc;
- VLC *j_dc_vlc[3];
+ const VLCElem *j_ac_vlc_table[4]; // they point to the static j_mb_vlc
+ const VLCElem *j_orient_vlc_table;
+ const VLCElem *j_dc_vlc_table[3];
int use_quant_matrix;
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [FFmpeg-devel] [PATCH 1/4] avcodec/intrax8: Remove unused IDCTDSPContext
2022-07-31 9:37 [FFmpeg-devel] [PATCH 1/4] avcodec/intrax8: Remove unused IDCTDSPContext Andreas Rheinhardt
` (2 preceding siblings ...)
2022-07-31 9:41 ` [FFmpeg-devel] [PATCH 4/4] avcodec/intrax8: Avoid indirection when accessing VLC table Andreas Rheinhardt
@ 2022-08-03 5:11 ` Andreas Rheinhardt
3 siblings, 0 replies; 7+ messages in thread
From: Andreas Rheinhardt @ 2022-08-03 5:11 UTC (permalink / raw)
To: ffmpeg-devel
Andreas Rheinhardt:
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> configure | 2 +-
> libavcodec/intrax8.c | 4 +---
> libavcodec/intrax8.h | 3 +--
> libavcodec/vc1dec.c | 2 +-
> libavcodec/wmv2dec.c | 2 +-
> 5 files changed, 5 insertions(+), 8 deletions(-)
>
> diff --git a/configure b/configure
> index 8c7e8c9d1d..974768a663 100755
> --- a/configure
> +++ b/configure
> @@ -2733,7 +2733,7 @@ h264dsp_select="startcode"
> hevcparse_select="atsc_a53 golomb"
> frame_thread_encoder_deps="encoders threads"
> inflate_wrapper_deps="zlib"
> -intrax8_select="blockdsp idctdsp"
> +intrax8_select="blockdsp"
> iso_media_select="mpeg4audio"
> mdct_select="fft"
> mdct15_select="fft"
> diff --git a/libavcodec/intrax8.c b/libavcodec/intrax8.c
> index 73b8aeea78..b99e8590b1 100644
> --- a/libavcodec/intrax8.c
> +++ b/libavcodec/intrax8.c
> @@ -25,7 +25,6 @@
> #include "libavutil/thread.h"
> #include "avcodec.h"
> #include "get_bits.h"
> -#include "idctdsp.h"
> #include "msmpeg4data.h"
> #include "intrax8huf.h"
> #include "intrax8.h"
> @@ -692,7 +691,7 @@ static void x8_init_block_index(IntraX8Context *w, AVFrame *frame)
> }
>
> av_cold int ff_intrax8_common_init(AVCodecContext *avctx,
> - IntraX8Context *w, IDCTDSPContext *idsp,
> + IntraX8Context *w,
> int16_t (*block)[64],
> int block_last_index[12],
> int mb_width, int mb_height)
> @@ -700,7 +699,6 @@ av_cold int ff_intrax8_common_init(AVCodecContext *avctx,
> static AVOnce init_static_once = AV_ONCE_INIT;
>
> w->avctx = avctx;
> - w->idsp = *idsp;
> w->mb_width = mb_width;
> w->mb_height = mb_height;
> w->block = block;
> diff --git a/libavcodec/intrax8.h b/libavcodec/intrax8.h
> index 5b8946ea25..3ebbf73434 100644
> --- a/libavcodec/intrax8.h
> +++ b/libavcodec/intrax8.h
> @@ -44,7 +44,6 @@ typedef struct IntraX8Context {
>
> // set by the caller codec
> IntraX8DSPContext dsp;
> - IDCTDSPContext idsp;
> BlockDSPContext bdsp;
> int quant;
> int dquant;
> @@ -86,7 +85,7 @@ typedef struct IntraX8Context {
> * @return 0 on success, a negative AVERROR value on error
> */
> int ff_intrax8_common_init(AVCodecContext *avctx,
> - IntraX8Context *w, IDCTDSPContext *idsp,
> + IntraX8Context *w,
> int16_t (*block)[64],
> int block_last_index[12],
> int mb_width, int mb_height);
> diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
> index 5c5b31ad32..b53490b3ab 100644
> --- a/libavcodec/vc1dec.c
> +++ b/libavcodec/vc1dec.c
> @@ -391,7 +391,7 @@ av_cold int ff_vc1_decode_init_alloc_tables(VC1Context *v)
> goto error;
> }
>
> - ret = ff_intrax8_common_init(s->avctx, &v->x8, &s->idsp,
> + ret = ff_intrax8_common_init(s->avctx, &v->x8,
> s->block, s->block_last_index,
> s->mb_width, s->mb_height);
> if (ret < 0)
> diff --git a/libavcodec/wmv2dec.c b/libavcodec/wmv2dec.c
> index e61b549439..6d9b72d123 100644
> --- a/libavcodec/wmv2dec.c
> +++ b/libavcodec/wmv2dec.c
> @@ -578,7 +578,7 @@ static av_cold int wmv2_decode_init(AVCodecContext *avctx)
> ff_init_scantable(s->idsp.idct_permutation, &w->abt_scantable[1],
> ff_wmv2_scantableB);
>
> - return ff_intrax8_common_init(avctx, &w->x8, &w->s.idsp,
> + return ff_intrax8_common_init(avctx, &w->x8,
> w->s.block, w->s.block_last_index,
> w->s.mb_width, w->s.mb_height);
> }
Will apply this patchset tonight unless there are objections.
- Andreas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 7+ messages in thread