History

avcodec/mpeg4videodec: Remove unnecessary ff_xvid_idct_init()

It is unnecessary: If the dst context is not already initialized, then it will be initialized by memcpy(dst, src, sizeof(*dst), which already initializes the IDCT to the desired one, potentially followed by ff_mpv_common_init(), which does not touch the IDCT. (This call has been added in f89d76c10355242c39b08f253c1d1524f45ef778; the aforementioned copying took place back then, too, but ff_mpv_common_init() reinitialized the IDCT to a non-xvid one, therefore the initialization here has been added to fix multithreaded decoding.)

Andreas Rheinhardt committed 1 year ago

Commit eb5d9001 parent 6af1bcb1 file · +0 −4Browse files

Unified · Split

libavcodec/mpeg4videodec.c+0−4
@@ -48,7 +48,6 @@ · 47 unmodified lines
48#include "profiles.h"48#include "profiles.h"
49#include "qpeldsp.h"49#include "qpeldsp.h"
50#include "threadprogress.h"50#include "threadprogress.h"
51#include "xvididct.h"
52#include "unary.h"51#include "unary.h"
53 52
54#if 0 //3IV1 is quite rare and it slows things down a tiny bit53#if 0 //3IV1 is quite rare and it slows things down a tiny bit
@@ -3880,9 +3879,6 @@ static int mpeg4_update_thread_context(AVCodecContext *dst, · 3825 unmodified lines
3880 memcpy(s->sprite_shift, s1->sprite_shift, sizeof(s1->sprite_shift));3879 memcpy(s->sprite_shift, s1->sprite_shift, sizeof(s1->sprite_shift));
3881 memcpy(s->sprite_traj, s1->sprite_traj, sizeof(s1->sprite_traj));3880 memcpy(s->sprite_traj, s1->sprite_traj, sizeof(s1->sprite_traj));
3882 3881
3883 if (!init && s1->xvid_build >= 0)
3884 ff_xvid_idct_init(&s->m.idsp, dst);
3885
3886 return av_buffer_replace(&s->bitstream_buffer, s1->bitstream_buffer);3882 return av_buffer_replace(&s->bitstream_buffer, s1->bitstream_buffer);
3887}3883}
3888 3884

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t