Libav
libschroedinger.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008 BBC, Anuradha Suraparaju <asuraparaju at gmail dot com >
3  *
4  * This file is part of Libav.
5  *
6  * Libav is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * Libav is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with Libav; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
26 #ifndef AVCODEC_LIBSCHROEDINGER_H
27 #define AVCODEC_LIBSCHROEDINGER_H
28 
29 #include <schroedinger/schrobitstream.h>
30 #include <schroedinger/schroframe.h>
31 
32 #include "avcodec.h"
33 
34 typedef struct SchroVideoFormatInfo {
35  uint16_t width;
36  uint16_t height;
37  uint16_t frame_rate_num;
38  uint16_t frame_rate_denom;
40 
44 typedef struct FFSchroEncodedFrame {
47 
49  uint32_t size;
50 
52  uint32_t frame_num;
53 
55  uint16_t key_frame;
57 
61 typedef struct FFSchroQueueElement {
63  void *data;
67 
68 
72 typedef struct FFSchroQueue {
78  int size;
79 } FFSchroQueue;
80 
85 
89 int ff_schro_queue_push_back(FFSchroQueue *queue, void *p_data);
90 
94 void *ff_schro_queue_pop(FFSchroQueue *queue);
95 
101 void ff_schro_queue_free(FFSchroQueue *queue, void (*free_func)(void *));
102 
103 static const struct {
105  SchroChromaFormat schro_pix_fmt;
106  SchroFrameFormat schro_frame_fmt;
108  { AV_PIX_FMT_YUV420P, SCHRO_CHROMA_420, SCHRO_FRAME_FORMAT_U8_420 },
109  { AV_PIX_FMT_YUV422P, SCHRO_CHROMA_422, SCHRO_FRAME_FORMAT_U8_422 },
110  { AV_PIX_FMT_YUV444P, SCHRO_CHROMA_444, SCHRO_FRAME_FORMAT_U8_444 },
111 };
112 
117 SchroVideoFormatEnum ff_get_schro_video_format_preset (AVCodecContext *avctx);
118 
123 int ff_get_schro_frame_format(SchroChromaFormat schro_chroma_fmt,
124  SchroFrameFormat *schro_frame_fmt);
125 
130 SchroFrame *ff_create_schro_frame(AVCodecContext *avctx,
131  SchroFrameFormat schro_frame_fmt);
132 
133 #endif /* AVCODEC_LIBSCHROEDINGER_H */
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:70
FFSchroQueueElement * p_tail
Pointer to tail of queue.
void * data
Data to be stored in queue.
SchroChromaFormat schro_pix_fmt
uint16_t key_frame
key frame flag.
enum AVPixelFormat ff_pix_fmt
uint8_t
uint32_t frame_num
encoded frame number.
void ff_schro_queue_free(FFSchroQueue *queue, void(*free_func)(void *))
Free the queue resources.
contains a single encoded frame returned from Dirac or Schroedinger
SchroVideoFormatEnum ff_get_schro_video_format_preset(AVCodecContext *avctx)
Returns the video format preset matching the input video dimensions and time base.
int size
Queue size.
uint8_t * p_encbuf
encoded frame data
void * ff_schro_queue_pop(FFSchroQueue *queue)
Return the first element in the queue.
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:69
Libavcodec external API header.
AVPixelFormat
Pixel format.
Definition: pixfmt.h:63
A simple queue implementation used in libschroedinger.
static const struct @40 schro_pixel_format_map[]
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:65
main external API structure.
Definition: avcodec.h:1050
SchroFrameFormat schro_frame_fmt
int ff_schro_queue_push_back(FFSchroQueue *queue, void *p_data)
Add an element to the end of the queue.
struct FFSchroQueueElement * next
Pointer to next element queue.
FFSchroQueueElement * p_head
Pointer to head of queue.
void ff_schro_queue_init(FFSchroQueue *queue)
Initialise the queue.
queue element
SchroFrame * ff_create_schro_frame(AVCodecContext *avctx, SchroFrameFormat schro_frame_fmt)
Create a Schro frame based on the dimensions and frame format passed.
uint32_t size
encoded frame size
int ff_get_schro_frame_format(SchroChromaFormat schro_chroma_fmt, SchroFrameFormat *schro_frame_fmt)
Sets the Schroedinger frame format corresponding to the Schro chroma format passed.