|
14 | 14 | #include <media/v4l2-h264.h> |
15 | 15 |
|
16 | 16 | #include "trace.h" |
17 | | -#include "uapi.h" |
18 | 17 | #include "vde.h" |
19 | 18 |
|
| 19 | +#define FLAG_B_FRAME 0x1 |
| 20 | +#define FLAG_REFERENCE 0x2 |
| 21 | + |
| 22 | +struct tegra_vde_h264_frame { |
| 23 | + unsigned int frame_num; |
| 24 | + unsigned int flags; |
| 25 | +}; |
| 26 | + |
| 27 | +struct tegra_vde_h264_decoder_ctx { |
| 28 | + unsigned int dpb_frames_nb; |
| 29 | + unsigned int dpb_ref_frames_with_earlier_poc_nb; |
| 30 | + unsigned int baseline_profile; |
| 31 | + unsigned int level_idc; |
| 32 | + unsigned int log2_max_pic_order_cnt_lsb; |
| 33 | + unsigned int log2_max_frame_num; |
| 34 | + unsigned int pic_order_cnt_type; |
| 35 | + unsigned int direct_8x8_inference_flag; |
| 36 | + unsigned int pic_width_in_mbs; |
| 37 | + unsigned int pic_height_in_mbs; |
| 38 | + unsigned int pic_init_qp; |
| 39 | + unsigned int deblocking_filter_control_present_flag; |
| 40 | + unsigned int constrained_intra_pred_flag; |
| 41 | + unsigned int chroma_qp_index_offset; |
| 42 | + unsigned int pic_order_present_flag; |
| 43 | + unsigned int num_ref_idx_l0_active_minus1; |
| 44 | + unsigned int num_ref_idx_l1_active_minus1; |
| 45 | +}; |
| 46 | + |
20 | 47 | struct h264_reflists { |
21 | 48 | u8 p[V4L2_H264_NUM_DPB_ENTRIES]; |
22 | 49 | u8 b0[V4L2_H264_NUM_DPB_ENTRIES]; |
@@ -438,19 +465,8 @@ static void tegra_vde_decode_frame(struct tegra_vde *vde, |
438 | 465 | vde->sxe, 0x00); |
439 | 466 | } |
440 | 467 |
|
441 | | -int tegra_vde_validate_h264_frame(struct device *dev, |
442 | | - struct tegra_vde_h264_frame *frame) |
443 | | -{ |
444 | | - if (frame->frame_num > 0x7FFFFF) { |
445 | | - dev_err(dev, "Bad frame_num %u\n", frame->frame_num); |
446 | | - return -EINVAL; |
447 | | - } |
448 | | - |
449 | | - return 0; |
450 | | -} |
451 | | - |
452 | | -int tegra_vde_validate_h264_ctx(struct device *dev, |
453 | | - struct tegra_vde_h264_decoder_ctx *ctx) |
| 468 | +static int tegra_vde_validate_h264_ctx(struct device *dev, |
| 469 | + struct tegra_vde_h264_decoder_ctx *ctx) |
454 | 470 | { |
455 | 471 | if (ctx->dpb_frames_nb == 0 || ctx->dpb_frames_nb > 17) { |
456 | 472 | dev_err(dev, "Bad DPB size %u\n", ctx->dpb_frames_nb); |
@@ -637,23 +653,6 @@ static int tegra_vde_decode_end(struct tegra_vde *vde) |
637 | 653 | return ret; |
638 | 654 | } |
639 | 655 |
|
640 | | -int tegra_vde_decode_h264(struct tegra_vde *vde, |
641 | | - struct tegra_vde_h264_decoder_ctx *ctx, |
642 | | - struct tegra_video_frame *dpb_frames, |
643 | | - dma_addr_t bitstream_data_addr, |
644 | | - size_t bitstream_data_size) |
645 | | -{ |
646 | | - int err; |
647 | | - |
648 | | - err = tegra_vde_decode_begin(vde, ctx, dpb_frames, |
649 | | - bitstream_data_addr, |
650 | | - bitstream_data_size); |
651 | | - if (err) |
652 | | - return err; |
653 | | - |
654 | | - return tegra_vde_decode_end(vde); |
655 | | -} |
656 | | - |
657 | 656 | static struct vb2_buffer *get_ref_buf(struct tegra_ctx *ctx, |
658 | 657 | struct vb2_v4l2_buffer *dst, |
659 | 658 | unsigned int dpb_idx) |
|
0 commit comments