mpeg2-ctrls.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * These are the MPEG2 state controls for use with stateless MPEG-2
  4. * codec drivers.
  5. *
  6. * It turns out that these structs are not stable yet and will undergo
  7. * more changes. So keep them private until they are stable and ready to
  8. * become part of the official public API.
  9. */
  10. #ifndef _MPEG2_CTRLS_H_
  11. #define _MPEG2_CTRLS_H_
  12. #define V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS (V4L2_CID_MPEG_BASE+250)
  13. #define V4L2_CID_MPEG_VIDEO_MPEG2_QUANTIZATION (V4L2_CID_MPEG_BASE+251)
  14. /* enum v4l2_ctrl_type type values */
  15. #define V4L2_CTRL_TYPE_MPEG2_SLICE_PARAMS 0x0103
  16. #define V4L2_CTRL_TYPE_MPEG2_QUANTIZATION 0x0104
  17. #define V4L2_MPEG2_PICTURE_CODING_TYPE_I 1
  18. #define V4L2_MPEG2_PICTURE_CODING_TYPE_P 2
  19. #define V4L2_MPEG2_PICTURE_CODING_TYPE_B 3
  20. #define V4L2_MPEG2_PICTURE_CODING_TYPE_D 4
  21. struct v4l2_mpeg2_sequence {
  22. /* ISO/IEC 13818-2, ITU-T Rec. H.262: Sequence header */
  23. __u16 horizontal_size;
  24. __u16 vertical_size;
  25. __u32 vbv_buffer_size;
  26. /* ISO/IEC 13818-2, ITU-T Rec. H.262: Sequence extension */
  27. __u8 profile_and_level_indication;
  28. __u8 progressive_sequence;
  29. __u8 chroma_format;
  30. __u8 pad;
  31. };
  32. struct v4l2_mpeg2_picture {
  33. /* ISO/IEC 13818-2, ITU-T Rec. H.262: Picture header */
  34. __u8 picture_coding_type;
  35. /* ISO/IEC 13818-2, ITU-T Rec. H.262: Picture coding extension */
  36. __u8 f_code[2][2];
  37. __u8 intra_dc_precision;
  38. __u8 picture_structure;
  39. __u8 top_field_first;
  40. __u8 frame_pred_frame_dct;
  41. __u8 concealment_motion_vectors;
  42. __u8 q_scale_type;
  43. __u8 intra_vlc_format;
  44. __u8 alternate_scan;
  45. __u8 repeat_first_field;
  46. __u8 progressive_frame;
  47. __u8 pad;
  48. };
  49. struct v4l2_ctrl_mpeg2_slice_params {
  50. __u32 bit_size;
  51. __u32 data_bit_offset;
  52. struct v4l2_mpeg2_sequence sequence;
  53. struct v4l2_mpeg2_picture picture;
  54. /* ISO/IEC 13818-2, ITU-T Rec. H.262: Slice */
  55. __u8 quantiser_scale_code;
  56. __u8 backward_ref_index;
  57. __u8 forward_ref_index;
  58. __u8 pad;
  59. };
  60. struct v4l2_ctrl_mpeg2_quantization {
  61. /* ISO/IEC 13818-2, ITU-T Rec. H.262: Quant matrix extension */
  62. __u8 load_intra_quantiser_matrix;
  63. __u8 load_non_intra_quantiser_matrix;
  64. __u8 load_chroma_intra_quantiser_matrix;
  65. __u8 load_chroma_non_intra_quantiser_matrix;
  66. __u8 intra_quantiser_matrix[64];
  67. __u8 non_intra_quantiser_matrix[64];
  68. __u8 chroma_intra_quantiser_matrix[64];
  69. __u8 chroma_non_intra_quantiser_matrix[64];
  70. };
  71. #endif