Libav 0.7.1
libavcodec/dnxhdenc.h
Go to the documentation of this file.
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 Libav.
00008  *
00009  * Libav 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  * Libav 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 Libav; 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     unsigned dct_y_offset;
00056     unsigned dct_uv_offset;
00057     int interlaced;
00058     int cur_field;
00059 
00060     int nitris_compat;
00061     unsigned min_padding;
00062 
00063     DECLARE_ALIGNED(16, DCTELEM, blocks)[8][64];
00064 
00065     int      (*qmatrix_c)     [64];
00066     int      (*qmatrix_l)     [64];
00067     uint16_t (*qmatrix_l16)[2][64];
00068     uint16_t (*qmatrix_c16)[2][64];
00069 
00070     unsigned frame_bits;
00071     uint8_t *src[3];
00072 
00073     uint32_t *vlc_codes;
00074     uint8_t  *vlc_bits;
00075     uint16_t *run_codes;
00076     uint8_t  *run_bits;
00077 
00079     unsigned slice_bits;
00080     unsigned qscale;
00081     unsigned lambda;
00082 
00083     unsigned thread_size;
00084 
00085     uint16_t *mb_bits;
00086     uint8_t  *mb_qscale;
00087 
00088     RCCMPEntry *mb_cmp;
00089     RCEntry   (*mb_rc)[8160];
00090 
00091     void (*get_pixels_8x4_sym)(DCTELEM */*align 16*/, const uint8_t *, int);
00092 } DNXHDEncContext;
00093 
00094 void ff_dnxhd_init_mmx(DNXHDEncContext *ctx);
00095 
00096 #endif /* AVCODEC_DNXHDENC_H */