You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

105 lines
2.7KB

  1. /*
  2. * VC3/DNxHD encoder structure definitions and prototypes
  3. * Copyright (c) 2007 Baptiste Coudurier <baptiste dot coudurier at smartjog dot com>
  4. *
  5. * VC-3 encoder funded by the British Broadcasting Corporation
  6. *
  7. * This file is part of Libav.
  8. *
  9. * Libav is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation; either
  12. * version 2.1 of the License, or (at your option) any later version.
  13. *
  14. * Libav is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with Libav; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. */
  23. #ifndef AVCODEC_DNXHDENC_H
  24. #define AVCODEC_DNXHDENC_H
  25. #include <stdint.h>
  26. #include "config.h"
  27. #include "mpegvideo.h"
  28. #include "dnxhddata.h"
  29. typedef struct RCCMPEntry {
  30. uint16_t mb;
  31. int value;
  32. } RCCMPEntry;
  33. typedef struct RCEntry {
  34. int ssd;
  35. int bits;
  36. } RCEntry;
  37. typedef struct DNXHDEncContext {
  38. AVClass *class;
  39. BlockDSPContext bdsp;
  40. MpegEncContext m; ///< Used for quantization dsp functions
  41. int cid;
  42. const CIDEntry *cid_table;
  43. uint8_t *msip; ///< Macroblock Scan Indexes Payload
  44. uint32_t *slice_size;
  45. uint32_t *slice_offs;
  46. struct DNXHDEncContext *thread[MAX_THREADS];
  47. // Because our samples are either 8 or 16 bits for 8-bit and 10-bit
  48. // encoding respectively, these refer either to bytes or to two-byte words.
  49. unsigned dct_y_offset;
  50. unsigned dct_uv_offset;
  51. unsigned block_width_l2;
  52. int interlaced;
  53. int cur_field;
  54. int nitris_compat;
  55. unsigned min_padding;
  56. int intra_quant_bias;
  57. DECLARE_ALIGNED(16, int16_t, blocks)[8][64];
  58. int (*qmatrix_c) [64];
  59. int (*qmatrix_l) [64];
  60. uint16_t (*qmatrix_l16)[2][64];
  61. uint16_t (*qmatrix_c16)[2][64];
  62. unsigned frame_bits;
  63. uint8_t *src[3];
  64. uint32_t *vlc_codes;
  65. uint8_t *vlc_bits;
  66. uint16_t *run_codes;
  67. uint8_t *run_bits;
  68. /** Rate control */
  69. unsigned slice_bits;
  70. unsigned qscale;
  71. unsigned lambda;
  72. unsigned thread_size;
  73. uint16_t *mb_bits;
  74. uint8_t *mb_qscale;
  75. RCCMPEntry *mb_cmp;
  76. RCEntry (*mb_rc)[8160];
  77. void (*get_pixels_8x4_sym)(int16_t *restrict /* align 16 */ block,
  78. const uint8_t *pixels, ptrdiff_t line_size);
  79. } DNXHDEncContext;
  80. void ff_dnxhdenc_init_x86(DNXHDEncContext *ctx);
  81. #endif /* AVCODEC_DNXHDENC_H */