#include "global.h"


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 | motion_params |
| definition of motion parameters 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 motion_params | MotionParams |
| typedef struct colocated_params | ColocatedParams |
| typedef struct frame_store | FrameStore |
| typedef struct decoded_picture_buffer | DecodedPictureBuffer |
Functions | |
| void | init_dpb (void) |
| void | free_dpb (void) |
| FrameStore * | alloc_frame_store (void) |
| void | free_frame_store (FrameStore *f) |
| StorablePicture * | alloc_storable_picture (PictureStructure type, int size_x, int size_y, int size_x_cr, int size_y_cr) |
| void | free_storable_picture (StorablePicture *p) |
| void | store_picture_in_dpb (StorablePicture *p) |
| void | flush_dpb (void) |
| void | dpb_split_field (FrameStore *fs) |
| void | dpb_combine_field (FrameStore *fs) |
| void | dpb_combine_field_yuv (FrameStore *fs) |
| void | init_lists (int currSliceType, PictureStructure currPicStructure) |
| void | reorder_ref_pic_list (StorablePicture **list, int *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 (void) |
| void | alloc_ref_pic_list_reordering_buffer (Slice *currSlice) |
| void | free_ref_pic_list_reordering_buffer (Slice *currSlice) |
| void | fill_frame_num_gap (ImageParameters *img) |
| ColocatedParams * | alloc_colocated (int size_x, int size_y, int mb_adaptive_frame_field_flag) |
| void | free_colocated (ColocatedParams *p) |
| void | compute_colocated (ColocatedParams *p, StorablePicture **listX[6]) |
| void | compute_colocated_JV (ColocatedParams *p, StorablePicture **listX[6]) |
| void | copy_storable_param_JV (PicMotionParams *JVplane, PicMotionParams *motion) |
Variables | |
| DecodedPictureBuffer | dpb |
| StorablePicture ** | listX [6] |
| int | listXsize [6] |
Definition in file mbuffer.h.
| typedef struct colocated_params ColocatedParams |
definition a picture (field or frame)
| typedef struct decoded_picture_buffer DecodedPictureBuffer |
Decoded Picture Buffer.
| typedef struct frame_store FrameStore |
Frame Stores for Decoded Picture Buffer.
| typedef struct motion_params MotionParams |
definition of motion parameters
| typedef struct pic_motion_params PicMotionParams |
definition of pic motion parameters
| typedef struct storable_picture StorablePicture |
definition a picture (field or frame)
| ColocatedParams* alloc_colocated | ( | int | size_x, | |
| int | size_y, | |||
| int | mb_adaptive_frame_field_flag | |||
| ) |
Allocate co-located memory.
| size_x | horizontal luma size | |
| size_y | vertical luma size | |
| mb_adaptive_frame_field_flag | flag that indicates macroblock adaptive frame/field coding |
Definition at line 3405 of file mbuffer.c.
References alloc_motion_params(), colocated_params::bottom, colocated_params::frame, colocated_params::mb_adaptive_frame_field_flag, no_mem_exit(), colocated_params::size_x, colocated_params::size_y, and colocated_params::top.

| FrameStore* alloc_frame_store | ( | void | ) |
Allocate memory for decoded picture buffer frame stores an initialize with sane values.
Definition at line 343 of file mbuffer.c.
References frame_store::bottom_field, frame_store::frame, frame_store::is_long_term, frame_store::is_orig_reference, frame_store::is_output, frame_store::is_reference, frame_store::is_used, no_mem_exit(), and frame_store::top_field.
Referenced by idr_memory_management(), init_dpb(), and init_out_buffer().

| void alloc_ref_pic_list_reordering_buffer | ( | Slice * | currSlice | ) |
Allocate memory for buffering of reference picture reordering commands.
Definition at line 3249 of file mbuffer.c.
References Slice::abs_diff_pic_num_minus1_l0, Slice::abs_diff_pic_num_minus1_l1, img, Slice::long_term_pic_idx_l0, Slice::long_term_pic_idx_l1, no_mem_exit(), Slice::reordering_of_pic_nums_idc_l0, and Slice::reordering_of_pic_nums_idc_l1.
Referenced by ref_pic_list_reordering().

| StorablePicture* alloc_storable_picture | ( | PictureStructure | structure, | |
| int | size_x, | |||
| int | size_y, | |||
| int | size_x_cr, | |||
| int | size_y_cr | |||
| ) |
Allocate memory for a stored 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 |
Definition at line 408 of file mbuffer.c.
References storable_picture::bottom_field, storable_picture::bottom_poc, storable_picture::coded_frame, storable_picture::dec_ref_pic_marking_buffer, storable_picture::frame, storable_picture::frame_num, get_mem2Dpel(), get_mem2Dshort(), get_mem3Dpel(), img, storable_picture::imgUV, storable_picture::imgY, storable_picture::is_long_term, storable_picture::is_output, storable_picture::JVmotion, storable_picture::long_term_frame_idx, storable_picture::long_term_pic_num, storable_picture::max_slice_id, storable_picture::MbaffFrameFlag, storable_picture::motion, no_mem_exit(), storable_picture::non_existing, storable_picture::pic_num, storable_picture::PicSizeInMbs, storable_picture::poc, storable_picture::seiHasTone_mapping, storable_picture::size_x, storable_picture::size_x_cr, storable_picture::size_x_cr_m1, storable_picture::size_x_m1, storable_picture::size_y, storable_picture::size_y_cr, storable_picture::size_y_cr_m1, storable_picture::size_y_m1, storable_picture::slice_id, storable_picture::structure, storable_picture::top_field, storable_picture::top_poc, storable_picture::used_for_reference, 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().

| void compute_colocated | ( | 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 3490 of file mbuffer.c.
References colocated_params::bottom, storable_picture::bottom_field, storable_picture::bottom_poc, storable_picture::coded_frame, pic_motion_params::field_frame, colocated_params::frame, img, storable_picture::is_long_term, colocated_params::is_long_term, storable_picture::motion, motion_params::moving_block, pic_motion_params::mv, motion_params::mv, storable_picture::poc, pic_motion_params::ref_id, pic_motion_params::ref_idx, motion_params::ref_idx, motion_params::ref_pic_id, storable_picture::size_x, storable_picture::size_y, storable_picture::structure, colocated_params::top, storable_picture::top_field, and storable_picture::top_poc.
Referenced by decode_one_slice().
| void compute_colocated_JV | ( | 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 3923 of file mbuffer.c.
References colocated_params::bottom, storable_picture::bottom_field, storable_picture::bottom_poc, storable_picture::coded_frame, pic_motion_params::field_frame, colocated_params::frame, img, storable_picture::is_long_term, colocated_params::is_long_term, storable_picture::JVmotion, storable_picture::motion, motion_params::moving_block, pic_motion_params::mv, motion_params::mv, storable_picture::poc, pic_motion_params::ref_id, pic_motion_params::ref_idx, motion_params::ref_idx, motion_params::ref_pic_id, storable_picture::size_x, storable_picture::size_y, storable_picture::structure, colocated_params::top, storable_picture::top_field, and storable_picture::top_poc.
Referenced by decode_one_slice().
| void dpb_combine_field | ( | 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 3174 of file mbuffer.c.
References frame_store::bottom_field, dpb_combine_field_yuv(), pic_motion_params::field_frame, frame_store::frame, storable_picture::frm_ref_pic_num, storable_picture::max_slice_id, storable_picture::motion, pic_motion_params::mv, pic_motion_params::ref_id, pic_motion_params::ref_idx, storable_picture::ref_pic_num, storable_picture::size_x, storable_picture::size_y, storable_picture::slice_id, and frame_store::top_field.
Referenced by insert_picture_in_dpb().

| void dpb_combine_field_yuv | ( | FrameStore * | fs | ) |
Generate a frame from top and bottom fields, YUV components and display information only.
Definition at line 3115 of file mbuffer.c.
References alloc_storable_picture(), storable_picture::bottom_field, frame_store::bottom_field, storable_picture::bottom_poc, storable_picture::chroma_format_idc, storable_picture::coded_frame, storable_picture::frame, frame_store::frame, storable_picture::frame_cropping_flag, storable_picture::frame_cropping_rect_bottom_offset, storable_picture::frame_cropping_rect_left_offset, storable_picture::frame_cropping_rect_right_offset, storable_picture::frame_cropping_rect_top_offset, storable_picture::frame_poc, storable_picture::imgUV, storable_picture::imgY, storable_picture::is_long_term, frame_store::long_term_frame_idx, storable_picture::long_term_frame_idx, storable_picture::poc, frame_store::poc, storable_picture::size_x, storable_picture::size_x_cr, storable_picture::size_y, storable_picture::size_y_cr, storable_picture::top_field, frame_store::top_field, storable_picture::top_poc, and storable_picture::used_for_reference.
Referenced by direct_output(), dpb_combine_field(), and write_unpaired_field().

| void dpb_split_field | ( | 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 2867 of file mbuffer.c.
References alloc_storable_picture(), storable_picture::bottom_field, frame_store::bottom_field, storable_picture::bottom_poc, storable_picture::bottom_ref_pic_num, storable_picture::chroma_format_idc, storable_picture::coded_frame, pic_motion_params::field_frame, storable_picture::frame, frame_store::frame, storable_picture::frame_mbs_only_flag, storable_picture::frame_poc, storable_picture::frm_ref_pic_num, storable_picture::imgUV, storable_picture::imgY, storable_picture::is_long_term, storable_picture::long_term_frame_idx, frame_store::long_term_frame_idx, storable_picture::max_slice_id, pic_motion_params::mb_field, storable_picture::MbaffFrameFlag, storable_picture::motion, pic_motion_params::mv, storable_picture::poc, frame_store::poc, pic_motion_params::ref_id, pic_motion_params::ref_idx, storable_picture::ref_pic_num, storable_picture::size_x, storable_picture::size_x_cr, storable_picture::size_y, storable_picture::size_y_cr, storable_picture::slice_id, storable_picture::top_field, frame_store::top_field, storable_picture::top_poc, storable_picture::top_ref_pic_num, and storable_picture::used_for_reference.
Referenced by insert_picture_in_dpb().

| void fill_frame_num_gap | ( | ImageParameters * | img | ) |
Tian Dong June 13, 2002, Modifed on July 30, 2003.
If a gap in frame_num is found, try to fill the gap
| img |
Definition at line 3326 of file mbuffer.c.
References storable_picture::adaptive_ref_pic_buffering_flag, alloc_storable_picture(), storable_picture::bottom_poc, storable_picture::coded_frame, decode_poc(), storable_picture::frame_num, storable_picture::frame_poc, storable_picture::is_output, storable_picture::non_existing, storable_picture::pic_num, storable_picture::poc, store_picture_in_dpb(), storable_picture::top_poc, and storable_picture::used_for_reference.
Referenced by init_picture().

| void flush_dpb | ( | void | ) |
All stored picture are output. Should be called to empty the buffer.
Definition at line 2814 of file mbuffer.c.
References conceal_non_ref_pics(), decoded_picture_buffer::fs, img, decoded_picture_buffer::last_output_poc, output_one_frame_from_dpb(), remove_unused_frame_from_dpb(), unmark_for_reference(), and decoded_picture_buffer::used_size.
Referenced by adaptive_memory_management(), conceal_lost_frames(), error(), idr_memory_management(), and main().

| void free_colocated | ( | ColocatedParams * | p | ) |
Free co-located memory.
| p | Picture to be freed |
Definition at line 3439 of file mbuffer.c.
References colocated_params::bottom, colocated_params::frame, free_mem2D(), free_mem3D(), free_mem3Dint64(), free_mem4Dshort(), colocated_params::mb_adaptive_frame_field_flag, motion_params::moving_block, motion_params::mv, motion_params::ref_idx, motion_params::ref_pic_id, and colocated_params::top.
Referenced by main().

| void free_dpb | ( | void | ) |
Free memory for decoded picture buffer.
Definition at line 295 of file mbuffer.c.
References free_frame_store(), free_storable_picture(), decoded_picture_buffer::fs, decoded_picture_buffer::fs_ltref, decoded_picture_buffer::fs_ref, img, decoded_picture_buffer::init_done, decoded_picture_buffer::last_output_poc, and decoded_picture_buffer::size.
Referenced by init_dpb(), and main().

| void free_frame_store | ( | FrameStore * | f | ) |
Free frame store memory.
| f | FrameStore to be freed |
Definition at line 490 of file mbuffer.c.
References frame_store::bottom_field, frame_store::frame, free_storable_picture(), and frame_store::top_field.
Referenced by free_dpb(), idr_memory_management(), and uninit_out_buffer().

| void free_ref_pic_list_reordering_buffer | ( | Slice * | currSlice | ) |
Free memory for buffering of reference picture reordering commands.
Definition at line 3289 of file mbuffer.c.
References Slice::abs_diff_pic_num_minus1_l0, Slice::abs_diff_pic_num_minus1_l1, Slice::long_term_pic_idx_l0, Slice::long_term_pic_idx_l1, Slice::reordering_of_pic_nums_idc_l0, and Slice::reordering_of_pic_nums_idc_l1.
| void free_storable_picture | ( | StorablePicture * | p | ) |
Free picture memory.
| p | Picture to be freed |
Definition at line 562 of file mbuffer.c.
References free_mem2Dpel(), free_mem2Dshort(), free_mem3Dpel(), img, storable_picture::imgUV, storable_picture::imgY, storable_picture::JVmotion, storable_picture::motion, storable_picture::seiHasTone_mapping, 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().

| void init_dpb | ( | void | ) |
Allocate memory for decoded picture buffer and initialize with sane values.
Definition at line 213 of file mbuffer.c.
References alloc_frame_store(), alloc_storable_picture(), storable_picture::bottom_field, error(), storable_picture::frame, free_dpb(), decoded_picture_buffer::fs, decoded_picture_buffer::fs_ltref, decoded_picture_buffer::fs_ref, getDpbSize(), img, decoded_picture_buffer::init_done, decoded_picture_buffer::last_output_poc, decoded_picture_buffer::last_picture, decoded_picture_buffer::ltref_frames_in_buffer, no_mem_exit(), decoded_picture_buffer::num_ref_frames, decoded_picture_buffer::ref_frames_in_buffer, decoded_picture_buffer::size, storable_picture::top_field, and decoded_picture_buffer::used_size.

| void init_lists | ( | int | currSliceType, | |
| PictureStructure | currPicStructure | |||
| ) |
Initialize listX[0] and list 1 depending on current picture type.
KS use >= for error concealment
Definition at line 967 of file mbuffer.c.
References frame_store::bottom_field, compare_fs_by_frame_num_desc(), compare_fs_by_lt_pic_idx_asc(), compare_fs_by_poc_asc(), compare_fs_by_poc_desc(), compare_pic_by_lt_pic_num_asc(), compare_pic_by_pic_num_desc(), compare_pic_by_poc_asc(), compare_pic_by_poc_desc(), frame_store::frame, frame_store::frame_num, frame_store::frame_num_wrap, decoded_picture_buffer::fs_ltref, decoded_picture_buffer::fs_ref, gen_pic_list_from_frame_list(), img, frame_store::is_long_term, storable_picture::is_long_term, frame_store::is_reference, frame_store::is_used, storable_picture::long_term_frame_idx, storable_picture::long_term_pic_num, decoded_picture_buffer::ltref_frames_in_buffer, no_mem_exit(), storable_picture::pic_num, frame_store::poc, storable_picture::poc, decoded_picture_buffer::ref_frames_in_buffer, decoded_picture_buffer::size, frame_store::top_field, and storable_picture::used_for_reference.
Referenced by copy_to_conceal(), and read_new_slice().

| void init_mbaff_lists | ( | void | ) |
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 1333 of file mbuffer.c.
References storable_picture::bottom_field, and storable_picture::top_field.
Referenced by read_new_slice().
| void reorder_ref_pic_list | ( | StorablePicture ** | list, | |
| int * | 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 1497 of file mbuffer.c.
References error(), img, reorder_long_term(), and reorder_short_term().

| void store_picture_in_dpb | ( | 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.
| p | Picture to be stored |
Definition at line 2287 of file mbuffer.c.
References adaptive_memory_management(), storable_picture::adaptive_ref_pic_buffering_flag, check_num_ref(), conceal_non_ref_pics(), frame_store::concealment_reference, direct_output(), dump_dpb(), error(), storable_picture::frame_num, frame_store::frame_num, decoded_picture_buffer::fs, decoded_picture_buffer::fs_ref, get_smallest_poc(), storable_picture::idr_flag, idr_memory_management(), img, insert_picture_in_dpb(), storable_picture::is_long_term, frame_store::is_orig_reference, frame_store::is_reference, frame_store::is_used, decoded_picture_buffer::last_picture, output_one_frame_from_dpb(), p_out, storable_picture::pic_num, storable_picture::poc, decoded_picture_buffer::ref_frames_in_buffer, remove_unused_frame_from_dpb(), decoded_picture_buffer::size, sliding_window_memory_management(), sliding_window_poc_management(), storable_picture::structure, update_ltref_list(), update_ref_list(), storable_picture::used_for_reference, and decoded_picture_buffer::used_size.
Referenced by conceal_lost_frames(), exit_picture(), and fill_frame_num_gap().
