FFmpeg
Macros | Functions
mpegvideo_dec.c File Reference
#include <limits.h>
#include "config_components.h"
#include "libavutil/avassert.h"
#include "libavutil/emms.h"
#include "libavutil/imgutils.h"
#include "libavutil/internal.h"
#include "libavutil/video_enc_params.h"
#include "avcodec.h"
#include "decode.h"
#include "h264chroma.h"
#include "internal.h"
#include "mpegutils.h"
#include "mpegvideo.h"
#include "mpegvideodec.h"
#include "mpeg4videodec.h"
#include "libavutil/refstruct.h"
#include "thread.h"
#include "threadprogress.h"
#include "wmv2dec.h"

Go to the source code of this file.

Macros

#define NOT_MPEG12_H261   0
 
#define MAY_BE_MPEG12_H261   1
 
#define DEFINITELY_MPEG12_H261   2
 
#define IS_MPEG12_H261(s)   (is_mpeg12 == MAY_BE_MPEG12_H261 ? ((s)->out_format <= FMT_H261) : is_mpeg12)
 

Functions

int ff_mpv_decode_init (MpegEncContext *s, AVCodecContext *avctx)
 Initialize the given MpegEncContext for decoding. More...
 
int ff_mpeg_update_thread_context (AVCodecContext *dst, const AVCodecContext *src)
 
int ff_mpv_decode_close (AVCodecContext *avctx)
 
int ff_mpv_common_frame_size_change (MpegEncContext *s)
 
static int alloc_picture (MpegEncContext *s, MPVWorkPicture *dst, int reference)
 
static int av_cold alloc_dummy_frame (MpegEncContext *s, MPVWorkPicture *dst)
 
static void color_frame (AVFrame *frame, int luma)
 
int ff_mpv_alloc_dummy_frames (MpegEncContext *s)
 Ensure that the dummy frames are allocated according to pict_type if necessary. More...
 
int ff_mpv_frame_start (MpegEncContext *s, AVCodecContext *avctx)
 generic function called after decoding the header and before a frame is decoded. More...
 
void ff_mpv_frame_end (MpegEncContext *s)
 
void ff_print_debug_info (const MpegEncContext *s, const MPVPicture *p, AVFrame *pict)
 
int ff_mpv_export_qp_table (const MpegEncContext *s, AVFrame *f, const MPVPicture *p, int qp_type)
 
void ff_mpeg_draw_horiz_band (MpegEncContext *s, int y, int h)
 
void ff_mpeg_flush (AVCodecContext *avctx)
 
void ff_mpv_report_decode_progress (MpegEncContext *s)
 
static int hpel_motion_lowres (MpegEncContext *s, uint8_t *dest, const uint8_t *src, int field_based, int field_select, int src_x, int src_y, int width, int height, ptrdiff_t stride, int h_edge_pos, int v_edge_pos, int w, int h, const h264_chroma_mc_func *pix_op, int motion_x, int motion_y)
 
static av_always_inline void mpeg_motion_lowres (MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int field_based, int bottom_field, int field_select, uint8_t *const *ref_picture, const h264_chroma_mc_func *pix_op, int motion_x, int motion_y, int h, int mb_y)
 
static void chroma_4mv_motion_lowres (MpegEncContext *s, uint8_t *dest_cb, uint8_t *dest_cr, uint8_t *const *ref_picture, const h264_chroma_mc_func *pix_op, int mx, int my)
 
static void MPV_motion_lowres (MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int dir, uint8_t *const *ref_picture, const h264_chroma_mc_func *pix_op)
 motion compensation of a single macroblock More...
 
static int lowest_referenced_row (MpegEncContext *s, int dir)
 find the lowest MB row referenced in the MVs More...
 
static void add_dct (MpegEncContext *s, int16_t *block, int i, uint8_t *dest, int line_size)
 
static void put_dct (MpegEncContext *s, int16_t *block, int i, uint8_t *dest, int line_size, int qscale)
 
static void add_dequant_dct (MpegEncContext *s, int16_t *block, int i, uint8_t *dest, int line_size, int qscale)
 
static av_always_inline void mpv_reconstruct_mb_internal (MpegEncContext *s, int16_t block[12][64], int lowres_flag, int is_mpeg12)
 
void ff_mpv_reconstruct_mb (MpegEncContext *s, int16_t block[12][64])
 

Macro Definition Documentation

◆ NOT_MPEG12_H261

#define NOT_MPEG12_H261   0

Definition at line 905 of file mpegvideo_dec.c.

◆ MAY_BE_MPEG12_H261

#define MAY_BE_MPEG12_H261   1

Definition at line 906 of file mpegvideo_dec.c.

◆ DEFINITELY_MPEG12_H261

#define DEFINITELY_MPEG12_H261   2

Definition at line 907 of file mpegvideo_dec.c.

◆ IS_MPEG12_H261

#define IS_MPEG12_H261 (   s)    (is_mpeg12 == MAY_BE_MPEG12_H261 ? ((s)->out_format <= FMT_H261) : is_mpeg12)

Function Documentation

◆ ff_mpv_decode_init()

int ff_mpv_decode_init ( MpegEncContext s,
AVCodecContext avctx 
)

Initialize the given MpegEncContext for decoding.

the changed fields will not depend upon the prior state of the MpegEncContext.

Also initialize the picture pool.

Definition at line 46 of file mpegvideo_dec.c.

Referenced by ff_h263_decode_init(), ff_rv34_decode_init(), ff_vc1_decode_init(), h261_decode_init(), and mpeg_decode_init().

◆ ff_mpeg_update_thread_context()

int ff_mpeg_update_thread_context ( AVCodecContext dst,
const AVCodecContext src 
)

Definition at line 77 of file mpegvideo_dec.c.

Referenced by ff_rv34_decode_update_thread_context().

◆ ff_mpv_decode_close()

int ff_mpv_decode_close ( AVCodecContext avctx)

◆ ff_mpv_common_frame_size_change()

int ff_mpv_common_frame_size_change ( MpegEncContext s)

◆ alloc_picture()

static int alloc_picture ( MpegEncContext s,
MPVWorkPicture dst,
int  reference 
)
static

Definition at line 197 of file mpegvideo_dec.c.

Referenced by alloc_dummy_frame(), and ff_mpv_frame_start().

◆ alloc_dummy_frame()

static int av_cold alloc_dummy_frame ( MpegEncContext s,
MPVWorkPicture dst 
)
static

Definition at line 249 of file mpegvideo_dec.c.

Referenced by ff_mpv_alloc_dummy_frames().

◆ color_frame()

static void color_frame ( AVFrame frame,
int  luma 
)
static

Definition at line 264 of file mpegvideo_dec.c.

Referenced by ff_mpv_alloc_dummy_frames(), and ff_mpv_frame_start().

◆ ff_mpv_alloc_dummy_frames()

int ff_mpv_alloc_dummy_frames ( MpegEncContext s)

Ensure that the dummy frames are allocated according to pict_type if necessary.

Definition at line 282 of file mpegvideo_dec.c.

Referenced by ff_mpv_frame_start(), and mpeg_field_start().

◆ ff_mpv_frame_start()

int ff_mpv_frame_start ( MpegEncContext s,
AVCodecContext avctx 
)

generic function called after decoding the header and before a frame is decoded.

Definition at line 325 of file mpegvideo_dec.c.

Referenced by decode_wmv9(), ff_h263_decode_frame(), ff_rv34_decode_frame(), h261_decode_frame(), mpeg_field_start(), rv10_decode_packet(), and vc1_decode_frame().

◆ ff_mpv_frame_end()

void ff_mpv_frame_end ( MpegEncContext s)

◆ ff_print_debug_info()

void ff_print_debug_info ( const MpegEncContext s,
const MPVPicture p,
AVFrame pict 
)

◆ ff_mpv_export_qp_table()

int ff_mpv_export_qp_table ( const MpegEncContext s,
AVFrame f,
const MPVPicture p,
int  qp_type 
)

Definition at line 391 of file mpegvideo_dec.c.

Referenced by ff_h263_decode_frame(), finish_frame(), rv10_decode_frame(), and slice_end().

◆ ff_mpeg_draw_horiz_band()

void ff_mpeg_draw_horiz_band ( MpegEncContext s,
int  y,
int  h 
)

◆ ff_mpeg_flush()

void ff_mpeg_flush ( AVCodecContext avctx)

Definition at line 430 of file mpegvideo_dec.c.

Referenced by decode_wmv9(), and flush().

◆ ff_mpv_report_decode_progress()

void ff_mpv_report_decode_progress ( MpegEncContext s)

Definition at line 443 of file mpegvideo_dec.c.

Referenced by decode_slice(), and mpeg_decode_slice().

◆ hpel_motion_lowres()

static int hpel_motion_lowres ( MpegEncContext s,
uint8_t *  dest,
const uint8_t *  src,
int  field_based,
int  field_select,
int  src_x,
int  src_y,
int  width,
int  height,
ptrdiff_t  stride,
int  h_edge_pos,
int  v_edge_pos,
int  w,
int  h,
const h264_chroma_mc_func pix_op,
int  motion_x,
int  motion_y 
)
inlinestatic

Definition at line 450 of file mpegvideo_dec.c.

Referenced by MPV_motion_lowres().

◆ mpeg_motion_lowres()

static av_always_inline void mpeg_motion_lowres ( MpegEncContext s,
uint8_t *  dest_y,
uint8_t *  dest_cb,
uint8_t *  dest_cr,
int  field_based,
int  bottom_field,
int  field_select,
uint8_t *const *  ref_picture,
const h264_chroma_mc_func pix_op,
int  motion_x,
int  motion_y,
int  h,
int  mb_y 
)
static

Definition at line 499 of file mpegvideo_dec.c.

Referenced by MPV_motion_lowres().

◆ chroma_4mv_motion_lowres()

static void chroma_4mv_motion_lowres ( MpegEncContext s,
uint8_t *  dest_cb,
uint8_t *  dest_cr,
uint8_t *const *  ref_picture,
const h264_chroma_mc_func pix_op,
int  mx,
int  my 
)
inlinestatic

Definition at line 641 of file mpegvideo_dec.c.

Referenced by MPV_motion_lowres().

◆ MPV_motion_lowres()

static void MPV_motion_lowres ( MpegEncContext s,
uint8_t *  dest_y,
uint8_t *  dest_cb,
uint8_t *  dest_cr,
int  dir,
uint8_t *const *  ref_picture,
const h264_chroma_mc_func pix_op 
)
inlinestatic

motion compensation of a single macroblock

Parameters
scontext
dest_yluma destination pointer
dest_cbchroma cb/u destination pointer
dest_crchroma cr/v destination pointer
dirdirection (0->forward, 1->backward)
ref_picturearray[3] of pointers to the 3 planes of the reference picture
pix_ophalfpel motion compensation function (average or put normally) the motion vectors are taken from s->mv and the MV type from s->mv_type

Definition at line 711 of file mpegvideo_dec.c.

Referenced by mpv_reconstruct_mb_internal().

◆ lowest_referenced_row()

static int lowest_referenced_row ( MpegEncContext s,
int  dir 
)
static

find the lowest MB row referenced in the MVs

Definition at line 843 of file mpegvideo_dec.c.

Referenced by mpv_reconstruct_mb_internal().

◆ add_dct()

static void add_dct ( MpegEncContext s,
int16_t *  block,
int  i,
uint8_t *  dest,
int  line_size 
)
inlinestatic

Definition at line 879 of file mpegvideo_dec.c.

Referenced by mpv_reconstruct_mb_internal().

◆ put_dct()

static void put_dct ( MpegEncContext s,
int16_t *  block,
int  i,
uint8_t *  dest,
int  line_size,
int  qscale 
)
inlinestatic

Definition at line 888 of file mpegvideo_dec.c.

Referenced by mpv_reconstruct_mb_internal().

◆ add_dequant_dct()

static void add_dequant_dct ( MpegEncContext s,
int16_t *  block,
int  i,
uint8_t *  dest,
int  line_size,
int  qscale 
)
inlinestatic

Definition at line 895 of file mpegvideo_dec.c.

Referenced by mpv_reconstruct_mb_internal().

◆ mpv_reconstruct_mb_internal()

static av_always_inline void mpv_reconstruct_mb_internal ( MpegEncContext s,
int16_t  block[12][64],
int  lowres_flag,
int  is_mpeg12 
)
static

Definition at line 919 of file mpegvideo_dec.c.

Referenced by ff_mpv_reconstruct_mb().

◆ ff_mpv_reconstruct_mb()

void ff_mpv_reconstruct_mb ( MpegEncContext s,
int16_t  block[12][64] 
)