00001 /* 00002 * VC3/DNxHD encoder structure definitions and prototypes 00003 * Copyright (c) 2007 Baptiste Coudurier <baptiste dot coudurier at smartjog dot com> 00004 * 00005 * VC-3 encoder funded by the British Broadcasting Corporation 00006 * 00007 * This file is part of FFmpeg. 00008 * 00009 * FFmpeg is free software; you can redistribute it and/or 00010 * modify it under the terms of the GNU Lesser General Public 00011 * License as published by the Free Software Foundation; either 00012 * version 2.1 of the License, or (at your option) any later version. 00013 * 00014 * FFmpeg is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 * Lesser General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU Lesser General Public 00020 * License along with FFmpeg; if not, write to the Free Software 00021 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00022 */ 00023 00024 #ifndef AVCODEC_DNXHDENC_H 00025 #define AVCODEC_DNXHDENC_H 00026 00027 #include <stdint.h> 00028 00029 #include "mpegvideo.h" 00030 #include "dnxhddata.h" 00031 00032 typedef struct { 00033 uint16_t mb; 00034 int value; 00035 } RCCMPEntry; 00036 00037 typedef struct { 00038 int ssd; 00039 int bits; 00040 } RCEntry; 00041 00042 typedef struct DNXHDEncContext { 00043 AVClass *class; 00044 MpegEncContext m; 00045 00046 AVFrame frame; 00047 int cid; 00048 const CIDEntry *cid_table; 00049 uint8_t *msip; 00050 uint32_t *slice_size; 00051 uint32_t *slice_offs; 00052 00053 struct DNXHDEncContext *thread[MAX_THREADS]; 00054 00055 // Because our samples are either 8 or 16 bits for 8-bit and 10-bit 00056 // encoding respectively, these refer either to bytes or to two-byte words. 00057 unsigned dct_y_offset; 00058 unsigned dct_uv_offset; 00059 unsigned block_width_l2; 00060 00061 int interlaced; 00062 int cur_field; 00063 00064 int nitris_compat; 00065 unsigned min_padding; 00066 00067 DECLARE_ALIGNED(16, DCTELEM, blocks)[8][64]; 00068 00069 int (*qmatrix_c) [64]; 00070 int (*qmatrix_l) [64]; 00071 uint16_t (*qmatrix_l16)[2][64]; 00072 uint16_t (*qmatrix_c16)[2][64]; 00073 00074 unsigned frame_bits; 00075 uint8_t *src[3]; 00076 00077 uint32_t *vlc_codes; 00078 uint8_t *vlc_bits; 00079 uint16_t *run_codes; 00080 uint8_t *run_bits; 00081 00083 unsigned slice_bits; 00084 unsigned qscale; 00085 unsigned lambda; 00086 00087 uint16_t *mb_bits; 00088 uint8_t *mb_qscale; 00089 00090 RCCMPEntry *mb_cmp; 00091 RCEntry (*mb_rc)[8160]; 00092 00093 void (*get_pixels_8x4_sym)(DCTELEM * /*align 16*/, const uint8_t *, int); 00094 } DNXHDEncContext; 00095 00096 void ff_dnxhdenc_init_x86(DNXHDEncContext *ctx); 00097 00098 #endif /* AVCODEC_DNXHDENC_H */