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.

99 lines
2.5KB

  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 FFmpeg.
  8. *
  9. * FFmpeg 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. * FFmpeg 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 FFmpeg; 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 "mpegvideo.h"
  27. #include "dnxhddata.h"
  28. typedef struct {
  29. uint16_t mb;
  30. int value;
  31. } RCCMPEntry;
  32. typedef struct {
  33. int ssd;
  34. int bits;
  35. } RCEntry;
  36. typedef struct DNXHDEncContext {
  37. AVClass *class;
  38. MpegEncContext m; ///< Used for quantization dsp functions
  39. AVFrame frame;
  40. int cid;
  41. const CIDEntry *cid_table;
  42. uint8_t *msip; ///< Macroblock Scan Indexes Payload
  43. uint32_t *slice_size;
  44. uint32_t *slice_offs;
  45. struct DNXHDEncContext *thread[MAX_THREADS];
  46. // Because our samples are either 8 or 16 bits for 8-bit and 10-bit
  47. // encoding respectively, these refer either to bytes or to two-byte words.
  48. unsigned dct_y_offset;
  49. unsigned dct_uv_offset;
  50. unsigned block_width_l2;
  51. int interlaced;
  52. int cur_field;
  53. int nitris_compat;
  54. unsigned min_padding;
  55. DECLARE_ALIGNED(16, DCTELEM, blocks)[8][64];
  56. int (*qmatrix_c) [64];
  57. int (*qmatrix_l) [64];
  58. uint16_t (*qmatrix_l16)[2][64];
  59. uint16_t (*qmatrix_c16)[2][64];
  60. unsigned frame_bits;
  61. uint8_t *src[3];
  62. uint32_t *vlc_codes;
  63. uint8_t *vlc_bits;
  64. uint16_t *run_codes;
  65. uint8_t *run_bits;
  66. /** Rate control */
  67. unsigned slice_bits;
  68. unsigned qscale;
  69. unsigned lambda;
  70. uint16_t *mb_bits;
  71. uint8_t *mb_qscale;
  72. RCCMPEntry *mb_cmp;
  73. RCEntry (*mb_rc)[8160];
  74. void (*get_pixels_8x4_sym)(DCTELEM */*align 16*/, const uint8_t *, int);
  75. } DNXHDEncContext;
  76. void ff_dnxhd_init_mmx(DNXHDEncContext *ctx);
  77. #endif /* AVCODEC_DNXHDENC_H */