mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-19 07:24:34 +08:00
[h264d]: fix field combination error
Change-Id: Iad69f04299911d3b593d6719eff80e8c6436e5d8 Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
This commit is contained in:

committed by
Herman Chen

parent
cfa8d380bd
commit
0250dab00c
@@ -1313,7 +1313,7 @@ MPP_RET store_picture_in_dpb(H264_DpbBuf_t *p_Dpb, H264_StorePic_t *p)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//!< if necessary, combine top and botteom to frame
|
//!< if necessary, combine top and botteom to frame
|
||||||
if (get_filed_dpb_combine_flag(p_Dpb->last_picture, p)) {
|
if (get_field_dpb_combine_flag(p_Dpb->last_picture, p)) {
|
||||||
if (p_Dpb->last_picture->is_directout) {
|
if (p_Dpb->last_picture->is_directout) {
|
||||||
FUN_CHECK(ret = direct_output(p_Vid, p_Dpb, p)); //!< output frame
|
FUN_CHECK(ret = direct_output(p_Vid, p_Dpb, p)); //!< output frame
|
||||||
} else {
|
} else {
|
||||||
@@ -1677,13 +1677,13 @@ __FAILED:
|
|||||||
***********************************************************************
|
***********************************************************************
|
||||||
*/
|
*/
|
||||||
//extern "C"
|
//extern "C"
|
||||||
RK_U32 get_filed_dpb_combine_flag(H264_FrameStore_t *p_last, H264_StorePic_t *p)
|
RK_U32 get_field_dpb_combine_flag(H264_FrameStore_t *p_last, H264_StorePic_t *p)
|
||||||
{
|
{
|
||||||
RK_U32 combine_flag = 0;
|
RK_U32 combine_flag = 0;
|
||||||
|
|
||||||
if ((p->structure == TOP_FIELD) || (p->structure == BOTTOM_FIELD)) {
|
if ((p->structure == TOP_FIELD) || (p->structure == BOTTOM_FIELD)) {
|
||||||
// check for frame store with same pic_number
|
// check for frame store with same pic_number
|
||||||
if (p_last) {
|
if (p_last && (p_last->structure == TOP_FIELD || p_last->structure == BOTTOM_FIELD)) {
|
||||||
if ((RK_S32)p_last->frame_num == p->pic_num) {
|
if ((RK_S32)p_last->frame_num == p->pic_num) {
|
||||||
if (((p->structure == TOP_FIELD) && (p_last->is_used == 2))
|
if (((p->structure == TOP_FIELD) && (p_last->is_used == 2))
|
||||||
|| ((p->structure == BOTTOM_FIELD) && (p_last->is_used == 1))) {
|
|| ((p->structure == BOTTOM_FIELD) && (p_last->is_used == 1))) {
|
||||||
|
@@ -44,7 +44,7 @@ MPP_RET output_dpb (H264_DecCtx_t *p_Dec, H264_DpbBuf_t *p_Dpb);
|
|||||||
void free_dpb (H264_DpbBuf_t *p_Dpb);
|
void free_dpb (H264_DpbBuf_t *p_Dpb);
|
||||||
MPP_RET exit_picture(H264dVideoCtx_t *p_Vid, H264_StorePic_t **dec_pic);
|
MPP_RET exit_picture(H264dVideoCtx_t *p_Vid, H264_StorePic_t **dec_pic);
|
||||||
|
|
||||||
RK_U32 get_filed_dpb_combine_flag(H264_FrameStore_t *p_last, H264_StorePic_t *p);
|
RK_U32 get_field_dpb_combine_flag(H264_FrameStore_t *p_last, H264_StorePic_t *p);
|
||||||
H264_StorePic_t *alloc_storable_picture(H264dVideoCtx_t *p_Vid, RK_S32 structure);
|
H264_StorePic_t *alloc_storable_picture(H264dVideoCtx_t *p_Vid, RK_S32 structure);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@@ -655,7 +655,7 @@ static MPP_RET alloc_decpic(H264_SLICE_t *currSlice)
|
|||||||
dec_pic->height = p_Vid->height;
|
dec_pic->height = p_Vid->height;
|
||||||
dec_pic->width_after_crop = p_Vid->width_after_crop;
|
dec_pic->width_after_crop = p_Vid->width_after_crop;
|
||||||
dec_pic->height_after_crop = p_Vid->height_after_crop;
|
dec_pic->height_after_crop = p_Vid->height_after_crop;
|
||||||
dec_pic->combine_flag = get_filed_dpb_combine_flag(p_Dpb->last_picture, dec_pic);
|
dec_pic->combine_flag = get_field_dpb_combine_flag(p_Dpb->last_picture, dec_pic);
|
||||||
/* malloc dpb_memory */
|
/* malloc dpb_memory */
|
||||||
FUN_CHECK(ret = dpb_mark_malloc(p_Vid, dec_pic));
|
FUN_CHECK(ret = dpb_mark_malloc(p_Vid, dec_pic));
|
||||||
FUN_CHECK(ret = check_dpb_discontinuous(p_Vid->last_pic, dec_pic, currSlice));
|
FUN_CHECK(ret = check_dpb_discontinuous(p_Vid->last_pic, dec_pic, currSlice));
|
||||||
|
Reference in New Issue
Block a user