* [FFmpeg-devel] [PATCH 2/2] configure: Remove unnecessary mpeg[12]video_enc->h263dsp dependencies
2022-10-24 2:21 [FFmpeg-devel] [PATCH 1/2] avcodec/mpegvideo: Don't initialize H264Chroma ctx unnecessarily Andreas Rheinhardt
@ 2022-10-24 2:22 ` Andreas Rheinhardt
2022-10-26 2:01 ` [FFmpeg-devel] [PATCH 3/7] avcodec/mpegvideo: Don't overallocate buffer Andreas Rheinhardt
` (5 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Andreas Rheinhardt @ 2022-10-24 2:22 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
This effectively reverts 9b78abae19aa18e8427848f4d4367da3822ed627.
The underlying issue has been fixed properly in commit
cff480e49d73640c980922626e57c9889bb4b18d.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
configure | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index dd207769a2..cd339bc525 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"
--
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] 9+ messages in thread
* [FFmpeg-devel] [PATCH 3/7] avcodec/mpegvideo: Don't overallocate buffer
2022-10-24 2:21 [FFmpeg-devel] [PATCH 1/2] avcodec/mpegvideo: Don't initialize H264Chroma ctx unnecessarily Andreas Rheinhardt
2022-10-24 2:22 ` [FFmpeg-devel] [PATCH 2/2] configure: Remove unnecessary mpeg[12]video_enc->h263dsp dependencies Andreas Rheinhardt
@ 2022-10-26 2:01 ` Andreas Rheinhardt
2022-10-28 13:53 ` Andreas Rheinhardt
2022-10-26 2:01 ` [FFmpeg-devel] [PATCH 4/7] avcodec/mpegvideo: Allocate map and score_map buffers jointly Andreas Rheinhardt
` (4 subsequent siblings)
6 siblings, 1 reply; 9+ messages in thread
From: Andreas Rheinhardt @ 2022-10-26 2:01 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Only encoders need two sets of int16_t [12][64]
(one to save the current best state and one for the current
working state); decoders need only one. This saves 1.5KiB
per slice context for a decoder.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/mpegvideo.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 697438fa6f..0cd7c86ff6 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -382,7 +382,7 @@ static int init_duplicate_context(MpegEncContext *s)
return AVERROR(ENOMEM);
}
}
- if (!FF_ALLOCZ_TYPED_ARRAY(s->blocks, 2))
+ if (!FF_ALLOCZ_TYPED_ARRAY(s->blocks, 1 + s->encoding))
return AVERROR(ENOMEM);
s->block = s->blocks[0];
--
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] 9+ messages in thread
* Re: [FFmpeg-devel] [PATCH 3/7] avcodec/mpegvideo: Don't overallocate buffer
2022-10-26 2:01 ` [FFmpeg-devel] [PATCH 3/7] avcodec/mpegvideo: Don't overallocate buffer Andreas Rheinhardt
@ 2022-10-28 13:53 ` Andreas Rheinhardt
0 siblings, 0 replies; 9+ messages in thread
From: Andreas Rheinhardt @ 2022-10-28 13:53 UTC (permalink / raw)
To: ffmpeg-devel
Andreas Rheinhardt:
> Only encoders need two sets of int16_t [12][64]
> (one to save the current best state and one for the current
> working state); decoders need only one. This saves 1.5KiB
> per slice context for a decoder.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> libavcodec/mpegvideo.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
> index 697438fa6f..0cd7c86ff6 100644
> --- a/libavcodec/mpegvideo.c
> +++ b/libavcodec/mpegvideo.c
> @@ -382,7 +382,7 @@ static int init_duplicate_context(MpegEncContext *s)
> return AVERROR(ENOMEM);
> }
> }
> - if (!FF_ALLOCZ_TYPED_ARRAY(s->blocks, 2))
> + if (!FF_ALLOCZ_TYPED_ARRAY(s->blocks, 1 + s->encoding))
> return AVERROR(ENOMEM);
> s->block = s->blocks[0];
>
Will apply the rest of this patchset tomorrow 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] 9+ messages in thread
* [FFmpeg-devel] [PATCH 4/7] avcodec/mpegvideo: Allocate map and score_map buffers jointly
2022-10-24 2:21 [FFmpeg-devel] [PATCH 1/2] avcodec/mpegvideo: Don't initialize H264Chroma ctx unnecessarily Andreas Rheinhardt
2022-10-24 2:22 ` [FFmpeg-devel] [PATCH 2/2] configure: Remove unnecessary mpeg[12]video_enc->h263dsp dependencies Andreas Rheinhardt
2022-10-26 2:01 ` [FFmpeg-devel] [PATCH 3/7] avcodec/mpegvideo: Don't overallocate buffer Andreas Rheinhardt
@ 2022-10-26 2:01 ` Andreas Rheinhardt
2022-10-26 2:01 ` [FFmpeg-devel] [PATCH 5/7] avcodec/msmpeg4dec: Move setting decode_mb for WMV2 to wmv2dec.c Andreas Rheinhardt
` (3 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Andreas Rheinhardt @ 2022-10-26 2:01 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Reduces the amounts of allocs, frees and allocation checks.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/mpegvideo.c | 7 ++++---
libavcodec/snow.c | 1 -
libavcodec/snowenc.c | 6 +++---
libavcodec/svq1enc.c | 8 +++-----
4 files changed, 10 insertions(+), 12 deletions(-)
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 0cd7c86ff6..a04d519ccc 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -373,9 +373,10 @@ static int init_duplicate_context(MpegEncContext *s)
yc_size += 2*s->b8_stride + 2*s->mb_stride;
if (s->encoding) {
- if (!FF_ALLOCZ_TYPED_ARRAY(s->me.map, ME_MAP_SIZE) ||
- !FF_ALLOCZ_TYPED_ARRAY(s->me.score_map, ME_MAP_SIZE))
+ s->me.map = av_mallocz(2 * ME_MAP_SIZE * sizeof(*s->me.map));
+ if (!s->me.map)
return AVERROR(ENOMEM);
+ s->me.score_map = s->me.map + ME_MAP_SIZE;
if (s->noise_reduction) {
if (!FF_ALLOCZ_TYPED_ARRAY(s->dct_error_sum, 2))
@@ -445,7 +446,7 @@ static void free_duplicate_context(MpegEncContext *s)
av_freep(&s->dct_error_sum);
av_freep(&s->me.map);
- av_freep(&s->me.score_map);
+ s->me.score_map = NULL;
av_freep(&s->blocks);
av_freep(&s->ac_val_base);
s->block = NULL;
diff --git a/libavcodec/snow.c b/libavcodec/snow.c
index cde09902c3..b6c8d5e256 100644
--- a/libavcodec/snow.c
+++ b/libavcodec/snow.c
@@ -635,7 +635,6 @@ av_cold void ff_snow_common_end(SnowContext *s)
s->m.me.temp= NULL;
av_freep(&s->m.me.scratchpad);
av_freep(&s->m.me.map);
- av_freep(&s->m.me.score_map);
av_freep(&s->m.sc.obmc_scratchpad);
av_freep(&s->block);
diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c
index ada24f7895..7fad95b69a 100644
--- a/libavcodec/snowenc.c
+++ b/libavcodec/snowenc.c
@@ -82,11 +82,11 @@ static av_cold int encode_init(AVCodecContext *avctx)
s->m.me.temp =
s->m.me.scratchpad = av_calloc(avctx->width + 64, 2*16*2*sizeof(uint8_t));
- s->m.me.map = av_mallocz(ME_MAP_SIZE*sizeof(uint32_t));
- s->m.me.score_map = av_mallocz(ME_MAP_SIZE*sizeof(uint32_t));
s->m.sc.obmc_scratchpad= av_mallocz(MB_SIZE*MB_SIZE*12*sizeof(uint32_t));
- if (!s->m.me.scratchpad || !s->m.me.map || !s->m.me.score_map || !s->m.sc.obmc_scratchpad)
+ s->m.me.map = av_mallocz(2 * ME_MAP_SIZE * sizeof(*s->m.me.map));
+ if (!s->m.me.scratchpad || !s->m.me.map || !s->m.sc.obmc_scratchpad)
return AVERROR(ENOMEM);
+ s->m.me.score_map = s->m.me.map + ME_MAP_SIZE;
ff_h263_encode_init(&s->m); //mv_penalty
diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c
index 7c9430a137..92f91aeebd 100644
--- a/libavcodec/svq1enc.c
+++ b/libavcodec/svq1enc.c
@@ -552,7 +552,6 @@ static av_cold int svq1_encode_end(AVCodecContext *avctx)
av_freep(&s->m.me.scratchpad);
av_freep(&s->m.me.map);
- av_freep(&s->m.me.score_map);
av_freep(&s->mb_type);
av_freep(&s->dummy);
av_freep(&s->scratchbuf);
@@ -608,18 +607,17 @@ static av_cold int svq1_encode_init(AVCodecContext *avctx)
s->m.me.temp =
s->m.me.scratchpad = av_mallocz((avctx->width + 64) *
2 * 16 * 2 * sizeof(uint8_t));
- s->m.me.map = av_mallocz(ME_MAP_SIZE * sizeof(uint32_t));
- s->m.me.score_map = av_mallocz(ME_MAP_SIZE * sizeof(uint32_t));
s->mb_type = av_mallocz((s->y_block_width + 1) *
s->y_block_height * sizeof(int16_t));
s->dummy = av_mallocz((s->y_block_width + 1) *
s->y_block_height * sizeof(int32_t));
+ s->m.me.map = av_mallocz(2 * ME_MAP_SIZE * sizeof(*s->m.me.map));
s->svq1encdsp.ssd_int8_vs_int16 = ssd_int8_vs_int16_c;
if (!s->m.me.temp || !s->m.me.scratchpad || !s->m.me.map ||
- !s->m.me.score_map || !s->mb_type || !s->dummy) {
+ !s->mb_type || !s->dummy)
return AVERROR(ENOMEM);
- }
+ s->m.me.score_map = s->m.me.map + ME_MAP_SIZE;
#if ARCH_PPC
ff_svq1enc_init_ppc(&s->svq1encdsp);
--
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] 9+ messages in thread
* [FFmpeg-devel] [PATCH 5/7] avcodec/msmpeg4dec: Move setting decode_mb for WMV2 to wmv2dec.c
2022-10-24 2:21 [FFmpeg-devel] [PATCH 1/2] avcodec/mpegvideo: Don't initialize H264Chroma ctx unnecessarily Andreas Rheinhardt
` (2 preceding siblings ...)
2022-10-26 2:01 ` [FFmpeg-devel] [PATCH 4/7] avcodec/mpegvideo: Allocate map and score_map buffers jointly Andreas Rheinhardt
@ 2022-10-26 2:01 ` Andreas Rheinhardt
2022-10-26 2:01 ` [FFmpeg-devel] [PATCH 6/7] avcodec/mpegvideo: Remove always-false check Andreas Rheinhardt
` (2 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Andreas Rheinhardt @ 2022-10-26 2:01 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
It avoids checks and allows to make ff_wmv2_decode_mb() static;
furthermore, it allows to avoid a config_components.h inclusion.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/msmpeg4dec.c | 6 +-----
libavcodec/wmv2dec.c | 4 +++-
libavcodec/wmv2dec.h | 1 -
3 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/libavcodec/msmpeg4dec.c b/libavcodec/msmpeg4dec.c
index 8e12e1aab2..bc554ed2eb 100644
--- a/libavcodec/msmpeg4dec.c
+++ b/libavcodec/msmpeg4dec.c
@@ -22,8 +22,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "config_components.h"
-
#include "libavutil/thread.h"
#include "avcodec.h"
@@ -38,7 +36,6 @@
#include "h263dec.h"
#include "mpeg4videodec.h"
#include "msmpeg4data.h"
-#include "wmv2dec.h"
#define DC_VLC_BITS 9
#define V2_INTRA_CBPC_VLC_BITS 3
@@ -391,8 +388,7 @@ av_cold int ff_msmpeg4_decode_init(AVCodecContext *avctx)
s->decode_mb= msmpeg4v34_decode_mb;
break;
case 5:
- if (CONFIG_WMV2_DECODER)
- s->decode_mb= ff_wmv2_decode_mb;
+ break;
case 6:
//FIXME + TODO VC1 decode mb
break;
diff --git a/libavcodec/wmv2dec.c b/libavcodec/wmv2dec.c
index a70913134c..2daf6c70e8 100644
--- a/libavcodec/wmv2dec.c
+++ b/libavcodec/wmv2dec.c
@@ -445,7 +445,7 @@ static inline int wmv2_decode_inter_block(WMV2DecContext *w, int16_t *block,
}
}
-int ff_wmv2_decode_mb(MpegEncContext *s, int16_t block[6][64])
+static int wmv2_decode_mb(MpegEncContext *s, int16_t block[6][64])
{
/* The following is only allowed because this encoder
* does not use slice threading. */
@@ -573,6 +573,8 @@ static av_cold int wmv2_decode_init(AVCodecContext *avctx)
if ((ret = ff_msmpeg4_decode_init(avctx)) < 0)
return ret;
+ s->decode_mb = wmv2_decode_mb;
+
ff_wmv2_common_init(s);
return ff_intrax8_common_init(avctx, &w->x8,
diff --git a/libavcodec/wmv2dec.h b/libavcodec/wmv2dec.h
index cc410afe17..bc8745bf6f 100644
--- a/libavcodec/wmv2dec.h
+++ b/libavcodec/wmv2dec.h
@@ -23,7 +23,6 @@
#include "mpegvideo.h"
-int ff_wmv2_decode_mb(MpegEncContext *s, int16_t block[6][64]);
int ff_wmv2_decode_picture_header(MpegEncContext * s);
int ff_wmv2_decode_secondary_picture_header(MpegEncContext * s);
void ff_wmv2_add_mb(MpegEncContext *s, int16_t block[6][64],
--
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] 9+ messages in thread
* [FFmpeg-devel] [PATCH 6/7] avcodec/mpegvideo: Remove always-false check
2022-10-24 2:21 [FFmpeg-devel] [PATCH 1/2] avcodec/mpegvideo: Don't initialize H264Chroma ctx unnecessarily Andreas Rheinhardt
` (3 preceding siblings ...)
2022-10-26 2:01 ` [FFmpeg-devel] [PATCH 5/7] avcodec/msmpeg4dec: Move setting decode_mb for WMV2 to wmv2dec.c Andreas Rheinhardt
@ 2022-10-26 2:01 ` Andreas Rheinhardt
2022-10-26 2:01 ` [FFmpeg-devel] [PATCH 7/7] avcodec/mpegvideo: Remove incorrect comment Andreas Rheinhardt
2022-10-26 23:33 ` [FFmpeg-devel] [PATCH 1/2] avcodec/mpegvideo: Don't initialize H264Chroma ctx unnecessarily Andreas Rheinhardt
6 siblings, 0 replies; 9+ messages in thread
From: Andreas Rheinhardt @ 2022-10-26 2:01 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
This basically reverts cc0380222add8df8ff9b3bd95eaf2b9d8c4c0d11.
At the time of said commit, cleanup on init failure was very
buggy. For codecs with the INIT_CLEANUP cap, the close function
could be called on error even before the private data has been
allocated; and when using frame threading the same could also
happen even without said flag. Some mpegvideo decoders were
affected by the latter.
Yet both of these issues have been fixed long ago, the latter
in commit e9b66175793e5c2af19beefe8e143f6e4901b5df. Therefore
the workaround in ff_mpv_common_end() can be removed.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/mpegvideo.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index a04d519ccc..99b2d8f6de 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -789,9 +789,6 @@ void ff_mpv_free_context_frame(MpegEncContext *s)
/* init common structure for both encoder and decoder */
void ff_mpv_common_end(MpegEncContext *s)
{
- if (!s)
- return;
-
ff_mpv_free_context_frame(s);
if (s->slice_context_count > 1)
s->slice_context_count = 1;
--
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] 9+ messages in thread
* [FFmpeg-devel] [PATCH 7/7] avcodec/mpegvideo: Remove incorrect comment
2022-10-24 2:21 [FFmpeg-devel] [PATCH 1/2] avcodec/mpegvideo: Don't initialize H264Chroma ctx unnecessarily Andreas Rheinhardt
` (4 preceding siblings ...)
2022-10-26 2:01 ` [FFmpeg-devel] [PATCH 6/7] avcodec/mpegvideo: Remove always-false check Andreas Rheinhardt
@ 2022-10-26 2:01 ` Andreas Rheinhardt
2022-10-26 23:33 ` [FFmpeg-devel] [PATCH 1/2] avcodec/mpegvideo: Don't initialize H264Chroma ctx unnecessarily Andreas Rheinhardt
6 siblings, 0 replies; 9+ messages in thread
From: Andreas Rheinhardt @ 2022-10-26 2:01 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/mpegvideo.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 99b2d8f6de..9a58d68524 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -786,7 +786,6 @@ void ff_mpv_free_context_frame(MpegEncContext *s)
s->linesize = s->uvlinesize = 0;
}
-/* init common structure for both encoder and decoder */
void ff_mpv_common_end(MpegEncContext *s)
{
ff_mpv_free_context_frame(s);
--
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] 9+ messages in thread
* Re: [FFmpeg-devel] [PATCH 1/2] avcodec/mpegvideo: Don't initialize H264Chroma ctx unnecessarily
2022-10-24 2:21 [FFmpeg-devel] [PATCH 1/2] avcodec/mpegvideo: Don't initialize H264Chroma ctx unnecessarily Andreas Rheinhardt
` (5 preceding siblings ...)
2022-10-26 2:01 ` [FFmpeg-devel] [PATCH 7/7] avcodec/mpegvideo: Remove incorrect comment Andreas Rheinhardt
@ 2022-10-26 23:33 ` Andreas Rheinhardt
6 siblings, 0 replies; 9+ messages in thread
From: Andreas Rheinhardt @ 2022-10-26 23:33 UTC (permalink / raw)
To: ffmpeg-devel
Andreas Rheinhardt:
> It is only used by the decoders' lowres code, so only initialize
> it for decoders.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> configure | 4 ++--
> libavcodec/mpegvideo.c | 1 -
> libavcodec/mpegvideo_dec.c | 3 +++
> 3 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/configure b/configure
> index eefd103414..dd207769a2 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..697438fa6f 100644
> --- a/libavcodec/mpegvideo.c
> +++ b/libavcodec/mpegvideo.c
> @@ -275,7 +275,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;
> }
> }
Will apply the first two patches of this patchset tonight.
- 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] 9+ messages in thread