* Copyright (c) 2005 BBC, Andrew Kennedy <dirac at rd dot bbc dot co dot uk>
* Copyright (c) 2006-2008 BBC, Anuradha Suraparaju <asuraparaju at gmail dot com >
*
- * This file is part of FFmpeg.
+ * This file is part of Libav.
*
- * FFmpeg is free software; you can redistribute it and/or
+ * Libav is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
- * FFmpeg is distributed in the hope that it will be useful,
+ * Libav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
-* @file libavcodec/libdiracenc.c
+* @file
* Dirac encoding support via libdirac library; more details about the
* Dirac project can be found at http://dirac.sourceforge.net/.
* The libdirac_encoder library implements Dirac specification version 2.2
#include <libdirac_encoder/dirac_encoder.h>
/** Dirac encoder private data */
-typedef struct FfmpegDiracEncoderParams {
+typedef struct DiracEncoderParams {
/** Dirac encoder context */
dirac_encoder_context_t enc_ctx;
int enc_buf_size;
/** queue storing encoded frames */
- FfmpegDiracSchroQueue enc_frame_queue;
+ DiracSchroQueue enc_frame_queue;
/** end of sequence signalled by user, 0 - false, 1 - true */
int eos_signalled;
/** end of sequence returned by encoder, 0 - false, 1 - true */
int eos_pulled;
-} FfmpegDiracEncoderParams;
+} DiracEncoderParams;
/**
* Works out Dirac-compatible chroma format.
*/
static dirac_chroma_t GetDiracChromaFormat(enum PixelFormat ff_pix_fmt)
{
- int num_formats = sizeof(ffmpeg_dirac_pixel_format_map) /
- sizeof(ffmpeg_dirac_pixel_format_map[0]);
+ int num_formats = sizeof(dirac_pixel_format_map) /
+ sizeof(dirac_pixel_format_map[0]);
int idx;
for (idx = 0; idx < num_formats; ++idx)
- if (ffmpeg_dirac_pixel_format_map[idx].ff_pix_fmt == ff_pix_fmt)
- return ffmpeg_dirac_pixel_format_map[idx].dirac_pix_fmt;
+ if (dirac_pixel_format_map[idx].ff_pix_fmt == ff_pix_fmt)
+ return dirac_pixel_format_map[idx].dirac_pix_fmt;
return formatNK;
}
static av_cold int libdirac_encode_init(AVCodecContext *avccontext)
{
- FfmpegDiracEncoderParams* p_dirac_params = avccontext->priv_data;
+ DiracEncoderParams* p_dirac_params = avccontext->priv_data;
int no_local = 1;
int verbose = avccontext->debug;
VideoFormat preset;
static void DiracFreeFrame(void *data)
{
- FfmpegDiracSchroEncodedFrame *enc_frame = data;
+ DiracSchroEncodedFrame *enc_frame = data;
av_freep(&(enc_frame->p_encbuf));
av_free(enc_frame);
{
int enc_size = 0;
dirac_encoder_state_t state;
- FfmpegDiracEncoderParams* p_dirac_params = avccontext->priv_data;
- FfmpegDiracSchroEncodedFrame* p_frame_output = NULL;
- FfmpegDiracSchroEncodedFrame* p_next_output_frame = NULL;
+ DiracEncoderParams *p_dirac_params = avccontext->priv_data;
+ DiracSchroEncodedFrame *p_frame_output = NULL;
+ DiracSchroEncodedFrame *p_next_output_frame = NULL;
int go = 1;
int last_frame_in_sequence = 0;
break;
/* create output frame */
- p_frame_output = av_mallocz(sizeof(FfmpegDiracSchroEncodedFrame));
+ p_frame_output = av_mallocz(sizeof(DiracSchroEncodedFrame));
/* set output data */
p_frame_output->size = p_dirac_params->enc_buf_size;
p_frame_output->p_encbuf = p_dirac_params->enc_buf;
static av_cold int libdirac_encode_close(AVCodecContext *avccontext)
{
- FfmpegDiracEncoderParams* p_dirac_params = avccontext->priv_data;
+ DiracEncoderParams *p_dirac_params = avccontext->priv_data;
/* close the encoder */
dirac_encoder_close(p_dirac_params->p_encoder);
}
-AVCodec libdirac_encoder = {
- "libdirac",
- AVMEDIA_TYPE_VIDEO,
- CODEC_ID_DIRAC,
- sizeof(FfmpegDiracEncoderParams),
- libdirac_encode_init,
- libdirac_encode_frame,
- libdirac_encode_close,
+AVCodec ff_libdirac_encoder = {
+ .name = "libdirac",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = CODEC_ID_DIRAC,
+ .priv_data_size = sizeof(DiracEncoderParams),
+ .init = libdirac_encode_init,
+ .encode = libdirac_encode_frame,
+ .close = libdirac_encode_close,
.capabilities = CODEC_CAP_DELAY,
.pix_fmts = (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUV444P, PIX_FMT_NONE},
.long_name = NULL_IF_CONFIG_SMALL("libdirac Dirac 2.2"),