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 #include "libavcodec/mpegvideo.h" 00029 #include "libavcodec/dnxhddata.h" 00030 00031 typedef struct { 00032 uint16_t mb; 00033 int value; 00034 } RCCMPEntry; 00035 00036 typedef struct { 00037 int ssd; 00038 int bits; 00039 } RCEntry; 00040 00041 typedef struct DNXHDEncContext { 00042 MpegEncContext m; 00043 00044 AVFrame frame; 00045 int cid; 00046 const CIDEntry *cid_table; 00047 uint8_t *msip; 00048 uint32_t *slice_size; 00049 uint32_t *slice_offs; 00050 00051 struct DNXHDEncContext *thread[MAX_THREADS]; 00052 00053 unsigned dct_y_offset; 00054 unsigned dct_uv_offset; 00055 int interlaced; 00056 int cur_field; 00057 00058 DECLARE_ALIGNED(16, DCTELEM, blocks)[8][64]; 00059 00060 int (*qmatrix_c) [64]; 00061 int (*qmatrix_l) [64]; 00062 uint16_t (*qmatrix_l16)[2][64]; 00063 uint16_t (*qmatrix_c16)[2][64]; 00064 00065 unsigned frame_bits; 00066 uint8_t *src[3]; 00067 00068 uint32_t *vlc_codes; 00069 uint8_t *vlc_bits; 00070 uint16_t *run_codes; 00071 uint8_t *run_bits; 00072 00074 unsigned slice_bits; 00075 unsigned qscale; 00076 unsigned lambda; 00077 00078 unsigned thread_size; 00079 00080 uint16_t *mb_bits; 00081 uint8_t *mb_qscale; 00082 00083 RCCMPEntry *mb_cmp; 00084 RCEntry (*mb_rc)[8160]; 00085 00086 void (*get_pixels_8x4_sym)(DCTELEM */*align 16*/, const uint8_t *, int); 00087 } DNXHDEncContext; 00088 00089 void ff_dnxhd_init_mmx(DNXHDEncContext *ctx); 00090 00091 #endif /* AVCODEC_DNXHDENC_H */