dnxhdenc.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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 "libavcodec/mpegvideo.h"
  27. #include "libavcodec/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. MpegEncContext m; ///< Used for quantization dsp functions
  38. AVFrame frame;
  39. int cid;
  40. const CIDEntry *cid_table;
  41. uint8_t *msip; ///< Macroblock Scan Indexes Payload
  42. uint32_t *slice_size;
  43. uint32_t *slice_offs;
  44. struct DNXHDEncContext *thread[MAX_THREADS];
  45. unsigned dct_y_offset;
  46. unsigned dct_uv_offset;
  47. int interlaced;
  48. int cur_field;
  49. int nitris_compat;
  50. unsigned min_padding;
  51. DECLARE_ALIGNED(16, DCTELEM, blocks)[8][64];
  52. int (*qmatrix_c) [64];
  53. int (*qmatrix_l) [64];
  54. uint16_t (*qmatrix_l16)[2][64];
  55. uint16_t (*qmatrix_c16)[2][64];
  56. unsigned frame_bits;
  57. uint8_t *src[3];
  58. uint32_t *vlc_codes;
  59. uint8_t *vlc_bits;
  60. uint16_t *run_codes;
  61. uint8_t *run_bits;
  62. /** Rate control */
  63. unsigned slice_bits;
  64. unsigned qscale;
  65. unsigned lambda;
  66. unsigned thread_size;
  67. uint16_t *mb_bits;
  68. uint8_t *mb_qscale;
  69. RCCMPEntry *mb_cmp;
  70. RCEntry (*mb_rc)[8160];
  71. void (*get_pixels_8x4_sym)(DCTELEM */*align 16*/, const uint8_t *, int);
  72. } DNXHDEncContext;
  73. void ff_dnxhd_init_mmx(DNXHDEncContext *ctx);
  74. #endif /* AVCODEC_DNXHDENC_H */