summaryrefslogtreecommitdiff
path: root/libavcodec/libschroedingerenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-05-07 22:42:41 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-05-07 22:51:34 +0200
commit653d117c29123d353ce3bdd7de71e830a26733c1 (patch)
tree996ad2bd13c774dc3265cbf0d8ae406372d57307 /libavcodec/libschroedingerenc.c
parentcb982739fa2b43afb7f1262c07804cad41f778de (diff)
parentfdc918632f5c16cf377a2170cd2f101933fb15ff (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: libschroedinger: Switch to function names more in line with Libav style. Move code shared between libdirac and libschroedinger to libschroedinger. lavfi: uninline avfilter_copy_buffer_ref_props(). lavf: add missing '*' in a doxy. h264: Remove a commented-out function pointer typedef. txd: Remove write-only variable in txd_decode_frame(). mmvideo.c: Remove unused variable in mm_decode_pal(). build: cosmetics: Add missing end-of-line backslashes to item lists. build: cosmetics: Split HEADERS/OBJS/PROGS lists into one entry per line. libschroedinger: Move a function to avoid a forward declaration. pthread: warn on high thread counts vf_yadif: fix missing error handling for avfilter_poll_frame() avprobe: allow showing only one container/stream property. lavfi: support audio in avfilter_copy_frame_props(). lavfi: avfilter_merge_formats: handle case where inputs are same lavc: add sample rate and channel layout to AVFrame. zerocodec: check if the previous frame is missing doc: clarify check for NULL pointer style Conflicts: doc/APIchanges doc/developer.texi ffprobe.c libavcodec/Makefile libavcodec/avcodec.h libavcodec/libdirac_libschro.c libavcodec/libdirac_libschro.h libavcodec/mmvideo.c libavcodec/txd.c libavcodec/version.h libavcodec/zerocodec.c libavfilter/Makefile libavfilter/avfilter.c libavfilter/version.h libavformat/Makefile libavutil/Makefile Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/libschroedingerenc.c')
-rw-r--r--libavcodec/libschroedingerenc.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/libavcodec/libschroedingerenc.c b/libavcodec/libschroedingerenc.c
index 71c4fd8955..0cea5a7194 100644
--- a/libavcodec/libschroedingerenc.c
+++ b/libavcodec/libschroedingerenc.c
@@ -36,7 +36,6 @@
#include "avcodec.h"
#include "internal.h"
-#include "libdirac_libschro.h"
#include "libschroedinger.h"
#include "bytestream.h"
@@ -65,7 +64,7 @@ typedef struct SchroEncoderParams {
int enc_buf_size;
/** queue storing encoded frames */
- DiracSchroQueue enc_frame_queue;
+ FFSchroQueue enc_frame_queue;
/** end of sequence signalled */
int eos_signalled;
@@ -80,7 +79,7 @@ typedef struct SchroEncoderParams {
/**
* Works out Schro-compatible chroma format.
*/
-static int SetSchroChromaFormat(AVCodecContext *avccontext)
+static int set_chroma_format(AVCodecContext *avccontext)
{
int num_formats = sizeof(schro_pixel_format_map) /
sizeof(schro_pixel_format_map[0]);
@@ -129,7 +128,7 @@ static int libschroedinger_encode_init(AVCodecContext *avccontext)
p_schro_params->format->width = avccontext->width;
p_schro_params->format->height = avccontext->height;
- if (SetSchroChromaFormat(avccontext) == -1)
+ if (set_chroma_format(avccontext) == -1)
return -1;
if (avccontext->color_primaries == AVCOL_PRI_BT709) {
@@ -236,7 +235,7 @@ static int libschroedinger_encode_init(AVCodecContext *avccontext)
schro_encoder_start(p_schro_params->encoder);
/* Initialize the encoded frame queue. */
- ff_dirac_schro_queue_init(&p_schro_params->enc_frame_queue);
+ ff_schro_queue_init(&p_schro_params->enc_frame_queue);
return 0;
}
@@ -259,9 +258,9 @@ static SchroFrame *libschroedinger_frame_from_data(AVCodecContext *avccontext,
return in_frame;
}
-static void SchroedingerFreeFrame(void *data)
+static void libschroedinger_free_frame(void *data)
{
- DiracSchroEncodedFrame *enc_frame = data;
+ FFSchroEncodedFrame *enc_frame = data;
av_freep(&enc_frame->p_encbuf);
av_free(enc_frame);
@@ -273,7 +272,7 @@ static int libschroedinger_encode_frame(AVCodecContext *avccontext, AVPacket *pk
int enc_size = 0;
SchroEncoderParams *p_schro_params = avccontext->priv_data;
SchroEncoder *encoder = p_schro_params->encoder;
- struct DiracSchroEncodedFrame *p_frame_output = NULL;
+ struct FFSchroEncodedFrame *p_frame_output = NULL;
int go = 1;
SchroBuffer *enc_buf;
int presentation_frame;
@@ -333,7 +332,7 @@ static int libschroedinger_encode_frame(AVCodecContext *avccontext, AVPacket *pk
}
/* Create output frame. */
- p_frame_output = av_mallocz(sizeof(DiracSchroEncodedFrame));
+ p_frame_output = av_mallocz(sizeof(FFSchroEncodedFrame));
/* Set output data. */
p_frame_output->size = p_schro_params->enc_buf_size;
p_frame_output->p_encbuf = p_schro_params->enc_buf;
@@ -345,8 +344,8 @@ static int libschroedinger_encode_frame(AVCodecContext *avccontext, AVPacket *pk
* through 17 represesent the frame number. */
p_frame_output->frame_num = AV_RB32(enc_buf->data + 13);
- ff_dirac_schro_queue_push_back(&p_schro_params->enc_frame_queue,
- p_frame_output);
+ ff_schro_queue_push_back(&p_schro_params->enc_frame_queue,
+ p_frame_output);
p_schro_params->enc_buf_size = 0;
p_schro_params->enc_buf = NULL;
@@ -373,7 +372,7 @@ static int libschroedinger_encode_frame(AVCodecContext *avccontext, AVPacket *pk
p_schro_params->eos_pulled)
last_frame_in_sequence = 1;
- p_frame_output = ff_dirac_schro_queue_pop(&p_schro_params->enc_frame_queue);
+ p_frame_output = ff_schro_queue_pop(&p_schro_params->enc_frame_queue);
if (!p_frame_output)
return 0;
@@ -410,7 +409,7 @@ static int libschroedinger_encode_frame(AVCodecContext *avccontext, AVPacket *pk
error:
/* free frame */
- SchroedingerFreeFrame(p_frame_output);
+ libschroedinger_free_frame(p_frame_output);
return ret;
}
@@ -423,8 +422,8 @@ static int libschroedinger_encode_close(AVCodecContext *avccontext)
schro_encoder_free(p_schro_params->encoder);
/* Free data in the output frame queue. */
- ff_dirac_schro_queue_free(&p_schro_params->enc_frame_queue,
- SchroedingerFreeFrame);
+ ff_schro_queue_free(&p_schro_params->enc_frame_queue,
+ libschroedinger_free_frame);
/* Free the encoder buffer. */