Commit 892e23a5b introduced support for the VP8D_GET_LAST_REF_USED, but missed the mapping of the control id to the underlying function, so it was unavailable to applications. In addition, the underlying function vp8_references_buffer() is moved from common/postproc.c to decoder/onyxd_if.c as postproc.c is not built in all configurations.
Unified · Split
| @@ -696,23 +696,6 @@ static void constrain_line (int x0, int *x1, int y0, int *y1, int width, int hei · 695 unmodified lines | |||
| 696 | } | 696 | } |
| 697 | } | 697 | } |
| 698 | 698 | ||
| 699 | int vp8_references_buffer( VP8_COMMON *oci, int ref_frame ) | ||
| 700 | { | ||
| 701 | const MODE_INFO *mi = oci->mi; | ||
| 702 | int mb_row, mb_col; | ||
| 703 | |||
| 704 | for (mb_row = 0; mb_row < oci->mb_rows; mb_row++) | ||
| 705 | { | ||
| 706 | for (mb_col = 0; mb_col < oci->mb_cols; mb_col++,mi++) | ||
| 707 | { | ||
| 708 | if( mi->mbmi.ref_frame == ref_frame) | ||
| 709 | return 1; | ||
| 710 | } | ||
| 711 | mi++; | ||
| 712 | } | ||
| 713 | return 0; | ||
| 714 | |||
| 715 | } | ||
| 716 | 699 | ||
| 717 | static void multiframe_quality_enhance_block | 700 | static void multiframe_quality_enhance_block |
| 718 | ( | 701 | ( |
| @@ -606,3 +606,26 @@ int vp8dx_get_raw_frame(VP8D_COMP *pbi, YV12_BUFFER_CONFIG *sd, int64_t *time_st · 605 unmodified lines | |||
| 606 | vp8_clear_system_state(); | 606 | vp8_clear_system_state(); |
| 607 | return ret; | 607 | return ret; |
| 608 | } | 608 | } |
| 609 | |||
| 610 | |||
| 611 | /* This function as written isn't decoder specific, but the encoder has | ||
| 612 | * much faster ways of computing this, so it's ok for it to live in a | ||
| 613 | * decode specific file. | ||
| 614 | */ | ||
| 615 | int vp8dx_references_buffer( VP8_COMMON *oci, int ref_frame ) | ||
| 616 | { | ||
| 617 | const MODE_INFO *mi = oci->mi; | ||
| 618 | int mb_row, mb_col; | ||
| 619 | |||
| 620 | for (mb_row = 0; mb_row < oci->mb_rows; mb_row++) | ||
| 621 | { | ||
| 622 | for (mb_col = 0; mb_col < oci->mb_cols; mb_col++,mi++) | ||
| 623 | { | ||
| 624 | if( mi->mbmi.ref_frame == ref_frame) | ||
| 625 | return 1; | ||
| 626 | } | ||
| 627 | mi++; | ||
| 628 | } | ||
| 629 | return 0; | ||
| 630 | |||
| 631 | } | ||
| @@ -700,7 +700,7 @@ static vpx_codec_err_t vp8_get_last_ref_updates(vpx_codec_alg_priv_t *ctx, · 699 unmodified lines | |||
| 700 | return VPX_CODEC_INVALID_PARAM; | 700 | return VPX_CODEC_INVALID_PARAM; |
| 701 | } | 701 | } |
| 702 | 702 | ||
| 703 | extern int vp8_references_buffer( VP8_COMMON *oci, int ref_frame ); | 703 | extern int vp8dx_references_buffer( VP8_COMMON *oci, int ref_frame ); |
| 704 | static vpx_codec_err_t vp8_get_last_ref_frame(vpx_codec_alg_priv_t *ctx, | 704 | static vpx_codec_err_t vp8_get_last_ref_frame(vpx_codec_alg_priv_t *ctx, |
| 705 | int ctrl_id, | 705 | int ctrl_id, |
| 706 | va_list args) | 706 | va_list args) |
| @@ -712,9 +712,9 @@ static vpx_codec_err_t vp8_get_last_ref_frame(vpx_codec_alg_priv_t *ctx, · 5 unmodified lines | |||
| 712 | if (ref_info) | 712 | if (ref_info) |
| 713 | { | 713 | { |
| 714 | *ref_info = | 714 | *ref_info = |
| 715 | (vp8_references_buffer( oci, ALTREF_FRAME )?VP8_ALTR_FRAME:0) | | 715 | (vp8dx_references_buffer( oci, ALTREF_FRAME )?VP8_ALTR_FRAME:0) | |
| 716 | (vp8_references_buffer( oci, GOLDEN_FRAME )?VP8_GOLD_FRAME:0) | | 716 | (vp8dx_references_buffer( oci, GOLDEN_FRAME )?VP8_GOLD_FRAME:0) | |
| 717 | (vp8_references_buffer( oci, LAST_FRAME )?VP8_LAST_FRAME:0); | 717 | (vp8dx_references_buffer( oci, LAST_FRAME )?VP8_LAST_FRAME:0); |
| 718 | 718 | ||
| 719 | return VPX_CODEC_OK; | 719 | return VPX_CODEC_OK; |
| 720 | } | 720 | } |
| @@ -752,6 +752,7 @@ vpx_codec_ctrl_fn_map_t vp8_ctf_maps[] = · 31 unmodified lines | |||
| 752 | {VP8_SET_DBG_DISPLAY_MV, vp8_set_dbg_options}, | 752 | {VP8_SET_DBG_DISPLAY_MV, vp8_set_dbg_options}, |
| 753 | {VP8D_GET_LAST_REF_UPDATES, vp8_get_last_ref_updates}, | 753 | {VP8D_GET_LAST_REF_UPDATES, vp8_get_last_ref_updates}, |
| 754 | {VP8D_GET_FRAME_CORRUPTED, vp8_get_frame_corrupted}, | 754 | {VP8D_GET_FRAME_CORRUPTED, vp8_get_frame_corrupted}, |
| 755 | {VP8D_GET_LAST_REF_USED, vp8_get_last_ref_frame}, | ||
| 755 | { -1, NULL}, | 756 | { -1, NULL}, |
| 756 | }; | 757 | }; |
| 757 | 758 | ||