1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avcodec/mpeg12dec: Add Mpeg12SliceContext

This is in preparation for removing the GetBitContext
from MPVContext.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2025-06-19 20:59:14 +02:00
parent 8a4accc24d
commit 3a96a3c949
3 changed files with 433 additions and 427 deletions

File diff suppressed because it is too large Load Diff

View File

@ -128,7 +128,7 @@ static av_cold int init_duplicate_context(MpegEncContext *s)
av_cold int ff_mpv_init_duplicate_contexts(MpegEncContext *s)
{
int nb_slices = s->slice_context_count, ret;
size_t slice_size = s->slice_ctx_size ? s->slice_ctx_size : sizeof(*s);
const size_t slice_size = s->slice_ctx_size;
/* We initialize the copies before the original so that
* fields allocated in init_duplicate_context are NULL after

View File

@ -116,6 +116,7 @@ typedef struct MpegEncContext {
int end_mb_y; ///< end mb_y of this thread (so current thread should process start_mb_y <= row < end_mb_y)
union {
struct MpegEncContext *thread_context[MAX_THREADS];
struct Mpeg12SliceContext *mpeg12_contexts[MAX_THREADS];
struct MPVEncContext *enc_contexts[MAX_THREADS];
};
int slice_context_count; ///< number of used thread_contexts