00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00024 #ifndef AVCODEC_INTERNAL_H
00025 #define AVCODEC_INTERNAL_H
00026
00027 #include <stdint.h>
00028
00029 #include "libavutil/mathematics.h"
00030 #include "libavutil/pixfmt.h"
00031 #include "avcodec.h"
00032
00033 typedef struct InternalBuffer {
00034 uint8_t *base[AV_NUM_DATA_POINTERS];
00035 uint8_t *data[AV_NUM_DATA_POINTERS];
00036 int linesize[AV_NUM_DATA_POINTERS];
00037 int width;
00038 int height;
00039 enum PixelFormat pix_fmt;
00040 uint8_t **extended_data;
00041 int audio_data_size;
00042 int nb_channels;
00043 } InternalBuffer;
00044
00045 typedef struct AVCodecInternal {
00050 int buffer_count;
00051
00056 InternalBuffer *buffer;
00057
00064 int is_copy;
00065
00066 #if FF_API_OLD_DECODE_AUDIO
00067
00071 int sample_count;
00072 #endif
00073
00078 int last_audio_frame;
00079
00083 uint8_t *byte_buffer;
00084 unsigned int byte_buffer_size;
00085
00086 void *frame_thread_encoder;
00087
00091 int skip_samples;
00092 } AVCodecInternal;
00093
00094 struct AVCodecDefault {
00095 const uint8_t *key;
00096 const uint8_t *value;
00097 };
00098
00102 int ff_is_hwaccel_pix_fmt(enum PixelFormat pix_fmt);
00103
00112 AVHWAccel *ff_find_hwaccel(enum AVCodecID codec_id, enum PixelFormat pix_fmt);
00113
00118 int ff_match_2uint16(const uint16_t (*tab)[2], int size, int a, int b);
00119
00120 unsigned int avpriv_toupper4(unsigned int x);
00121
00125 void ff_init_buffer_info(AVCodecContext *s, AVFrame *frame);
00126
00130 void ff_packet_free_side_data(AVPacket *pkt);
00131
00132 int avpriv_lock_avformat(void);
00133 int avpriv_unlock_avformat(void);
00134
00140 #define FF_MAX_EXTRADATA_SIZE ((1 << 28) - FF_INPUT_BUFFER_PADDING_SIZE)
00141
00159 int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int size);
00160
00161 int ff_alloc_packet(AVPacket *avpkt, int size);
00162
00166 static av_always_inline int64_t ff_samples_to_time_base(AVCodecContext *avctx,
00167 int64_t samples)
00168 {
00169 if(samples == AV_NOPTS_VALUE)
00170 return AV_NOPTS_VALUE;
00171 return av_rescale_q(samples, (AVRational){ 1, avctx->sample_rate },
00172 avctx->time_base);
00173 }
00174
00175 int ff_thread_can_start_frame(AVCodecContext *avctx);
00176
00177 int ff_get_logical_cpus(AVCodecContext *avctx);
00178
00179 int avpriv_h264_has_num_reorder_frames(AVCodecContext *avctx);
00180
00181 #endif