mbuffer.h File Reference

Frame buffer functions. More...

#include "global.h"

Include dependency graph for mbuffer.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  pic_motion_params
 definition of pic motion parameters More...
struct  storable_picture
 definition a picture (field or frame) More...
struct  colocated_params
 definition a picture (field or frame) More...
struct  frame_store
 Frame Stores for Decoded Picture Buffer. More...
struct  decoded_picture_buffer
 Decoded Picture Buffer. More...

Defines

#define MAX_LIST_SIZE   33

Typedefs

typedef struct pic_motion_params PicMotionParams
typedef struct storable_picture StorablePicture
typedef struct colocated_params ColocatedParams
typedef struct frame_store FrameStore
typedef struct
decoded_picture_buffer 
DecodedPictureBuffer

Functions

void init_dpb (ImageParameters *p_Img)
void free_dpb (ImageParameters *p_Img)
FrameStorealloc_frame_store (void)
void free_frame_store (ImageParameters *p_Img, FrameStore *f)
StorablePicturealloc_storable_picture (ImageParameters *p_Img, PictureStructure type, int size_x, int size_y, int size_x_cr, int size_y_cr)
void free_storable_picture (ImageParameters *p_Img, StorablePicture *p)
void store_picture_in_dpb (ImageParameters *p_Img, StorablePicture *p)
void flush_dpb (ImageParameters *p_Img)
void dpb_split_field (ImageParameters *p_Img, FrameStore *fs)
void dpb_combine_field (ImageParameters *p_Img, FrameStore *fs)
void dpb_combine_field_yuv (ImageParameters *p_Img, FrameStore *fs)
void init_lists (Slice *currSlice)
void reorder_ref_pic_list (ImageParameters *p_Img, StorablePicture **list, char *list_size, int num_ref_idx_lX_active_minus1, int *reordering_of_pic_nums_idc, int *abs_diff_pic_num_minus1, int *long_term_pic_idx)
void init_mbaff_lists (ImageParameters *p_Img)
void alloc_ref_pic_list_reordering_buffer (Slice *currSlice)
void free_ref_pic_list_reordering_buffer (Slice *currSlice)
void fill_frame_num_gap (ImageParameters *p_Img)
ColocatedParamsalloc_colocated (int size_x, int size_y, int mb_adaptive_frame_field_flag)
void free_colocated (ColocatedParams *p)
void compute_colocated (Slice *currSlice, ColocatedParams *p, StorablePicture **listX[6])
void compute_colocated_JV (Slice *currSlice, ColocatedParams *p, StorablePicture **listX[6])
void copy_storable_param_JV (ImageParameters *p_Img, PicMotionParams *JVplane, PicMotionParams *motion)


Detailed Description

Frame buffer functions.

mbuffer.h

Author:
Main contributors (see contributors.h for copyright, address and affiliation details)

Definition in file mbuffer.h.


Typedef Documentation

definition a picture (field or frame)

Decoded Picture Buffer.

typedef struct frame_store FrameStore

Frame Stores for Decoded Picture Buffer.

definition of pic motion parameters

definition a picture (field or frame)


Function Documentation

ColocatedParams* alloc_colocated ( int  size_x,
int  size_y,
int  mb_adaptive_frame_field_flag 
)

Allocate co-located memory.

Parameters:
size_x horizontal luma size
size_y vertical luma size
mb_adaptive_frame_field_flag flag that indicates macroblock adaptive frame/field coding
Returns:
the allocated StorablePicture structure

Definition at line 3451 of file mbuffer.c.

References alloc_motion_params(), and no_mem_exit().

Referenced by read_new_slice().

Here is the call graph for this function:

FrameStore* alloc_frame_store ( void   ) 

Allocate memory for decoded picture buffer frame stores an initialize with sane values.

Returns:
the allocated FrameStore structure

Definition at line 334 of file mbuffer.c.

References frame_store::is_long_term, frame_store::is_orig_reference, frame_store::is_reference, frame_store::is_used, and no_mem_exit().

Referenced by idr_memory_management(), init_dpb(), and init_out_buffer().

Here is the call graph for this function:

void alloc_ref_pic_list_reordering_buffer ( Slice currSlice  ) 

Allocate memory for buffering of reference picture reordering commands.

Definition at line 3292 of file mbuffer.c.

References no_mem_exit(), slice::num_ref_idx_l0_active, and slice::num_ref_idx_l1_active.

Referenced by ref_pic_list_reordering().

Here is the call graph for this function:

StorablePicture* alloc_storable_picture ( ImageParameters *  p_Img,
PictureStructure  structure,
int  size_x,
int  size_y,
int  size_x_cr,
int  size_y_cr 
)

Allocate memory for a stored picture.

Parameters:
p_Img image decoding parameters for current picture
structure picture structure
size_x horizontal luma size
size_y vertical luma size
size_x_cr horizontal chroma size
size_y_cr vertical chroma size
Returns:
the allocated StorablePicture structure

Definition at line 403 of file mbuffer.c.

References storable_picture::dec_ref_pic_marking_buffer, get_mem2Dpel(), get_mem2Dshort(), get_mem3Dpel(), storable_picture::imgUV, storable_picture::imgY, storable_picture::JVmotion, storable_picture::motion, no_mem_exit(), storable_picture::slice_id, and YUV400.

Referenced by conceal_lost_frames(), conceal_non_ref_pics(), dpb_combine_field_yuv(), dpb_split_field(), fill_frame_num_gap(), init_dpb(), init_picture(), write_lost_ref_after_idr(), and write_unpaired_field().

Here is the call graph for this function:

void compute_colocated ( Slice currSlice,
ColocatedParams p,
StorablePicture **  listX[6] 
)

Compute co-located motion info.

Assign frame buffers for field MBs Check whether we should use top or bottom field mvs. Depending on the assigned poc values.

Generate field MVs from Frame MVs

Do nothing if macroblock as field coded in MB-AFF

Use inference flag to remap mvs/references Frame with field co-located

Definition at line 3536 of file mbuffer.c.

References slice::direct_spatial_mv_pred_flag, pic_motion_params::field_frame, storable_picture::motion, pic_motion_params::mv, motion_params::mv, pic_motion_params::ref_id, pic_motion_params::ref_idx, motion_params::ref_idx, and motion_params::ref_pic_id.

Referenced by decode_one_slice().

void compute_colocated_JV ( Slice currSlice,
ColocatedParams p,
StorablePicture **  listX[6] 
)

Compute co-located motion info for 4:4:4 Independent mode.

Assign frame buffers for field MBs Check whether we should use top or bottom field mvs. Depending on the assigned poc values.

Generate field MVs from Frame MVs

Do nothing if macroblock as field coded in MB-AFF

Use inference flag to remap mvs/references Frame with field co-located

Use inference flag to remap mvs/references

Definition at line 3972 of file mbuffer.c.

References slice::direct_spatial_mv_pred_flag, pic_motion_params::field_frame, storable_picture::JVmotion, storable_picture::motion, pic_motion_params::mv, motion_params::mv, pic_motion_params::ref_id, pic_motion_params::ref_idx, motion_params::ref_idx, and motion_params::ref_pic_id.

Referenced by decode_one_slice().

void dpb_combine_field ( ImageParameters *  p_Img,
FrameStore fs 
)

Generate a frame from top and bottom fields.

Use inference flag to remap mvs/references

Generate Frame parameters from field information.

association with id already known for fields.

need to make association with frames

need to make association with frames

Definition at line 3217 of file mbuffer.c.

References dpb_combine_field_yuv(), pic_motion_params::field_frame, storable_picture::motion, pic_motion_params::mv, pic_motion_params::ref_id, pic_motion_params::ref_idx, and storable_picture::slice_id.

Referenced by insert_picture_in_dpb().

Here is the call graph for this function:

void dpb_combine_field_yuv ( ImageParameters *  p_Img,
FrameStore fs 
)

Generate a frame from top and bottom fields, YUV components and display information only.

Definition at line 3158 of file mbuffer.c.

References alloc_storable_picture(), storable_picture::imgUV, and storable_picture::imgY.

Referenced by direct_output(), dpb_combine_field(), and write_unpaired_field().

Here is the call graph for this function:

void dpb_split_field ( ImageParameters *  p_Img,
FrameStore fs 
)

Extract top field from a frame.

association with id already known for fields.

need to make association with frames

Generate field MVs from Frame MVs

Definition at line 2910 of file mbuffer.c.

References alloc_storable_picture(), pic_motion_params::field_frame, storable_picture::imgUV, storable_picture::imgY, pic_motion_params::mb_field, storable_picture::motion, pic_motion_params::mv, pic_motion_params::ref_id, pic_motion_params::ref_idx, and storable_picture::slice_id.

Referenced by insert_picture_in_dpb().

Here is the call graph for this function:

void fill_frame_num_gap ( ImageParameters *  p_Img  ) 

Tian Dong June 13, 2002, Modifed on July 30, 2003.

If a gap in frame_num is found, try to fill the gap

Parameters:
p_Img 

Definition at line 3370 of file mbuffer.c.

References alloc_storable_picture(), decode_poc(), and store_picture_in_dpb().

Referenced by init_picture().

Here is the call graph for this function:

void flush_dpb ( ImageParameters *  p_Img  ) 

All stored picture are output. Should be called to empty the buffer.

Definition at line 2856 of file mbuffer.c.

References conceal_non_ref_pics(), output_one_frame_from_dpb(), remove_unused_frame_from_dpb(), and unmark_for_reference().

Referenced by activate_sps(), adaptive_memory_management(), conceal_lost_frames(), error(), idr_memory_management(), and main().

Here is the call graph for this function:

void free_colocated ( ColocatedParams p  ) 

Free co-located memory.

Parameters:
p Picture to be freed

Definition at line 3485 of file mbuffer.c.

References free_mem2D(), free_mem3D(), free_mem3Dint64(), free_mem4Dshort(), motion_params::mv, motion_params::ref_idx, and motion_params::ref_pic_id.

Referenced by exit_slice(), and read_new_slice().

Here is the call graph for this function:

void free_dpb ( ImageParameters *  p_Img  ) 

Free memory for decoded picture buffer.

Definition at line 285 of file mbuffer.c.

References free_frame_store(), and free_storable_picture().

Referenced by init_dpb(), and main().

Here is the call graph for this function:

void free_frame_store ( ImageParameters *  p_Img,
FrameStore f 
)

Free frame store memory.

Parameters:
p_Img image decoding parameters for current picture
f FrameStore to be freed

Definition at line 490 of file mbuffer.c.

References free_storable_picture().

Referenced by free_dpb(), idr_memory_management(), and uninit_out_buffer().

Here is the call graph for this function:

void free_ref_pic_list_reordering_buffer ( Slice currSlice  ) 

Free memory for buffering of reference picture reordering commands.

Definition at line 3333 of file mbuffer.c.

void free_storable_picture ( ImageParameters *  p_Img,
StorablePicture p 
)

Free picture memory.

Parameters:
p_Img image decoding parameters for current picture
p Picture to be freed

Definition at line 564 of file mbuffer.c.

References free_mem2Dpel(), free_mem2Dshort(), free_mem3Dpel(), storable_picture::imgUV, storable_picture::imgY, storable_picture::JVmotion, storable_picture::motion, storable_picture::slice_id, and storable_picture::tone_mapping_lut.

Referenced by direct_output(), flush_direct_output(), free_dpb(), free_frame_store(), make_frame_picture_JV(), and remove_frame_from_dpb().

Here is the call graph for this function:

void init_dpb ( ImageParameters *  p_Img  ) 

Allocate memory for decoded picture buffer and initialize with sane values.

Definition at line 200 of file mbuffer.c.

References alloc_frame_store(), alloc_storable_picture(), error(), free_dpb(), getDpbSize(), and no_mem_exit().

Referenced by activate_sps().

Here is the call graph for this function:

void init_lists ( Slice currSlice  ) 

void init_mbaff_lists ( ImageParameters *  p_Img  ) 

Initialize listX[2..5] from lists 0 and 1 listX[2]: list0 for current_field==top listX[3]: list1 for current_field==top listX[4]: list0 for current_field==bottom listX[5]: list1 for current_field==bottom.

Definition at line 1360 of file mbuffer.c.

Referenced by read_new_slice().

void reorder_ref_pic_list ( ImageParameters *  p_Img,
StorablePicture **  list,
char *  list_size,
int  num_ref_idx_lX_active_minus1,
int *  reordering_of_pic_nums_idc,
int *  abs_diff_pic_num_minus1,
int *  long_term_pic_idx 
)

Reordering process for reference picture lists.

Definition at line 1526 of file mbuffer.c.

References error(), reorder_long_term(), and reorder_short_term().

Here is the call graph for this function:

void store_picture_in_dpb ( ImageParameters *  p_Img,
StorablePicture p 
)

Store a picture in DPB. This includes cheking for space in DPB and flushing frames. If we received a frame, we need to check for a new store, if we got a field, check if it's the second field of an already allocated store.

Parameters:
p_Img image decoding parameters for current picture
p Picture to be stored

Definition at line 2322 of file mbuffer.c.

References adaptive_memory_management(), check_num_ref(), conceal_non_ref_pics(), direct_output(), dump_dpb(), error(), get_smallest_poc(), idr_memory_management(), insert_picture_in_dpb(), frame_store::is_orig_reference, frame_store::is_reference, frame_store::is_used, output_one_frame_from_dpb(), remove_unused_frame_from_dpb(), sliding_window_memory_management(), sliding_window_poc_management(), update_ltref_list(), and update_ref_list().

Referenced by conceal_lost_frames(), exit_picture(), and fill_frame_num_gap().

Here is the call graph for this function:


Documentation generated with DoxyGen