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 } AVCodecInternal;
00086
00087 struct AVCodecDefault {
00088 const uint8_t *key;
00089 const uint8_t *value;
00090 };
00091
00095 int ff_is_hwaccel_pix_fmt(enum PixelFormat pix_fmt);
00096
00105 AVHWAccel *ff_find_hwaccel(enum CodecID codec_id, enum PixelFormat pix_fmt);
00106
00111 int ff_match_2uint16(const uint16_t (*tab)[2], int size, int a, int b);
00112
00113 unsigned int avpriv_toupper4(unsigned int x);
00114
00118 void ff_init_buffer_info(AVCodecContext *s, AVFrame *pic);
00119
00123 void ff_packet_free_side_data(AVPacket *pkt);
00124
00125 int avpriv_lock_avformat(void);
00126 int avpriv_unlock_avformat(void);
00127
00133 #define FF_MAX_EXTRADATA_SIZE ((1 << 28) - FF_INPUT_BUFFER_PADDING_SIZE)
00134
00152 int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int size);
00153
00154 int ff_alloc_packet(AVPacket *avpkt, int size);
00155
00159 static av_always_inline int64_t ff_samples_to_time_base(AVCodecContext *avctx,
00160 int64_t samples)
00161 {
00162 if(samples == AV_NOPTS_VALUE)
00163 return AV_NOPTS_VALUE;
00164 return av_rescale_q(samples, (AVRational){ 1, avctx->sample_rate },
00165 avctx->time_base);
00166 }
00167
00168 int ff_thread_can_start_frame(AVCodecContext *avctx);
00169
00170 #endif