| @@ -804,6 +804,88 @@ enum v4l2_mpeg_video_frame_skip_mode { · 803 unmodified lines |
| 804 | #define V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY (V4L2_CID_CODEC_BASE + 653) | 804 | #define V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY (V4L2_CID_CODEC_BASE + 653) |
| 805 | #define V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY_ENABLE (V4L2_CID_CODEC_BASE + 654) | 805 | #define V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY_ENABLE (V4L2_CID_CODEC_BASE + 654) |
| 806 | | 806 | |
| | 807 | #define V4L2_CID_MPEG_VIDEO_AV1_PROFILE (V4L2_CID_CODEC_BASE + 655) |
| | 808 | /** |
| | 809 | * enum v4l2_mpeg_video_av1_profile - AV1 profiles |
| | 810 | * |
| | 811 | * @V4L2_MPEG_VIDEO_AV1_PROFILE_MAIN: compliant decoders must be able to decode |
| | 812 | * streams with seq_profile equal to 0. |
| | 813 | * @V4L2_MPEG_VIDEO_AV1_PROFILE_HIGH: compliant decoders must be able to decode |
| | 814 | * streams with seq_profile equal less than or equal to 1. |
| | 815 | * @V4L2_MPEG_VIDEO_AV1_PROFILE_PROFESSIONAL: compliant decoders must be able to |
| | 816 | * decode streams with seq_profile less than or equal to 2. |
| | 817 | * |
| | 818 | * Conveys the highest profile a decoder can work with. |
| | 819 | */ |
| | 820 | enum v4l2_mpeg_video_av1_profile { |
| | 821 | V4L2_MPEG_VIDEO_AV1_PROFILE_MAIN = 0, |
| | 822 | V4L2_MPEG_VIDEO_AV1_PROFILE_HIGH = 1, |
| | 823 | V4L2_MPEG_VIDEO_AV1_PROFILE_PROFESSIONAL = 2, |
| | 824 | }; |
| | 825 | |
| | 826 | #define V4L2_CID_MPEG_VIDEO_AV1_LEVEL (V4L2_CID_CODEC_BASE + 656) |
| | 827 | /** |
| | 828 | * enum v4l2_mpeg_video_av1_level - AV1 levels |
| | 829 | * |
| | 830 | * @V4L2_MPEG_VIDEO_AV1_LEVEL_2_0: Level 2.0. |
| | 831 | * @V4L2_MPEG_VIDEO_AV1_LEVEL_2_1: Level 2.1. |
| | 832 | * @V4L2_MPEG_VIDEO_AV1_LEVEL_2_2: Level 2.2. |
| | 833 | * @V4L2_MPEG_VIDEO_AV1_LEVEL_2_3: Level 2.3. |
| | 834 | * @V4L2_MPEG_VIDEO_AV1_LEVEL_3_0: Level 3.0. |
| | 835 | * @V4L2_MPEG_VIDEO_AV1_LEVEL_3_1: Level 3.1. |
| | 836 | * @V4L2_MPEG_VIDEO_AV1_LEVEL_3_2: Level 3.2. |
| | 837 | * @V4L2_MPEG_VIDEO_AV1_LEVEL_3_3: Level 3.3. |
| | 838 | * @V4L2_MPEG_VIDEO_AV1_LEVEL_4_0: Level 4.0. |
| | 839 | * @V4L2_MPEG_VIDEO_AV1_LEVEL_4_1: Level 4.1. |
| | 840 | * @V4L2_MPEG_VIDEO_AV1_LEVEL_4_2: Level 4.2. |
| | 841 | * @V4L2_MPEG_VIDEO_AV1_LEVEL_4_3: Level 4.3. |
| | 842 | * @V4L2_MPEG_VIDEO_AV1_LEVEL_5_0: Level 5.0. |
| | 843 | * @V4L2_MPEG_VIDEO_AV1_LEVEL_5_1: Level 5.1. |
| | 844 | * @V4L2_MPEG_VIDEO_AV1_LEVEL_5_2: Level 5.2. |
| | 845 | * @V4L2_MPEG_VIDEO_AV1_LEVEL_5_3: Level 5.3. |
| | 846 | * @V4L2_MPEG_VIDEO_AV1_LEVEL_6_0: Level 6.0. |
| | 847 | * @V4L2_MPEG_VIDEO_AV1_LEVEL_6_1: Level 6.1. |
| | 848 | * @V4L2_MPEG_VIDEO_AV1_LEVEL_6_2: Level 6.2. |
| | 849 | * @V4L2_MPEG_VIDEO_AV1_LEVEL_6_3: Level 6.3. |
| | 850 | * @V4L2_MPEG_VIDEO_AV1_LEVEL_7_0: Level 7.0. |
| | 851 | * @V4L2_MPEG_VIDEO_AV1_LEVEL_7_1: Level 7.1. |
| | 852 | * @V4L2_MPEG_VIDEO_AV1_LEVEL_7_2: Level 7.2. |
| | 853 | * @V4L2_MPEG_VIDEO_AV1_LEVEL_7_3: Level 7.3. |
| | 854 | * |
| | 855 | * Conveys the highest level a decoder can work with. |
| | 856 | */ |
| | 857 | enum v4l2_mpeg_video_av1_level { |
| | 858 | V4L2_MPEG_VIDEO_AV1_LEVEL_2_0 = 0, |
| | 859 | V4L2_MPEG_VIDEO_AV1_LEVEL_2_1 = 1, |
| | 860 | V4L2_MPEG_VIDEO_AV1_LEVEL_2_2 = 2, |
| | 861 | V4L2_MPEG_VIDEO_AV1_LEVEL_2_3 = 3, |
| | 862 | |
| | 863 | V4L2_MPEG_VIDEO_AV1_LEVEL_3_0 = 4, |
| | 864 | V4L2_MPEG_VIDEO_AV1_LEVEL_3_1 = 5, |
| | 865 | V4L2_MPEG_VIDEO_AV1_LEVEL_3_2 = 6, |
| | 866 | V4L2_MPEG_VIDEO_AV1_LEVEL_3_3 = 7, |
| | 867 | |
| | 868 | V4L2_MPEG_VIDEO_AV1_LEVEL_4_0 = 8, |
| | 869 | V4L2_MPEG_VIDEO_AV1_LEVEL_4_1 = 9, |
| | 870 | V4L2_MPEG_VIDEO_AV1_LEVEL_4_2 = 10, |
| | 871 | V4L2_MPEG_VIDEO_AV1_LEVEL_4_3 = 11, |
| | 872 | |
| | 873 | V4L2_MPEG_VIDEO_AV1_LEVEL_5_0 = 12, |
| | 874 | V4L2_MPEG_VIDEO_AV1_LEVEL_5_1 = 13, |
| | 875 | V4L2_MPEG_VIDEO_AV1_LEVEL_5_2 = 14, |
| | 876 | V4L2_MPEG_VIDEO_AV1_LEVEL_5_3 = 15, |
| | 877 | |
| | 878 | V4L2_MPEG_VIDEO_AV1_LEVEL_6_0 = 16, |
| | 879 | V4L2_MPEG_VIDEO_AV1_LEVEL_6_1 = 17, |
| | 880 | V4L2_MPEG_VIDEO_AV1_LEVEL_6_2 = 18, |
| | 881 | V4L2_MPEG_VIDEO_AV1_LEVEL_6_3 = 19, |
| | 882 | |
| | 883 | V4L2_MPEG_VIDEO_AV1_LEVEL_7_0 = 20, |
| | 884 | V4L2_MPEG_VIDEO_AV1_LEVEL_7_1 = 21, |
| | 885 | V4L2_MPEG_VIDEO_AV1_LEVEL_7_2 = 22, |
| | 886 | V4L2_MPEG_VIDEO_AV1_LEVEL_7_3 = 23 |
| | 887 | }; |
| | 888 | |
| 807 | /* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */ | 889 | /* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */ |
| 808 | #define V4L2_CID_CODEC_CX2341X_BASE (V4L2_CTRL_CLASS_CODEC | 0x1000) | 890 | #define V4L2_CID_CODEC_CX2341X_BASE (V4L2_CTRL_CLASS_CODEC | 0x1000) |
| 809 | #define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_CODEC_CX2341X_BASE+0) | 891 | #define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_CODEC_CX2341X_BASE+0) |
| @@ -2385,6 +2467,9 @@ struct v4l2_ctrl_hevc_slice_params { · 1575 unmodified lines |
| 2385 | * @poc_st_curr_after: provides the index of the short term after references | 2467 | * @poc_st_curr_after: provides the index of the short term after references |
| 2386 | * in DPB array | 2468 | * in DPB array |
| 2387 | * @poc_lt_curr: provides the index of the long term references in DPB array | 2469 | * @poc_lt_curr: provides the index of the long term references in DPB array |
| | 2470 | * @num_delta_pocs_of_ref_rps_idx: same as the derived value NumDeltaPocs[RefRpsIdx], |
| | 2471 | * can be used to parse the RPS data in slice headers |
| | 2472 | * instead of skipping it with @short_term_ref_pic_set_size. |
| 2388 | * @reserved: padding field. Should be zeroed by applications. | 2473 | * @reserved: padding field. Should be zeroed by applications. |
| 2389 | * @dpb: the decoded picture buffer, for meta-data about reference frames | 2474 | * @dpb: the decoded picture buffer, for meta-data about reference frames |
| 2390 | * @flags: see V4L2_HEVC_DECODE_PARAM_FLAG_{} | 2475 | * @flags: see V4L2_HEVC_DECODE_PARAM_FLAG_{} |
| @@ -2400,7 +2485,8 @@ struct v4l2_ctrl_hevc_decode_params { · 9 unmodified lines |
| 2400 | __u8 poc_st_curr_before[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]; | 2485 | __u8 poc_st_curr_before[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]; |
| 2401 | __u8 poc_st_curr_after[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]; | 2486 | __u8 poc_st_curr_after[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]; |
| 2402 | __u8 poc_lt_curr[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]; | 2487 | __u8 poc_lt_curr[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]; |
| 2403 | __u8 reserved[4]; | 2488 | __u8 num_delta_pocs_of_ref_rps_idx; |
| | 2489 | __u8 reserved[3]; |
| 2404 | struct v4l2_hevc_dpb_entry dpb[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]; | 2490 | struct v4l2_hevc_dpb_entry dpb[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]; |
| 2405 | __u64 flags; | 2491 | __u64 flags; |
| 2406 | }; | 2492 | }; |
| @@ -2754,6 +2840,645 @@ struct v4l2_ctrl_vp9_compressed_hdr { · 347 unmodified lines |
| 2754 | struct v4l2_vp9_mv_probs mv; | 2840 | struct v4l2_vp9_mv_probs mv; |
| 2755 | }; | 2841 | }; |
| 2756 | | 2842 | |
| | 2843 | /* Stateless AV1 controls */ |
| | 2844 | |
| | 2845 | #define V4L2_AV1_TOTAL_REFS_PER_FRAME 8 |
| | 2846 | #define V4L2_AV1_CDEF_MAX 8 |
| | 2847 | #define V4L2_AV1_NUM_PLANES_MAX 3 /* 1 if monochrome, 3 otherwise */ |
| | 2848 | #define V4L2_AV1_MAX_SEGMENTS 8 |
| | 2849 | #define V4L2_AV1_MAX_OPERATING_POINTS (1 << 5) /* 5 bits to encode */ |
| | 2850 | #define V4L2_AV1_REFS_PER_FRAME 7 |
| | 2851 | #define V4L2_AV1_MAX_NUM_Y_POINTS (1 << 4) /* 4 bits to encode */ |
| | 2852 | #define V4L2_AV1_MAX_NUM_CB_POINTS (1 << 4) /* 4 bits to encode */ |
| | 2853 | #define V4L2_AV1_MAX_NUM_CR_POINTS (1 << 4) /* 4 bits to encode */ |
| | 2854 | #define V4L2_AV1_AR_COEFFS_SIZE 25 /* (2 * 3 * (3 + 1)) + 1 */ |
| | 2855 | #define V4L2_AV1_MAX_NUM_PLANES 3 |
| | 2856 | #define V4L2_AV1_MAX_TILE_COLS 64 |
| | 2857 | #define V4L2_AV1_MAX_TILE_ROWS 64 |
| | 2858 | #define V4L2_AV1_MAX_TILE_COUNT 512 |
| | 2859 | |
| | 2860 | #define V4L2_AV1_SEQUENCE_FLAG_STILL_PICTURE 0x00000001 |
| | 2861 | #define V4L2_AV1_SEQUENCE_FLAG_USE_128X128_SUPERBLOCK 0x00000002 |
| | 2862 | #define V4L2_AV1_SEQUENCE_FLAG_ENABLE_FILTER_INTRA 0x00000004 |
| | 2863 | #define V4L2_AV1_SEQUENCE_FLAG_ENABLE_INTRA_EDGE_FILTER 0x00000008 |
| | 2864 | #define V4L2_AV1_SEQUENCE_FLAG_ENABLE_INTERINTRA_COMPOUND 0x00000010 |
| | 2865 | #define V4L2_AV1_SEQUENCE_FLAG_ENABLE_MASKED_COMPOUND 0x00000020 |
| | 2866 | #define V4L2_AV1_SEQUENCE_FLAG_ENABLE_WARPED_MOTION 0x00000040 |
| | 2867 | #define V4L2_AV1_SEQUENCE_FLAG_ENABLE_DUAL_FILTER 0x00000080 |
| | 2868 | #define V4L2_AV1_SEQUENCE_FLAG_ENABLE_ORDER_HINT 0x00000100 |
| | 2869 | #define V4L2_AV1_SEQUENCE_FLAG_ENABLE_JNT_COMP 0x00000200 |
| | 2870 | #define V4L2_AV1_SEQUENCE_FLAG_ENABLE_REF_FRAME_MVS 0x00000400 |
| | 2871 | #define V4L2_AV1_SEQUENCE_FLAG_ENABLE_SUPERRES 0x00000800 |
| | 2872 | #define V4L2_AV1_SEQUENCE_FLAG_ENABLE_CDEF 0x00001000 |
| | 2873 | #define V4L2_AV1_SEQUENCE_FLAG_ENABLE_RESTORATION 0x00002000 |
| | 2874 | #define V4L2_AV1_SEQUENCE_FLAG_MONO_CHROME 0x00004000 |
| | 2875 | #define V4L2_AV1_SEQUENCE_FLAG_COLOR_RANGE 0x00008000 |
| | 2876 | #define V4L2_AV1_SEQUENCE_FLAG_SUBSAMPLING_X 0x00010000 |
| | 2877 | #define V4L2_AV1_SEQUENCE_FLAG_SUBSAMPLING_Y 0x00020000 |
| | 2878 | #define V4L2_AV1_SEQUENCE_FLAG_FILM_GRAIN_PARAMS_PRESENT 0x00040000 |
| | 2879 | #define V4L2_AV1_SEQUENCE_FLAG_SEPARATE_UV_DELTA_Q 0x00080000 |
| | 2880 | |
| | 2881 | #define V4L2_CID_STATELESS_AV1_SEQUENCE (V4L2_CID_CODEC_STATELESS_BASE + 500) |
| | 2882 | /** |
| | 2883 | * struct v4l2_ctrl_av1_sequence - AV1 Sequence |
| | 2884 | * |
| | 2885 | * Represents an AV1 Sequence OBU. See section 5.5 "Sequence header OBU syntax" |
| | 2886 | * for more details. |
| | 2887 | * |
| | 2888 | * @flags: See V4L2_AV1_SEQUENCE_FLAG_{}. |
| | 2889 | * @seq_profile: specifies the features that can be used in the coded video |
| | 2890 | * sequence. |
| | 2891 | * @order_hint_bits: specifies the number of bits used for the order_hint field |
| | 2892 | * at each frame. |
| | 2893 | * @bit_depth: the bitdepth to use for the sequence as described in section |
| | 2894 | * 5.5.2 "Color config syntax". |
| | 2895 | * @reserved: padding field. Should be zeroed by applications. |
| | 2896 | * @max_frame_width_minus_1: specifies the maximum frame width minus 1 for the |
| | 2897 | * frames represented by this sequence header. |
| | 2898 | * @max_frame_height_minus_1: specifies the maximum frame height minus 1 for the |
| | 2899 | * frames represented by this sequence header. |
| | 2900 | */ |
| | 2901 | struct v4l2_ctrl_av1_sequence { |
| | 2902 | __u32 flags; |
| | 2903 | __u8 seq_profile; |
| | 2904 | __u8 order_hint_bits; |
| | 2905 | __u8 bit_depth; |
| | 2906 | __u8 reserved; |
| | 2907 | __u16 max_frame_width_minus_1; |
| | 2908 | __u16 max_frame_height_minus_1; |
| | 2909 | }; |
| | 2910 | |
| | 2911 | #define V4L2_CID_STATELESS_AV1_TILE_GROUP_ENTRY (V4L2_CID_CODEC_STATELESS_BASE + 501) |
| | 2912 | /** |
| | 2913 | * struct v4l2_ctrl_av1_tile_group_entry - AV1 Tile Group entry |
| | 2914 | * |
| | 2915 | * Represents a single AV1 tile inside an AV1 Tile Group. Note that MiRowStart, |
| | 2916 | * MiRowEnd, MiColStart and MiColEnd can be retrieved from struct |
| | 2917 | * v4l2_av1_tile_info in struct v4l2_ctrl_av1_frame using tile_row and |
| | 2918 | * tile_col. See section 6.10.1 "General tile group OBU semantics" for more |
| | 2919 | * details. |
| | 2920 | * |
| | 2921 | * @tile_offset: offset from the OBU data, i.e. where the coded tile data |
| | 2922 | * actually starts. |
| | 2923 | * @tile_size: specifies the size in bytes of the coded tile. Equivalent to |
| | 2924 | * "TileSize" in the AV1 Specification. |
| | 2925 | * @tile_row: specifies the row of the current tile. Equivalent to "TileRow" in |
| | 2926 | * the AV1 Specification. |
| | 2927 | * @tile_col: specifies the col of the current tile. Equivalent to "TileCol" in |
| | 2928 | * the AV1 Specification. |
| | 2929 | */ |
| | 2930 | struct v4l2_ctrl_av1_tile_group_entry { |
| | 2931 | __u32 tile_offset; |
| | 2932 | __u32 tile_size; |
| | 2933 | __u32 tile_row; |
| | 2934 | __u32 tile_col; |
| | 2935 | }; |
| | 2936 | |
| | 2937 | /** |
| | 2938 | * enum v4l2_av1_warp_model - AV1 Warp Model as described in section 3 |
| | 2939 | * "Symbols and abbreviated terms" of the AV1 Specification. |
| | 2940 | * |
| | 2941 | * @V4L2_AV1_WARP_MODEL_IDENTITY: Warp model is just an identity transform. |
| | 2942 | * @V4L2_AV1_WARP_MODEL_TRANSLATION: Warp model is a pure translation. |
| | 2943 | * @V4L2_AV1_WARP_MODEL_ROTZOOM: Warp model is a rotation + symmetric zoom + |
| | 2944 | * translation. |
| | 2945 | * @V4L2_AV1_WARP_MODEL_AFFINE: Warp model is a general affine transform. |
| | 2946 | */ |
| | 2947 | enum v4l2_av1_warp_model { |
| | 2948 | V4L2_AV1_WARP_MODEL_IDENTITY = 0, |
| | 2949 | V4L2_AV1_WARP_MODEL_TRANSLATION = 1, |
| | 2950 | V4L2_AV1_WARP_MODEL_ROTZOOM = 2, |
| | 2951 | V4L2_AV1_WARP_MODEL_AFFINE = 3, |
| | 2952 | }; |
| | 2953 | |
| | 2954 | /** |
| | 2955 | * enum v4l2_av1_reference_frame - AV1 reference frames |
| | 2956 | * |
| | 2957 | * @V4L2_AV1_REF_INTRA_FRAME: Intra Frame Reference |
| | 2958 | * @V4L2_AV1_REF_LAST_FRAME: Last Reference Frame |
| | 2959 | * @V4L2_AV1_REF_LAST2_FRAME: Last2 Reference Frame |
| | 2960 | * @V4L2_AV1_REF_LAST3_FRAME: Last3 Reference Frame |
| | 2961 | * @V4L2_AV1_REF_GOLDEN_FRAME: Golden Reference Frame |
| | 2962 | * @V4L2_AV1_REF_BWDREF_FRAME: BWD Reference Frame |
| | 2963 | * @V4L2_AV1_REF_ALTREF2_FRAME: Alternative2 Reference Frame |
| | 2964 | * @V4L2_AV1_REF_ALTREF_FRAME: Alternative Reference Frame |
| | 2965 | */ |
| | 2966 | enum v4l2_av1_reference_frame { |
| | 2967 | V4L2_AV1_REF_INTRA_FRAME = 0, |
| | 2968 | V4L2_AV1_REF_LAST_FRAME = 1, |
| | 2969 | V4L2_AV1_REF_LAST2_FRAME = 2, |
| | 2970 | V4L2_AV1_REF_LAST3_FRAME = 3, |
| | 2971 | V4L2_AV1_REF_GOLDEN_FRAME = 4, |
| | 2972 | V4L2_AV1_REF_BWDREF_FRAME = 5, |
| | 2973 | V4L2_AV1_REF_ALTREF2_FRAME = 6, |
| | 2974 | V4L2_AV1_REF_ALTREF_FRAME = 7, |
| | 2975 | }; |
| | 2976 | |
| | 2977 | #define V4L2_AV1_GLOBAL_MOTION_IS_INVALID(ref) (1 << (ref)) |
| | 2978 | |
| | 2979 | #define V4L2_AV1_GLOBAL_MOTION_FLAG_IS_GLOBAL 0x1 |
| | 2980 | #define V4L2_AV1_GLOBAL_MOTION_FLAG_IS_ROT_ZOOM 0x2 |
| | 2981 | #define V4L2_AV1_GLOBAL_MOTION_FLAG_IS_TRANSLATION 0x4 |
| | 2982 | /** |
| | 2983 | * struct v4l2_av1_global_motion - AV1 Global Motion parameters as described in |
| | 2984 | * section 6.8.17 "Global motion params semantics" of the AV1 specification. |
| | 2985 | * |
| | 2986 | * @flags: A bitfield containing the flags per reference frame. See |
| | 2987 | * V4L2_AV1_GLOBAL_MOTION_FLAG_{} |
| | 2988 | * @type: The type of global motion transform used. |
| | 2989 | * @params: this field has the same meaning as "gm_params" in the AV1 |
| | 2990 | * specification. |
| | 2991 | * @invalid: bitfield indicating whether the global motion params are invalid |
| | 2992 | * for a given reference frame. See section 7.11.3.6 Setup shear process and |
| | 2993 | * the variable "warpValid". Use V4L2_AV1_GLOBAL_MOTION_IS_INVALID(ref) to |
| | 2994 | * create a suitable mask. |
| | 2995 | * @reserved: padding field. Should be zeroed by applications. |
| | 2996 | */ |
| | 2997 | |
| | 2998 | struct v4l2_av1_global_motion { |
| | 2999 | __u8 flags[V4L2_AV1_TOTAL_REFS_PER_FRAME]; |
| | 3000 | enum v4l2_av1_warp_model type[V4L2_AV1_TOTAL_REFS_PER_FRAME]; |
| | 3001 | __s32 params[V4L2_AV1_TOTAL_REFS_PER_FRAME][6]; |
| | 3002 | __u8 invalid; |
| | 3003 | __u8 reserved[3]; |
| | 3004 | }; |
| | 3005 | |
| | 3006 | /** |
| | 3007 | * enum v4l2_av1_frame_restoration_type - AV1 Frame Restoration Type |
| | 3008 | * @V4L2_AV1_FRAME_RESTORE_NONE: no filtering is applied. |
| | 3009 | * @V4L2_AV1_FRAME_RESTORE_WIENER: Wiener filter process is invoked. |
| | 3010 | * @V4L2_AV1_FRAME_RESTORE_SGRPROJ: self guided filter process is invoked. |
| | 3011 | * @V4L2_AV1_FRAME_RESTORE_SWITCHABLE: restoration filter is swichtable. |
| | 3012 | */ |
| | 3013 | enum v4l2_av1_frame_restoration_type { |
| | 3014 | V4L2_AV1_FRAME_RESTORE_NONE = 0, |
| | 3015 | V4L2_AV1_FRAME_RESTORE_WIENER = 1, |
| | 3016 | V4L2_AV1_FRAME_RESTORE_SGRPROJ = 2, |
| | 3017 | V4L2_AV1_FRAME_RESTORE_SWITCHABLE = 3, |
| | 3018 | }; |
| | 3019 | |
| | 3020 | #define V4L2_AV1_LOOP_RESTORATION_FLAG_USES_LR 0x1 |
| | 3021 | #define V4L2_AV1_LOOP_RESTORATION_FLAG_USES_CHROMA_LR 0x2 |
| | 3022 | |
| | 3023 | /** |
| | 3024 | * struct v4l2_av1_loop_restoration - AV1 Loop Restauration as described in |
| | 3025 | * section 6.10.15 "Loop restoration params semantics" of the AV1 specification. |
| | 3026 | * |
| | 3027 | * @flags: See V4L2_AV1_LOOP_RESTORATION_FLAG_{}. |
| | 3028 | * @lr_unit_shift: specifies if the luma restoration size should be halved. |
| | 3029 | * @lr_uv_shift: specifies if the chroma size should be half the luma size. |
| | 3030 | * @reserved: padding field. Should be zeroed by applications. |
| | 3031 | * @frame_restoration_type: specifies the type of restoration used for each |
| | 3032 | * plane. See enum v4l2_av1_frame_restoration_type. |
| | 3033 | * @loop_restoration_size: specifies the size of loop restoration units in units |
| | 3034 | * of samples in the current plane. |
| | 3035 | */ |
| | 3036 | struct v4l2_av1_loop_restoration { |
| | 3037 | __u8 flags; |
| | 3038 | __u8 lr_unit_shift; |
| | 3039 | __u8 lr_uv_shift; |
| | 3040 | __u8 reserved; |
| | 3041 | enum v4l2_av1_frame_restoration_type frame_restoration_type[V4L2_AV1_NUM_PLANES_MAX]; |
| | 3042 | __u32 loop_restoration_size[V4L2_AV1_MAX_NUM_PLANES]; |
| | 3043 | }; |
| | 3044 | |
| | 3045 | /** |
| | 3046 | * struct v4l2_av1_cdef - AV1 CDEF params semantics as described in section |
| | 3047 | * 6.10.14 "CDEF params semantics" of the AV1 specification |
| | 3048 | * |
| | 3049 | * @damping_minus_3: controls the amount of damping in the deringing filter. |
| | 3050 | * @bits: specifies the number of bits needed to specify which CDEF filter to |
| | 3051 | * apply. |
| | 3052 | * @y_pri_strength: specifies the strength of the primary filter. |
| | 3053 | * @y_sec_strength: specifies the strength of the secondary filter. |
| | 3054 | * @uv_pri_strength: specifies the strength of the primary filter. |
| | 3055 | * @uv_sec_strength: specifies the strength of the secondary filter. |
| | 3056 | */ |
| | 3057 | struct v4l2_av1_cdef { |
| | 3058 | __u8 damping_minus_3; |
| | 3059 | __u8 bits; |
| | 3060 | __u8 y_pri_strength[V4L2_AV1_CDEF_MAX]; |
| | 3061 | __u8 y_sec_strength[V4L2_AV1_CDEF_MAX]; |
| | 3062 | __u8 uv_pri_strength[V4L2_AV1_CDEF_MAX]; |
| | 3063 | __u8 uv_sec_strength[V4L2_AV1_CDEF_MAX]; |
| | 3064 | }; |
| | 3065 | |
| | 3066 | #define V4L2_AV1_SEGMENTATION_FLAG_ENABLED 0x1 |
| | 3067 | #define V4L2_AV1_SEGMENTATION_FLAG_UPDATE_MAP 0x2 |
| | 3068 | #define V4L2_AV1_SEGMENTATION_FLAG_TEMPORAL_UPDATE 0x4 |
| | 3069 | #define V4L2_AV1_SEGMENTATION_FLAG_UPDATE_DATA 0x8 |
| | 3070 | #define V4L2_AV1_SEGMENTATION_FLAG_SEG_ID_PRE_SKIP 0x10 |
| | 3071 | |
| | 3072 | /** |
| | 3073 | * enum v4l2_av1_segment_feature - AV1 segment features as described in section |
| | 3074 | * 3 "Symbols and abbreviated terms" of the AV1 specification. |
| | 3075 | * |
| | 3076 | * @V4L2_AV1_SEG_LVL_ALT_Q: Index for quantizer segment feature. |
| | 3077 | * @V4L2_AV1_SEG_LVL_ALT_LF_Y_V: Index for vertical luma loop filter segment |
| | 3078 | * feature. |
| | 3079 | * @V4L2_AV1_SEG_LVL_REF_FRAME: Index for reference frame segment feature. |
| | 3080 | * @V4L2_AV1_SEG_LVL_REF_SKIP: Index for skip segment feature. |
| | 3081 | * @V4L2_AV1_SEG_LVL_REF_GLOBALMV: Index for global mv feature. |
| | 3082 | * @V4L2_AV1_SEG_LVL_MAX: Number of segment features. |
| | 3083 | */ |
| | 3084 | enum v4l2_av1_segment_feature { |
| | 3085 | V4L2_AV1_SEG_LVL_ALT_Q = 0, |
| | 3086 | V4L2_AV1_SEG_LVL_ALT_LF_Y_V = 1, |
| | 3087 | V4L2_AV1_SEG_LVL_REF_FRAME = 5, |
| | 3088 | V4L2_AV1_SEG_LVL_REF_SKIP = 6, |
| | 3089 | V4L2_AV1_SEG_LVL_REF_GLOBALMV = 7, |
| | 3090 | V4L2_AV1_SEG_LVL_MAX = 8 |
| | 3091 | }; |
| | 3092 | |
| | 3093 | #define V4L2_AV1_SEGMENT_FEATURE_ENABLED(id) (1 << (id)) |
| | 3094 | |
| | 3095 | /** |
| | 3096 | * struct v4l2_av1_segmentation - AV1 Segmentation params as defined in section |
| | 3097 | * 6.8.13 "Segmentation params semantics" of the AV1 specification. |
| | 3098 | * |
| | 3099 | * @flags: see V4L2_AV1_SEGMENTATION_FLAG_{}. |
| | 3100 | * @last_active_seg_id: indicates the highest numbered segment id that has some |
| | 3101 | * enabled feature. This is used when decoding the segment id to only decode |
| | 3102 | * choices corresponding to used segments. |
| | 3103 | * @feature_enabled: bitmask defining which features are enabled in each |
| | 3104 | * segment. Use V4L2_AV1_SEGMENT_FEATURE_ENABLED to build a suitable mask. |
| | 3105 | * @feature_data: data attached to each feature. Data entry is only valid if the |
| | 3106 | * feature is enabled |
| | 3107 | */ |
| | 3108 | struct v4l2_av1_segmentation { |
| | 3109 | __u8 flags; |
| | 3110 | __u8 last_active_seg_id; |
| | 3111 | __u8 feature_enabled[V4L2_AV1_MAX_SEGMENTS]; |
| | 3112 | __s16 feature_data[V4L2_AV1_MAX_SEGMENTS][V4L2_AV1_SEG_LVL_MAX]; |
| | 3113 | }; |
| | 3114 | |
| | 3115 | #define V4L2_AV1_LOOP_FILTER_FLAG_DELTA_ENABLED 0x1 |
| | 3116 | #define V4L2_AV1_LOOP_FILTER_FLAG_DELTA_UPDATE 0x2 |
| | 3117 | #define V4L2_AV1_LOOP_FILTER_FLAG_DELTA_LF_PRESENT 0x4 |
| | 3118 | #define V4L2_AV1_LOOP_FILTER_FLAG_DELTA_LF_MULTI 0x8 |
| | 3119 | |
| | 3120 | /** |
| | 3121 | * struct v4l2_av1_loop_filter - AV1 Loop filter params as defined in section |
| | 3122 | * 6.8.10 "Loop filter semantics" and 6.8.16 "Loop filter delta parameters |
| | 3123 | * semantics" of the AV1 specification. |
| | 3124 | * |
| | 3125 | * @flags: see V4L2_AV1_LOOP_FILTER_FLAG_{} |
| | 3126 | * @level: an array containing loop filter strength values. Different loop |
| | 3127 | * filter strength values from the array are used depending on the image plane |
| | 3128 | * being filtered, and the edge direction (vertical or horizontal) being |
| | 3129 | * filtered. |
| | 3130 | * @sharpness: indicates the sharpness level. The loop_filter_level and |
| | 3131 | * loop_filter_sharpness together determine when a block edge is filtered, and |
| | 3132 | * by how much the filtering can change the sample values. The loop filter |
| | 3133 | * process is described in section 7.14 of the AV1 specification. |
| | 3134 | * @ref_deltas: contains the adjustment needed for the filter level based on the |
| | 3135 | * chosen reference frame. If this syntax element is not present, it maintains |
| | 3136 | * its previous value. |
| | 3137 | * @mode_deltas: contains the adjustment needed for the filter level based on |
| | 3138 | * the chosen mode. If this syntax element is not present, it maintains its |
| | 3139 | * previous value. |
| | 3140 | * @delta_lf_res: specifies the left shift which should be applied to decoded |
| | 3141 | * loop filter delta values. |
| | 3142 | */ |
| | 3143 | struct v4l2_av1_loop_filter { |
| | 3144 | __u8 flags; |
| | 3145 | __u8 level[4]; |
| | 3146 | __u8 sharpness; |
| | 3147 | __s8 ref_deltas[V4L2_AV1_TOTAL_REFS_PER_FRAME]; |
| | 3148 | __s8 mode_deltas[2]; |
| | 3149 | __u8 delta_lf_res; |
| | 3150 | }; |
| | 3151 | |
| | 3152 | #define V4L2_AV1_QUANTIZATION_FLAG_DIFF_UV_DELTA 0x1 |
| | 3153 | #define V4L2_AV1_QUANTIZATION_FLAG_USING_QMATRIX 0x2 |
| | 3154 | #define V4L2_AV1_QUANTIZATION_FLAG_DELTA_Q_PRESENT 0x4 |
| | 3155 | |
| | 3156 | /** |
| | 3157 | * struct v4l2_av1_quantization - AV1 Quantization params as defined in section |
| | 3158 | * 6.8.11 "Quantization params semantics" of the AV1 specification. |
| | 3159 | * |
| | 3160 | * @flags: see V4L2_AV1_QUANTIZATION_FLAG_{} |
| | 3161 | * @base_q_idx: indicates the base frame qindex. This is used for Y AC |
| | 3162 | * coefficients and as the base value for the other quantizers. |
| | 3163 | * @delta_q_y_dc: indicates the Y DC quantizer relative to base_q_idx. |
| | 3164 | * @delta_q_u_dc: indicates the U DC quantizer relative to base_q_idx. |
| | 3165 | * @delta_q_u_ac: indicates the U AC quantizer relative to base_q_idx. |
| | 3166 | * @delta_q_v_dc: indicates the V DC quantizer relative to base_q_idx. |
| | 3167 | * @delta_q_v_ac: indicates the V AC quantizer relative to base_q_idx. |
| | 3168 | * @qm_y: specifies the level in the quantizer matrix that should be used for |
| | 3169 | * luma plane decoding. |
| | 3170 | * @qm_u: specifies the level in the quantizer matrix that should be used for |
| | 3171 | * chroma U plane decoding. |
| | 3172 | * @qm_v: specifies the level in the quantizer matrix that should be used for |
| | 3173 | * chroma V plane decoding. |
| | 3174 | * @delta_q_res: specifies the left shift which should be applied to decoded |
| | 3175 | * quantizer index delta values. |
| | 3176 | */ |
| | 3177 | struct v4l2_av1_quantization { |
| | 3178 | __u8 flags; |
| | 3179 | __u8 base_q_idx; |
| | 3180 | __s8 delta_q_y_dc; |
| | 3181 | __s8 delta_q_u_dc; |
| | 3182 | __s8 delta_q_u_ac; |
| | 3183 | __s8 delta_q_v_dc; |
| | 3184 | __s8 delta_q_v_ac; |
| | 3185 | __u8 qm_y; |
| | 3186 | __u8 qm_u; |
| | 3187 | __u8 qm_v; |
| | 3188 | __u8 delta_q_res; |
| | 3189 | }; |
| | 3190 | |
| | 3191 | #define V4L2_AV1_TILE_INFO_FLAG_UNIFORM_TILE_SPACING 0x1 |
| | 3192 | |
| | 3193 | /** |
| | 3194 | * struct v4l2_av1_tile_info - AV1 Tile info as defined in section 6.8.14 "Tile |
| | 3195 | * info semantics" of the AV1 specification. |
| | 3196 | * |
| | 3197 | * @flags: see V4L2_AV1_TILE_INFO_FLAG_{} |
| | 3198 | * @context_update_tile_id: specifies which tile to use for the CDF update. |
| | 3199 | * @tile_rows: specifies the number of tiles down the frame. |
| | 3200 | * @tile_cols: specifies the number of tiles across the frame. |
| | 3201 | * @mi_col_starts: an array specifying the start column (in units of 4x4 luma |
| | 3202 | * samples) for each tile across the image. |
| | 3203 | * @mi_row_starts: an array specifying the start row (in units of 4x4 luma |
| | 3204 | * samples) for each tile down the image. |
| | 3205 | * @width_in_sbs_minus_1: specifies the width of a tile minus 1 in units of |
| | 3206 | * superblocks. |
| | 3207 | * @height_in_sbs_minus_1: specifies the height of a tile minus 1 in units of |
| | 3208 | * superblocks. |
| | 3209 | * @tile_size_bytes: specifies the number of bytes needed to code each tile |
| | 3210 | * size. |
| | 3211 | * @reserved: padding field. Should be zeroed by applications. |
| | 3212 | */ |
| | 3213 | struct v4l2_av1_tile_info { |
| | 3214 | __u8 flags; |
| | 3215 | __u8 context_update_tile_id; |
| | 3216 | __u8 tile_cols; |
| | 3217 | __u8 tile_rows; |
| | 3218 | __u32 mi_col_starts[V4L2_AV1_MAX_TILE_COLS + 1]; |
| | 3219 | __u32 mi_row_starts[V4L2_AV1_MAX_TILE_ROWS + 1]; |
| | 3220 | __u32 width_in_sbs_minus_1[V4L2_AV1_MAX_TILE_COLS]; |
| | 3221 | __u32 height_in_sbs_minus_1[V4L2_AV1_MAX_TILE_ROWS]; |
| | 3222 | __u8 tile_size_bytes; |
| | 3223 | __u8 reserved[3]; |
| | 3224 | }; |
| | 3225 | |
| | 3226 | /** |
| | 3227 | * enum v4l2_av1_frame_type - AV1 Frame Type |
| | 3228 | * |
| | 3229 | * @V4L2_AV1_KEY_FRAME: Key frame |
| | 3230 | * @V4L2_AV1_INTER_FRAME: Inter frame |
| | 3231 | * @V4L2_AV1_INTRA_ONLY_FRAME: Intra-only frame |
| | 3232 | * @V4L2_AV1_SWITCH_FRAME: Switch frame |
| | 3233 | */ |
| | 3234 | enum v4l2_av1_frame_type { |
| | 3235 | V4L2_AV1_KEY_FRAME = 0, |
| | 3236 | V4L2_AV1_INTER_FRAME = 1, |
| | 3237 | V4L2_AV1_INTRA_ONLY_FRAME = 2, |
| | 3238 | V4L2_AV1_SWITCH_FRAME = 3 |
| | 3239 | }; |
| | 3240 | |
| | 3241 | /** |
| | 3242 | * enum v4l2_av1_interpolation_filter - AV1 interpolation filter types |
| | 3243 | * |
| | 3244 | * @V4L2_AV1_INTERPOLATION_FILTER_EIGHTTAP: eight tap filter |
| | 3245 | * @V4L2_AV1_INTERPOLATION_FILTER_EIGHTTAP_SMOOTH: eight tap smooth filter |
| | 3246 | * @V4L2_AV1_INTERPOLATION_FILTER_EIGHTTAP_SHARP: eight tap sharp filter |
| | 3247 | * @V4L2_AV1_INTERPOLATION_FILTER_BILINEAR: bilinear filter |
| | 3248 | * @V4L2_AV1_INTERPOLATION_FILTER_SWITCHABLE: filter selection is signaled at |
| | 3249 | * the block level |
| | 3250 | * |
| | 3251 | * See section 6.8.9 "Interpolation filter semantics" of the AV1 specification |
| | 3252 | * for more details. |
| | 3253 | */ |
| | 3254 | enum v4l2_av1_interpolation_filter { |
| | 3255 | V4L2_AV1_INTERPOLATION_FILTER_EIGHTTAP = 0, |
| | 3256 | V4L2_AV1_INTERPOLATION_FILTER_EIGHTTAP_SMOOTH = 1, |
| | 3257 | V4L2_AV1_INTERPOLATION_FILTER_EIGHTTAP_SHARP = 2, |
| | 3258 | V4L2_AV1_INTERPOLATION_FILTER_BILINEAR = 3, |
| | 3259 | V4L2_AV1_INTERPOLATION_FILTER_SWITCHABLE = 4, |
| | 3260 | }; |
| | 3261 | |
| | 3262 | /** |
| | 3263 | * enum v4l2_av1_tx_mode - AV1 Tx mode as described in section 6.8.21 "TX mode |
| | 3264 | * semantics" of the AV1 specification. |
| | 3265 | * @V4L2_AV1_TX_MODE_ONLY_4X4: the inverse transform will use only 4x4 |
| | 3266 | * transforms |
| | 3267 | * @V4L2_AV1_TX_MODE_LARGEST: the inverse transform will use the largest |
| | 3268 | * transform size that fits inside the block |
| | 3269 | * @V4L2_AV1_TX_MODE_SELECT: the choice of transform size is specified |
| | 3270 | * explicitly for each block. |
| | 3271 | */ |
| | 3272 | enum v4l2_av1_tx_mode { |
| | 3273 | V4L2_AV1_TX_MODE_ONLY_4X4 = 0, |
| | 3274 | V4L2_AV1_TX_MODE_LARGEST = 1, |
| | 3275 | V4L2_AV1_TX_MODE_SELECT = 2 |
| | 3276 | }; |
| | 3277 | |
| | 3278 | #define V4L2_AV1_FRAME_FLAG_SHOW_FRAME 0x00000001 |
| | 3279 | #define V4L2_AV1_FRAME_FLAG_SHOWABLE_FRAME 0x00000002 |
| | 3280 | #define V4L2_AV1_FRAME_FLAG_ERROR_RESILIENT_MODE 0x00000004 |
| | 3281 | #define V4L2_AV1_FRAME_FLAG_DISABLE_CDF_UPDATE 0x00000008 |
| | 3282 | #define V4L2_AV1_FRAME_FLAG_ALLOW_SCREEN_CONTENT_TOOLS 0x00000010 |
| | 3283 | #define V4L2_AV1_FRAME_FLAG_FORCE_INTEGER_MV 0x00000020 |
| | 3284 | #define V4L2_AV1_FRAME_FLAG_ALLOW_INTRABC 0x00000040 |
| | 3285 | #define V4L2_AV1_FRAME_FLAG_USE_SUPERRES 0x00000080 |
| | 3286 | #define V4L2_AV1_FRAME_FLAG_ALLOW_HIGH_PRECISION_MV 0x00000100 |
| | 3287 | #define V4L2_AV1_FRAME_FLAG_IS_MOTION_MODE_SWITCHABLE 0x00000200 |
| | 3288 | #define V4L2_AV1_FRAME_FLAG_USE_REF_FRAME_MVS 0x00000400 |
| | 3289 | #define V4L2_AV1_FRAME_FLAG_DISABLE_FRAME_END_UPDATE_CDF 0x00000800 |
| | 3290 | #define V4L2_AV1_FRAME_FLAG_ALLOW_WARPED_MOTION 0x00001000 |
| | 3291 | #define V4L2_AV1_FRAME_FLAG_REFERENCE_SELECT 0x00002000 |
| | 3292 | #define V4L2_AV1_FRAME_FLAG_REDUCED_TX_SET 0x00004000 |
| | 3293 | #define V4L2_AV1_FRAME_FLAG_SKIP_MODE_ALLOWED 0x00008000 |
| | 3294 | #define V4L2_AV1_FRAME_FLAG_SKIP_MODE_PRESENT 0x00010000 |
| | 3295 | #define V4L2_AV1_FRAME_FLAG_FRAME_SIZE_OVERRIDE 0x00020000 |
| | 3296 | #define V4L2_AV1_FRAME_FLAG_BUFFER_REMOVAL_TIME_PRESENT 0x00040000 |
| | 3297 | #define V4L2_AV1_FRAME_FLAG_FRAME_REFS_SHORT_SIGNALING 0x00080000 |
| | 3298 | |
| | 3299 | #define V4L2_CID_STATELESS_AV1_FRAME (V4L2_CID_CODEC_STATELESS_BASE + 502) |
| | 3300 | /** |
| | 3301 | * struct v4l2_ctrl_av1_frame - Represents an AV1 Frame Header OBU. |
| | 3302 | * |
| | 3303 | * @tile_info: tile info |
| | 3304 | * @quantization: quantization params |
| | 3305 | * @segmentation: segmentation params |
| | 3306 | * @superres_denom: the denominator for the upscaling ratio. |
| | 3307 | * @loop_filter: loop filter params |
| | 3308 | * @cdef: cdef params |
| | 3309 | * @skip_mode_frame: specifies the frames to use for compound prediction when |
| | 3310 | * skip_mode is equal to 1. |
| | 3311 | * @primary_ref_frame: specifies which reference frame contains the CDF values |
| | 3312 | * and other state that should be loaded at the start of the frame. |
| | 3313 | * @loop_restoration: loop restoration params |
| | 3314 | * @global_motion: global motion params |
| | 3315 | * @flags: see V4L2_AV1_FRAME_FLAG_{} |
| | 3316 | * @frame_type: specifies the AV1 frame type |
| | 3317 | * @order_hint: specifies OrderHintBits least significant bits of the expected |
| | 3318 | * output order for this frame. |
| | 3319 | * @upscaled_width: the upscaled width. |
| | 3320 | * @interpolation_filter: specifies the filter selection used for performing |
| | 3321 | * inter prediction. |
| | 3322 | * @tx_mode: specifies how the transform size is determined. |
| | 3323 | * @frame_width_minus_1: add 1 to get the frame's width. |
| | 3324 | * @frame_height_minus_1: add 1 to get the frame's height |
| | 3325 | * @render_width_minus_1: add 1 to get the render width of the frame in luma |
| | 3326 | * samples. |
| | 3327 | * @render_height_minus_1: add 1 to get the render height of the frame in luma |
| | 3328 | * samples. |
| | 3329 | * @current_frame_id: specifies the frame id number for the current frame. Frame |
| | 3330 | * id numbers are additional information that do not affect the decoding |
| | 3331 | * process, but provide decoders with a way of detecting missing reference |
| | 3332 | * frames so that appropriate action can be taken. |
| | 3333 | * @buffer_removal_time: specifies the frame removal time in units of DecCT clock |
| | 3334 | * ticks counted from the removal time of the last random access point for |
| | 3335 | * operating point opNum. |
| | 3336 | * @reserved: padding field. Should be zeroed by applications. |
| | 3337 | * @order_hints: specifies the expected output order hint for each reference |
| | 3338 | * frame. This field corresponds to the OrderHints variable from the |
| | 3339 | * specification (section 5.9.2 "Uncompressed header syntax"). As such, this is |
| | 3340 | * only used for non-intra frames and ignored otherwise. order_hints[0] is |
| | 3341 | * always ignored. |
| | 3342 | * @reference_frame_ts: the V4L2 timestamp of the reference frame slots. |
| | 3343 | * @ref_frame_idx: used to index into @reference_frame_ts when decoding |
| | 3344 | * inter-frames. The meaning of this array is the same as in the specification. |
| | 3345 | * The timestamp refers to the timestamp field in struct v4l2_buffer. Use |
| | 3346 | * v4l2_timeval_to_ns() to convert the struct timeval to a __u64. |
| | 3347 | * @refresh_frame_flags: contains a bitmask that specifies which reference frame |
| | 3348 | * slots will be updated with the current frame after it is decoded. |
| | 3349 | */ |
| | 3350 | struct v4l2_ctrl_av1_frame { |
| | 3351 | struct v4l2_av1_tile_info tile_info; |
| | 3352 | struct v4l2_av1_quantization quantization; |
| | 3353 | __u8 superres_denom; |
| | 3354 | struct v4l2_av1_segmentation segmentation; |
| | 3355 | struct v4l2_av1_loop_filter loop_filter; |
| | 3356 | struct v4l2_av1_cdef cdef; |
| | 3357 | __u8 skip_mode_frame[2]; |
| | 3358 | __u8 primary_ref_frame; |
| | 3359 | struct v4l2_av1_loop_restoration loop_restoration; |
| | 3360 | struct v4l2_av1_global_motion global_motion; |
| | 3361 | __u32 flags; |
| | 3362 | enum v4l2_av1_frame_type frame_type; |
| | 3363 | __u32 order_hint; |
| | 3364 | __u32 upscaled_width; |
| | 3365 | enum v4l2_av1_interpolation_filter interpolation_filter; |
| | 3366 | enum v4l2_av1_tx_mode tx_mode; |
| | 3367 | __u32 frame_width_minus_1; |
| | 3368 | __u32 frame_height_minus_1; |
| | 3369 | __u16 render_width_minus_1; |
| | 3370 | __u16 render_height_minus_1; |
| | 3371 | |
| | 3372 | __u32 current_frame_id; |
| | 3373 | __u32 buffer_removal_time[V4L2_AV1_MAX_OPERATING_POINTS]; |
| | 3374 | __u8 reserved[4]; |
| | 3375 | __u32 order_hints[V4L2_AV1_TOTAL_REFS_PER_FRAME]; |
| | 3376 | __u64 reference_frame_ts[V4L2_AV1_TOTAL_REFS_PER_FRAME]; |
| | 3377 | __s8 ref_frame_idx[V4L2_AV1_REFS_PER_FRAME]; |
| | 3378 | __u8 refresh_frame_flags; |
| | 3379 | }; |
| | 3380 | |
| | 3381 | #define V4L2_AV1_FILM_GRAIN_FLAG_APPLY_GRAIN 0x1 |
| | 3382 | #define V4L2_AV1_FILM_GRAIN_FLAG_UPDATE_GRAIN 0x2 |
| | 3383 | #define V4L2_AV1_FILM_GRAIN_FLAG_CHROMA_SCALING_FROM_LUMA 0x4 |
| | 3384 | #define V4L2_AV1_FILM_GRAIN_FLAG_OVERLAP 0x8 |
| | 3385 | #define V4L2_AV1_FILM_GRAIN_FLAG_CLIP_TO_RESTRICTED_RANGE 0x10 |
| | 3386 | |
| | 3387 | #define V4L2_CID_STATELESS_AV1_FILM_GRAIN (V4L2_CID_CODEC_STATELESS_BASE + 505) |
| | 3388 | /** |
| | 3389 | * struct v4l2_ctrl_av1_film_grain - AV1 Film Grain parameters. |
| | 3390 | * |
| | 3391 | * Film grain parameters as specified by section 6.8.20 of the AV1 Specification. |
| | 3392 | * |
| | 3393 | * @flags: see V4L2_AV1_FILM_GRAIN_{}. |
| | 3394 | * @cr_mult: represents a multiplier for the cr component used in derivation of |
| | 3395 | * the input index to the cr component scaling function. |
| | 3396 | * @grain_seed: specifies the starting value for the pseudo-random numbers used |
| | 3397 | * during film grain synthesis. |
| | 3398 | * @film_grain_params_ref_idx: indicates which reference frame contains the |
| | 3399 | * film grain parameters to be used for this frame. |
| | 3400 | * @num_y_points: specifies the number of points for the piece-wise linear |
| | 3401 | * scaling function of the luma component. |
| | 3402 | * @point_y_value: represents the x (luma value) coordinate for the i-th point |
| | 3403 | * of the piecewise linear scaling function for luma component. The values are |
| | 3404 | * signaled on the scale of 0..255. In case of 10 bit video, these values |
| | 3405 | * correspond to luma values divided by 4. In case of 12 bit video, these values |
| | 3406 | * correspond to luma values divided by 16. |
| | 3407 | * @point_y_scaling: represents the scaling (output) value for the i-th point |
| | 3408 | * of the piecewise linear scaling function for luma component. |
| | 3409 | * @num_cb_points: specifies the number of points for the piece-wise linear |
| | 3410 | * scaling function of the cb component. |
| | 3411 | * @point_cb_value: represents the x coordinate for the i-th point of the |
| | 3412 | * piece-wise linear scaling function for cb component. The values are signaled |
| | 3413 | * on the scale of 0..255. |
| | 3414 | * @point_cb_scaling: represents the scaling (output) value for the i-th point |
| | 3415 | * of the piecewise linear scaling function for cb component. |
| | 3416 | * @num_cr_points: specifies represents the number of points for the piece-wise |
| | 3417 | * linear scaling function of the cr component. |
| | 3418 | * @point_cr_value: represents the x coordinate for the i-th point of the |
| | 3419 | * piece-wise linear scaling function for cr component. The values are signaled |
| | 3420 | * on the scale of 0..255. |
| | 3421 | * @point_cr_scaling: represents the scaling (output) value for the i-th point |
| | 3422 | * of the piecewise linear scaling function for cr component. |
| | 3423 | * @grain_scaling_minus_8: represents the shift – 8 applied to the values of the |
| | 3424 | * chroma component. The grain_scaling_minus_8 can take values of 0..3 and |
| | 3425 | * determines the range and quantization step of the standard deviation of film |
| | 3426 | * grain. |
| | 3427 | * @ar_coeff_lag: specifies the number of auto-regressive coefficients for luma |
| | 3428 | * and chroma. |
| | 3429 | * @ar_coeffs_y_plus_128: specifies auto-regressive coefficients used for the Y |
| | 3430 | * plane. |
| | 3431 | * @ar_coeffs_cb_plus_128: specifies auto-regressive coefficients used for the U |
| | 3432 | * plane. |
| | 3433 | * @ar_coeffs_cr_plus_128: specifies auto-regressive coefficients used for the V |
| | 3434 | * plane. |
| | 3435 | * @ar_coeff_shift_minus_6: specifies the range of the auto-regressive |
| | 3436 | * coefficients. Values of 0, 1, 2, and 3 correspond to the ranges for |
| | 3437 | * auto-regressive coefficients of [-2, 2), [-1, 1), [-0.5, 0.5) and [-0.25, |
| | 3438 | * 0.25) respectively. |
| | 3439 | * @grain_scale_shift: specifies how much the Gaussian random numbers should be |
| | 3440 | * scaled down during the grain synthesis process. |
| | 3441 | * @cb_mult: represents a multiplier for the cb component used in derivation of |
| | 3442 | * the input index to the cb component scaling function. |
| | 3443 | * @cb_luma_mult: represents a multiplier for the average luma component used in |
| | 3444 | * derivation of the input index to the cb component scaling function. |
| | 3445 | * @cr_luma_mult: represents a multiplier for the average luma component used in |
| | 3446 | * derivation of the input index to the cr component scaling function. |
| | 3447 | * @cb_offset: represents an offset used in derivation of the input index to the |
| | 3448 | * cb component scaling function. |
| | 3449 | * @cr_offset: represents an offset used in derivation of the input index to the |
| | 3450 | * cr component scaling function. |
| | 3451 | * @reserved: padding field. Should be zeroed by applications. |
| | 3452 | */ |
| | 3453 | struct v4l2_ctrl_av1_film_grain { |
| | 3454 | __u8 flags; |
| | 3455 | __u8 cr_mult; |
| | 3456 | __u16 grain_seed; |
| | 3457 | __u8 film_grain_params_ref_idx; |
| | 3458 | __u8 num_y_points; |
| | 3459 | __u8 point_y_value[V4L2_AV1_MAX_NUM_Y_POINTS]; |
| | 3460 | __u8 point_y_scaling[V4L2_AV1_MAX_NUM_Y_POINTS]; |
| | 3461 | __u8 num_cb_points; |
| | 3462 | __u8 point_cb_value[V4L2_AV1_MAX_NUM_CB_POINTS]; |
| | 3463 | __u8 point_cb_scaling[V4L2_AV1_MAX_NUM_CB_POINTS]; |
| | 3464 | __u8 num_cr_points; |
| | 3465 | __u8 point_cr_value[V4L2_AV1_MAX_NUM_CR_POINTS]; |
| | 3466 | __u8 point_cr_scaling[V4L2_AV1_MAX_NUM_CR_POINTS]; |
| | 3467 | __u8 grain_scaling_minus_8; |
| | 3468 | __u8 ar_coeff_lag; |
| | 3469 | __u8 ar_coeffs_y_plus_128[V4L2_AV1_AR_COEFFS_SIZE]; |
| | 3470 | __u8 ar_coeffs_cb_plus_128[V4L2_AV1_AR_COEFFS_SIZE]; |
| | 3471 | __u8 ar_coeffs_cr_plus_128[V4L2_AV1_AR_COEFFS_SIZE]; |
| | 3472 | __u8 ar_coeff_shift_minus_6; |
| | 3473 | __u8 grain_scale_shift; |
| | 3474 | __u8 cb_mult; |
| | 3475 | __u8 cb_luma_mult; |
| | 3476 | __u8 cr_luma_mult; |
| | 3477 | __u16 cb_offset; |
| | 3478 | __u16 cr_offset; |
| | 3479 | __u8 reserved[4]; |
| | 3480 | }; |
| | 3481 | |
| 2757 | /* MPEG-compression definitions kept for backwards compatibility */ | 3482 | /* MPEG-compression definitions kept for backwards compatibility */ |
| 2758 | #ifndef __KERNEL__ | 3483 | #ifndef __KERNEL__ |
| 2759 | #define V4L2_CTRL_CLASS_MPEG V4L2_CTRL_CLASS_CODEC | 3484 | #define V4L2_CTRL_CLASS_MPEG V4L2_CTRL_CLASS_CODEC |