Commit f7cd9eed authored by Anuradha Suraparaju's avatar Anuradha Suraparaju Committed by Diego Biurrun

Add Dirac support through libschroedinger.

patch by Anuradha Suraparaju, anuradha rd.bbc.co uk

Originally committed as revision 13046 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 34499963
......@@ -98,6 +98,7 @@ show_help(){
echo " --enable-libmp3lame enable MP3 encoding via libmp3lame [default=no]"
echo " --enable-libnut enable NUT (de)muxing via libnut,"
echo " native demuxer exists [default=no]"
echo " --enable-libschroedinger enable Dirac support via libschroedinger [default=no]"
echo " --enable-libtheora enable Theora encoding via libtheora [default=no]"
echo " --enable-libvorbis enable Vorbis encoding via libvorbis,"
echo " native implementation exists [default=no]"
......@@ -649,6 +650,7 @@ CONFIG_LIST="
libgsm
libmp3lame
libnut
libschroedinger
libtheora
libvorbis
libx264
......@@ -834,6 +836,8 @@ libgsm_encoder_deps="libgsm"
libgsm_ms_decoder_deps="libgsm"
libgsm_ms_encoder_deps="libgsm"
libmp3lame_encoder_deps="libmp3lame"
libschroedinger_decoder_deps="libschroedinger"
libschroedinger_encoder_deps="libschroedinger"
libtheora_encoder_deps="libtheora"
libvorbis_encoder_deps="libvorbis"
libx264_encoder_deps="libx264"
......@@ -1637,6 +1641,8 @@ enabled libfaad && require2 libfaad faad.h faacDecOpen -lfaad
enabled libgsm && require libgsm gsm.h gsm_create -lgsm
enabled libmp3lame && require LAME lame/lame.h lame_init -lmp3lame -lm
enabled libnut && require libnut libnut.h nut_demuxer_init -lnut
enabled libschroedinger && add_cflags $(pkg-config --cflags schroedinger-1.0) \
&& require libschroedinger schroedinger/schro.h schro_init -lschroedinger-1.0 -lpthread -loil-0.3 -lm -lrt
enabled libtheora && require libtheora theora/theora.h theora_info_init -ltheora -logg
enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
enabled libx264 && require x264 x264.h x264_encoder_open -lx264 -lm
......@@ -1923,6 +1929,7 @@ echo "libfaad dlopened ${libfaadbin-no}"
echo "libgsm enabled ${libgsm-no}"
echo "libmp3lame enabled ${libmp3lame-no}"
echo "libnut enabled ${libnut-no}"
echo "libschroedinger enabled ${libschroedinger-no}"
echo "libtheora enabled ${libtheora-no}"
echo "libvorbis enabled ${libvorbis-no}"
echo "x264 enabled ${libx264-no}"
......
......@@ -325,6 +325,8 @@ OBJS-$(CONFIG_LIBFAAC) += libfaac.o
OBJS-$(CONFIG_LIBFAAD) += libfaad.o
OBJS-$(CONFIG_LIBGSM) += libgsm.o
OBJS-$(CONFIG_LIBMP3LAME) += libmp3lame.o
OBJS-$(CONFIG_LIBSCHROEDINGER_DECODER) += libschroedingerdec.o libschroedinger.o libdirac_libschro.o
OBJS-$(CONFIG_LIBSCHROEDINGER_ENCODER) += libschroedingerenc.o libschroedinger.o libdirac_libschro.o
OBJS-$(CONFIG_LIBTHEORA) += libtheoraenc.o
OBJS-$(CONFIG_LIBVORBIS) += libvorbis.o
OBJS-$(CONFIG_LIBX264) += libx264.o
......
......@@ -283,6 +283,7 @@ void avcodec_register_all(void)
REGISTER_ENCDEC (LIBGSM, libgsm);
REGISTER_ENCDEC (LIBGSM_MS, libgsm_ms);
REGISTER_ENCODER (LIBMP3LAME, libmp3lame);
REGISTER_ENCDEC (LIBSCHROEDINGER, libschroedinger);
REGISTER_ENCODER (LIBTHEORA, libtheora);
REGISTER_ENCODER (LIBVORBIS, libvorbis);
REGISTER_ENCODER (LIBX264, libx264);
......
/*
* Copyright (c) 2008 BBC, Anuradha Suraparaju <asuraparaju at gmail dot com >
*
* This file is part of FFmpeg.
*
* FFmpeg 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,
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file libschroedinger.c
* function definitions common to libschroedingerdec.c and libschroedingerenc.c
*/
#include "libdirac_libschro.h"
#include "libschroedinger.h"
/**
* Schroedinger video preset table. Ensure that this tables matches up correctly
* with the ff_dirac_schro_video_format_info table in libdirac_libschro.c.
*/
static const SchroVideoFormatEnum ff_schro_video_formats[]={
SCHRO_VIDEO_FORMAT_CUSTOM ,
SCHRO_VIDEO_FORMAT_QSIF ,
SCHRO_VIDEO_FORMAT_QCIF ,
SCHRO_VIDEO_FORMAT_SIF ,
SCHRO_VIDEO_FORMAT_CIF ,
SCHRO_VIDEO_FORMAT_4SIF ,
SCHRO_VIDEO_FORMAT_4CIF ,
SCHRO_VIDEO_FORMAT_SD480I_60 ,
SCHRO_VIDEO_FORMAT_SD576I_50 ,
SCHRO_VIDEO_FORMAT_HD720P_60 ,
SCHRO_VIDEO_FORMAT_HD720P_50 ,
SCHRO_VIDEO_FORMAT_HD1080I_60 ,
SCHRO_VIDEO_FORMAT_HD1080I_50 ,
SCHRO_VIDEO_FORMAT_HD1080P_60 ,
SCHRO_VIDEO_FORMAT_HD1080P_50 ,
SCHRO_VIDEO_FORMAT_DC2K_24 ,
SCHRO_VIDEO_FORMAT_DC4K_24 ,
};
SchroVideoFormatEnum ff_get_schro_video_format_preset(AVCodecContext *avccontext)
{
unsigned int num_formats = sizeof(ff_schro_video_formats) /
sizeof(ff_schro_video_formats[0]);
unsigned int idx = ff_dirac_schro_get_video_format_idx (avccontext);
return (idx < num_formats) ?
ff_schro_video_formats[idx] : SCHRO_VIDEO_FORMAT_CUSTOM;
}
int ff_get_schro_frame_format (SchroChromaFormat schro_pix_fmt,
SchroFrameFormat *schro_frame_fmt)
{
unsigned int num_formats = sizeof(ffmpeg_schro_pixel_format_map) /
sizeof(ffmpeg_schro_pixel_format_map[0]);
int idx;
for (idx = 0; idx < num_formats; ++idx) {
if (ffmpeg_schro_pixel_format_map[idx].schro_pix_fmt == schro_pix_fmt) {
*schro_frame_fmt =
ffmpeg_schro_pixel_format_map[idx].schro_frame_fmt;
return 0;
}
}
return -1;
}
/*
* Copyright (c) 2008 BBC, Anuradha Suraparaju <asuraparaju at gmail dot com >
*
* This file is part of FFmpeg.
*
* FFmpeg 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,
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file libschroedinger.h
* data structures common to libschroedingerdec.c and libschroedingerenc.c
*/
#ifndef FFMPEG_LIBSCHROEDINGER_H
#define FFMPEG_LIBSCHROEDINGER_H
#include "config.h"
#ifdef CONFIG_LIBSCHROEDINGER
#include <schroedinger/schrobitstream.h>
#include <schroedinger/schroframe.h>
#include "avcodec.h"
static const struct {
enum PixelFormat ff_pix_fmt;
SchroChromaFormat schro_pix_fmt;
SchroFrameFormat schro_frame_fmt;
} ffmpeg_schro_pixel_format_map[] = {
{ PIX_FMT_YUV420P, SCHRO_CHROMA_420, SCHRO_FRAME_FORMAT_U8_420 },
{ PIX_FMT_YUV422P, SCHRO_CHROMA_422, SCHRO_FRAME_FORMAT_U8_422 },
{ PIX_FMT_YUV444P, SCHRO_CHROMA_444, SCHRO_FRAME_FORMAT_U8_444 },
};
/**
* Returns the video format preset matching the input video dimensions and
* time base.
*/
SchroVideoFormatEnum ff_get_schro_video_format_preset (AVCodecContext *avccontext);
/**
* Sets the Schroedinger frame format corresponding to the Schro chroma format
* passed. Returns 0 on success, -1 on failure.
*/
int ff_get_schro_frame_format (SchroChromaFormat schro_chroma_fmt,
SchroFrameFormat *schro_frame_fmt);
#endif /* CONFIG_LIBSCHROEDINGER */
#endif /* FFMPEG_LIBSCHROEDINGER_H */
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment