30 { 640, 480, 24000, 1001},
31 { 176, 120, 15000, 1001},
33 { 352, 240, 15000, 1001},
35 { 704, 480, 15000, 1001},
37 { 720, 480, 30000, 1001},
39 { 1280, 720, 60000, 1001},
41 { 1920, 1080, 30000, 1001},
42 { 1920, 1080, 25, 1 },
43 { 1920, 1080, 60000, 1001},
44 { 1920, 1080, 50, 1 },
45 { 2048, 1080, 24, 1 },
46 { 4096, 2160, 24, 1 },
51 unsigned int ret_idx = 0;
54 sizeof(ff_schro_video_format_info[0]);
56 for (idx = 1; idx < num_formats; ++idx) {
120 SCHRO_VIDEO_FORMAT_CUSTOM ,
121 SCHRO_VIDEO_FORMAT_QSIF ,
122 SCHRO_VIDEO_FORMAT_QCIF ,
123 SCHRO_VIDEO_FORMAT_SIF ,
124 SCHRO_VIDEO_FORMAT_CIF ,
125 SCHRO_VIDEO_FORMAT_4SIF ,
126 SCHRO_VIDEO_FORMAT_4CIF ,
127 SCHRO_VIDEO_FORMAT_SD480I_60 ,
128 SCHRO_VIDEO_FORMAT_SD576I_50 ,
129 SCHRO_VIDEO_FORMAT_HD720P_60 ,
130 SCHRO_VIDEO_FORMAT_HD720P_50 ,
131 SCHRO_VIDEO_FORMAT_HD1080I_60 ,
132 SCHRO_VIDEO_FORMAT_HD1080I_50 ,
133 SCHRO_VIDEO_FORMAT_HD1080P_60 ,
134 SCHRO_VIDEO_FORMAT_HD1080P_50 ,
135 SCHRO_VIDEO_FORMAT_DC2K_24 ,
136 SCHRO_VIDEO_FORMAT_DC4K_24 ,
142 sizeof(ff_schro_video_formats[0]);
146 return (idx < num_formats) ? ff_schro_video_formats[idx] :
147 SCHRO_VIDEO_FORMAT_CUSTOM;
158 for (idx = 0; idx < num_formats; ++idx) {
183 int y_width, uv_width;
184 int y_height, uv_height;
187 y_width = avccontext->
width;
188 y_height = avccontext->
height;
189 uv_width = y_width >> (SCHRO_FRAME_FORMAT_H_SHIFT(schro_frame_fmt));
190 uv_height = y_height >> (SCHRO_FRAME_FORMAT_V_SHIFT(schro_frame_fmt));
195 p_frame = schro_frame_new();
197 p_frame->width = y_width;
198 p_frame->height = y_height;
201 for (i = 0; i < 3; ++i) {
202 p_frame->components[i].width = i ? uv_width : y_width;
203 p_frame->components[i].stride = p_pic->linesize[i];
204 p_frame->components[i].height = i ? uv_height : y_height;
205 p_frame->components[i].length =
206 p_frame->components[i].stride * p_frame->components[i].height;
207 p_frame->components[i].data = p_pic->data[i];
210 p_frame->components[i].v_shift =
211 SCHRO_FRAME_FORMAT_V_SHIFT(p_frame->format);
212 p_frame->components[i].h_shift =
213 SCHRO_FRAME_FORMAT_H_SHIFT(p_frame->format);
FFSchroQueueElement * p_tail
Pointer to tail of queue.
void * data
Data to be stored in queue.
static const SchroVideoFormatEnum ff_schro_video_formats[]
Schroedinger video preset table.
SchroChromaFormat schro_pix_fmt
memory handling functions
static const struct @34 schro_pixel_format_map[]
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
four components are given, that's all.
data structures common to libschroedinger decoder and encoder
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
SchroFrame * ff_create_schro_frame(AVCodecContext *avccontext, SchroFrameFormat schro_frame_fmt)
Create a Schro frame based on the dimensions and frame format passed.
void avpicture_free(AVPicture *picture)
Free a picture previously allocated by avpicture_alloc().
void * ff_schro_queue_pop(FFSchroQueue *queue)
Return the first element in the queue.
void ff_schro_queue_init(FFSchroQueue *queue)
Initialise the queue.
int ff_get_schro_frame_format(SchroChromaFormat schro_pix_fmt, SchroFrameFormat *schro_frame_fmt)
Sets the Schroedinger frame format corresponding to the Schro chroma format passed.
static unsigned int get_video_format_idx(AVCodecContext *avccontext)
int ff_schro_queue_push_back(FFSchroQueue *queue, void *p_data)
Add an element to the end of the queue.
void ff_schro_queue_free(FFSchroQueue *queue, void(*free_func)(void *))
Free the queue resources.
A simple queue implementation used in libschroedinger.
int width
picture width / height.
SchroVideoFormatEnum ff_get_schro_video_format_preset(AVCodecContext *avccontext)
Returns the video format preset matching the input video dimensions and time base.
main external API structure.
int avpicture_alloc(AVPicture *picture, enum AVPixelFormat pix_fmt, int width, int height)
Allocate memory for a picture.
SchroFrameFormat schro_frame_fmt
struct FFSchroQueueElement * next
Pointer to next element queue.
FFSchroQueueElement * p_head
Pointer to head of queue.
static const SchroVideoFormatInfo ff_schro_video_format_info[]
static void free_schro_frame(SchroFrame *frame, void *priv)
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...