r665: Merged the official release 2.0.
[cinelerra_cv.git] / quicktime / qtffmpeg.h
blob82024784aef068a49302516f3e643efb53d73ea9
1 #ifndef QTFFMPEG_H
2 #define QTFFMPEG_H
6 // This must be separate from qtprivate.h to keep everyone from
7 // depending on avcodec.h
8 // FFMPEG front end for quicktime.
9 // Getting ffmpeg to do all the things it needs to do is so labor
10 // intensive, we have a front end for the ffmpeg front end.
13 // This front end is bastardized to support alternating fields with
14 // alternating ffmpeg instances. It drastically reduces the bitrate
15 // required to store interlaced video but nothing can read it but
16 // Heroine Virtual.
20 #include "avcodec.h"
21 #include "qtprivate.h"
25 typedef struct
27 #define FIELDS 2
28 // Encoding
29 AVCodec *encoder[FIELDS];
30 AVCodecContext *encoder_context[FIELDS];
33 // Decoding
34 AVCodec *decoder[FIELDS];
35 AVCodecContext *decoder_context[FIELDS];
36 AVFrame picture[FIELDS];
38 // Last frame decoded
39 int64_t last_frame[FIELDS];
40 // Rounded dimensions
41 int width_i;
42 int height_i;
43 // Original dimensions
44 int width;
45 int height;
46 int fields;
49 // Temporary storage for color conversions
50 char *temp_frame;
51 // Storage of compressed data
52 unsigned char *work_buffer;
53 // Allocation of work_buffer
54 int buffer_size;
55 int ffmpeg_id;
56 } quicktime_ffmpeg_t;
58 extern int ffmpeg_initialized;
59 extern pthread_mutex_t ffmpeg_lock;
62 quicktime_ffmpeg_t* quicktime_new_ffmpeg(
63 int cpus,
64 int fields,
65 int ffmpeg_id,
66 int w,
67 int h,
68 // FFmpeg needs this for the header
69 quicktime_stsd_table_t *stsd_table);
70 void quicktime_delete_ffmpeg(quicktime_ffmpeg_t *ptr);
71 int quicktime_ffmpeg_decode(quicktime_ffmpeg_t *ffmpeg,
72 quicktime_t *file,
73 unsigned char **row_pointers,
74 int track);
78 #endif