You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
avcodec/{h263,mpeg4video}dec: Pass MPVContext*, not Mpeg4DecContext*
The code in h263dec.c is not supposed to know that the MPEG-4 decoder uses an Mpeg4DecContext as private context at all (said context is only exposed in a header so that hardware accelerations can access it and for the parser to use). Passing an MPVContext* directly also allows to remove the indirection via AVCodecContext.priv_data. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@ -194,7 +194,7 @@ static int decode_slice(MpegEncContext *s)
|
||||
ff_set_qscale(s, s->qscale);
|
||||
|
||||
if (s->studio_profile) {
|
||||
if ((ret = ff_mpeg4_decode_studio_slice_header(s->avctx->priv_data)) < 0)
|
||||
if ((ret = ff_mpeg4_decode_studio_slice_header(s)) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -210,7 +210,7 @@ static int decode_slice(MpegEncContext *s)
|
||||
const int qscale = s->qscale;
|
||||
|
||||
if (CONFIG_MPEG4_DECODER && s->codec_id == AV_CODEC_ID_MPEG4)
|
||||
if ((ret = ff_mpeg4_decode_partitions(s->avctx->priv_data)) < 0)
|
||||
if ((ret = ff_mpeg4_decode_partitions(s)) < 0)
|
||||
return ret;
|
||||
|
||||
/* restore variables which were modified */
|
||||
|
@ -240,7 +240,7 @@ int ff_h263_resync(MpegEncContext *s){
|
||||
if(show_bits(&s->gb, 16)==0){
|
||||
pos= get_bits_count(&s->gb);
|
||||
if(CONFIG_MPEG4_DECODER && s->codec_id==AV_CODEC_ID_MPEG4)
|
||||
ret= ff_mpeg4_decode_video_packet_header(s->avctx->priv_data);
|
||||
ret = ff_mpeg4_decode_video_packet_header(s);
|
||||
else
|
||||
ret= h263_decode_gob_header(s);
|
||||
if(ret>=0)
|
||||
@ -257,7 +257,7 @@ int ff_h263_resync(MpegEncContext *s){
|
||||
|
||||
pos= get_bits_count(&s->gb);
|
||||
if(CONFIG_MPEG4_DECODER && s->codec_id==AV_CODEC_ID_MPEG4)
|
||||
ret= ff_mpeg4_decode_video_packet_header(s->avctx->priv_data);
|
||||
ret = ff_mpeg4_decode_video_packet_header(s);
|
||||
else
|
||||
ret= h263_decode_gob_header(s);
|
||||
if(ret>=0)
|
||||
|
@ -700,9 +700,9 @@ static int decode_new_pred(Mpeg4DecContext *ctx, GetBitContext *gb) {
|
||||
* Decode the next video packet.
|
||||
* @return <0 if something went wrong
|
||||
*/
|
||||
int ff_mpeg4_decode_video_packet_header(Mpeg4DecContext *ctx)
|
||||
int ff_mpeg4_decode_video_packet_header(MPVContext *const s)
|
||||
{
|
||||
MpegEncContext *s = &ctx->m;
|
||||
Mpeg4DecContext *const ctx = (Mpeg4DecContext*)s;
|
||||
|
||||
int mb_num_bits = av_log2(s->mb_num - 1) + 1;
|
||||
int header_extension = 0, mb_num, len;
|
||||
@ -799,9 +799,9 @@ static void reset_studio_dc_predictors(MpegEncContext *s)
|
||||
* Decode the next video packet.
|
||||
* @return <0 if something went wrong
|
||||
*/
|
||||
int ff_mpeg4_decode_studio_slice_header(Mpeg4DecContext *ctx)
|
||||
int ff_mpeg4_decode_studio_slice_header(MPVContext *const s)
|
||||
{
|
||||
MpegEncContext *s = &ctx->m;
|
||||
Mpeg4DecContext *const ctx = (Mpeg4DecContext*)s;
|
||||
GetBitContext *gb = &s->gb;
|
||||
unsigned vlc_len;
|
||||
uint16_t mb_num;
|
||||
@ -1307,9 +1307,9 @@ static int mpeg4_decode_partition_b(MpegEncContext *s, int mb_count)
|
||||
* Decode the first and second partition.
|
||||
* @return <0 if error (and sets error type in the error_status_table)
|
||||
*/
|
||||
int ff_mpeg4_decode_partitions(Mpeg4DecContext *ctx)
|
||||
int ff_mpeg4_decode_partitions(MPVContext *const s)
|
||||
{
|
||||
MpegEncContext *s = &ctx->m;
|
||||
Mpeg4DecContext *const ctx = (Mpeg4DecContext*)s;
|
||||
int mb_num;
|
||||
int ret;
|
||||
const int part_a_error = s->pict_type == AV_PICTURE_TYPE_I ? (ER_DC_ERROR | ER_MV_ERROR) : ER_MV_ERROR;
|
||||
|
@ -116,9 +116,9 @@ void ff_mpeg4_decode_studio(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb
|
||||
void ff_mpeg4_mcsel_motion(MpegEncContext *s,
|
||||
uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
|
||||
uint8_t *const *ref_picture);
|
||||
int ff_mpeg4_decode_partitions(Mpeg4DecContext *ctx);
|
||||
int ff_mpeg4_decode_video_packet_header(Mpeg4DecContext *ctx);
|
||||
int ff_mpeg4_decode_studio_slice_header(Mpeg4DecContext *ctx);
|
||||
int ff_mpeg4_decode_partitions(MPVContext *const s);
|
||||
int ff_mpeg4_decode_video_packet_header(MPVContext *const s);
|
||||
int ff_mpeg4_decode_studio_slice_header(MPVContext *const s);
|
||||
void ff_mpeg4_workaround_bugs(AVCodecContext *avctx);
|
||||
void ff_mpeg4_pred_ac(MpegEncContext *s, int16_t *block, int n,
|
||||
int dir);
|
||||
|
Reference in New Issue
Block a user