avcodec/mpeg12dec: Disable allocating scratchpad buffers when possible
They are no longer used by the MPEG-1/2 decoders except when using lowres. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
3acf351e77
commit
ba341be095
@ -1000,6 +1000,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
||||
|
||||
if ((ret = ff_mpv_common_init(s)) < 0)
|
||||
return ret;
|
||||
if (!s->avctx->lowres)
|
||||
ff_mpv_framesize_disable(&s->sc);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -1874,6 +1876,8 @@ static int vcr2_init_sequence(AVCodecContext *avctx)
|
||||
|
||||
if ((ret = ff_mpv_common_init(s)) < 0)
|
||||
return ret;
|
||||
if (!s->avctx->lowres)
|
||||
ff_mpv_framesize_disable(&s->sc);
|
||||
|
||||
for (i = 0; i < 64; i++) {
|
||||
int j = s->idsp.idct_permutation[i];
|
||||
|
@ -21,6 +21,7 @@
|
||||
#ifndef AVCODEC_MPEGPICTURE_H
|
||||
#define AVCODEC_MPEGPICTURE_H
|
||||
|
||||
#include <limits.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
@ -135,6 +136,15 @@ int ff_mpv_pic_check_linesize(void *logctx, const struct AVFrame *f,
|
||||
int ff_mpv_framesize_alloc(AVCodecContext *avctx,
|
||||
ScratchpadContext *sc, int linesize);
|
||||
|
||||
/**
|
||||
* Disable allocating the ScratchpadContext's buffers in future calls
|
||||
* to ff_mpv_framesize_alloc().
|
||||
*/
|
||||
static inline void ff_mpv_framesize_disable(ScratchpadContext *sc)
|
||||
{
|
||||
sc->linesize = INT_MAX;
|
||||
}
|
||||
|
||||
void ff_mpv_unref_picture(MPVWorkPicture *pic);
|
||||
void ff_mpv_workpic_from_pic(MPVWorkPicture *wpic, MPVPicture *pic);
|
||||
void ff_mpv_replace_picture(MPVWorkPicture *dst, const MPVWorkPicture *src);
|
||||
|
Loading…
Reference in New Issue
Block a user