Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: FFmpeg/FFmpeg
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ac7d0c79c3f6
Choose a base ref
...
head repository: FFmpeg/FFmpeg
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7ed9ec033f5f
Choose a head ref
  • 7 commits
  • 11 files changed
  • 5 contributors

Commits on Sep 27, 2012

  1. avformat: Identify anonymous AVIO typedef structs.

    Anonymous typedef structs prevent forward declaration, this
    change gives the AVIOContext and AVIOInterruptCB structures
    a name.  These structures are now in line with other common
    structures such as AVFormatContext and AVCodecContext.
    
    Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
    Signed-off-by: Diego Biurrun <diego@biurrun.de>
    dalecurtis authored and DonDiego committed Sep 27, 2012
    Copy the full SHA
    0575772 View commit details
  2. Add Opus codec id and codec description.

    Signed-off-by: Diego Biurrun <diego@biurrun.de>
    daddesio authored and DonDiego committed Sep 27, 2012
    Copy the full SHA
    2a3d82a View commit details
  3. Add Opus support to the Ogg muxer.

    Signed-off-by: Diego Biurrun <diego@biurrun.de>
    saintdev authored and DonDiego committed Sep 27, 2012
    Copy the full SHA
    bcc1f7c View commit details
  4. Copy the full SHA
    0ae3ba8 View commit details
  5. Copy the full SHA
    8365544 View commit details
  6. Copy the full SHA
    4e5b7f3 View commit details

Commits on Sep 28, 2012

  1. Merge remote-tracking branch 'qatar/master'

    * qatar/master:
      dwt: Drop unused functions spatial_compose{53|97}i()
      nutdec: Remove unused and broken debug function stub
      avcodec: Drop long-deprecated imgconvert.h header
      Add Opus support to the Ogg muxer.
      Add Opus codec id and codec description.
      avformat: Identify anonymous AVIO typedef structs.
    
    Conflicts:
    	libavcodec/avcodec.h
    	libavcodec/codec_desc.c
    	libavcodec/imgconvert.h
    	libavcodec/version.h
    	libavformat/oggenc.c
    	libavformat/version.h
    
    Merged-by: Michael Niedermayer <michaelni@gmx.at>
    michaelni committed Sep 28, 2012
    Copy the full SHA
    7ed9ec0 View commit details
Showing with 59 additions and 75 deletions.
  1. +1 −0 libavcodec/avcodec.h
  2. +2 −1 libavcodec/codec_desc.c
  3. +0 −18 libavcodec/dwt.c
  4. +0 −1 libavcodec/imgconvert.c
  5. +0 −44 libavcodec/imgconvert.h
  6. +0 −1 libavcodec/rawdec.c
  7. +1 −1 libavcodec/utils.c
  8. +1 −1 libavcodec/version.h
  9. +2 −2 libavformat/avio.h
  10. +51 −5 libavformat/oggenc.c
  11. +1 −1 libavformat/version.h
1 change: 1 addition & 0 deletions libavcodec/avcodec.h
Original file line number Diff line number Diff line change
@@ -423,6 +423,7 @@ enum AVCodecID {
AV_CODEC_ID_RALF,
AV_CODEC_ID_IAC,
AV_CODEC_ID_ILBC,
AV_CODEC_ID_OPUS_DEPRECATED,
AV_CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'),
AV_CODEC_ID_8SVX_RAW = MKBETAG('8','S','V','X'),
AV_CODEC_ID_SONIC = MKBETAG('S','O','N','C'),
3 changes: 2 additions & 1 deletion libavcodec/codec_desc.c
Original file line number Diff line number Diff line change
@@ -2242,7 +2242,8 @@ static const AVCodecDescriptor codec_descriptors[] = {
.id = AV_CODEC_ID_OPUS,
.type = AVMEDIA_TYPE_AUDIO,
.name = "opus",
.long_name = NULL_IF_CONFIG_SMALL("Opus"),
.long_name = NULL_IF_CONFIG_SMALL("Opus (Opus Interactive Audio Codec)"),
.props = AV_CODEC_PROP_LOSSY,
},

/* subtitle codecs */
18 changes: 0 additions & 18 deletions libavcodec/dwt.c
Original file line number Diff line number Diff line change
@@ -468,15 +468,6 @@ static void spatial_compose53i_dy(DWTCompose *cs, IDWTELEM *buffer,
cs->y += 2;
}

static void av_unused spatial_compose53i(IDWTELEM *buffer, IDWTELEM *temp,
int width, int height, int stride)
{
DWTCompose cs;
spatial_compose53i_init(&cs, buffer, height, stride);
while (cs.y <= height)
spatial_compose53i_dy(&cs, buffer, temp, width, height, stride);
}

void ff_snow_horizontal_compose97i(IDWTELEM *b, IDWTELEM *temp, int width)
{
const int w2 = (width + 1) >> 1;
@@ -651,15 +642,6 @@ static void spatial_compose97i_dy(DWTCompose *cs, IDWTELEM *buffer,
cs->y += 2;
}

static void av_unused spatial_compose97i(IDWTELEM *buffer, IDWTELEM *temp,
int width, int height, int stride)
{
DWTCompose cs;
spatial_compose97i_init(&cs, buffer, height, stride);
while (cs.y <= height)
spatial_compose97i_dy(&cs, buffer, temp, width, height, stride);
}

void ff_spatial_idwt_buffered_init(DWTCompose *cs, slice_buffer *sb, int width,
int height, int stride_line, int type,
int decomposition_count)
1 change: 0 additions & 1 deletion libavcodec/imgconvert.c
Original file line number Diff line number Diff line change
@@ -33,7 +33,6 @@
#include "avcodec.h"
#include "dsputil.h"
#include "internal.h"
#include "imgconvert.h"
#include "libavutil/colorspace.h"
#include "libavutil/common.h"
#include "libavutil/pixdesc.h"
44 changes: 0 additions & 44 deletions libavcodec/imgconvert.h

This file was deleted.

1 change: 0 additions & 1 deletion libavcodec/rawdec.c
Original file line number Diff line number Diff line change
@@ -25,7 +25,6 @@
*/

#include "avcodec.h"
#include "imgconvert.h"
#include "raw.h"
#include "libavutil/avassert.h"
#include "libavutil/common.h"
2 changes: 1 addition & 1 deletion libavcodec/utils.c
Original file line number Diff line number Diff line change
@@ -38,7 +38,6 @@
#include "avcodec.h"
#include "dsputil.h"
#include "libavutil/opt.h"
#include "imgconvert.h"
#include "thread.h"
#include "frame_thread_encoder.h"
#include "audioconvert.h"
@@ -1848,6 +1847,7 @@ static enum AVCodecID remap_deprecated_codec_id(enum AVCodecID id)
//This is for future deprecatec codec ids, its empty since
//last major bump but will fill up again over time, please don't remove it
// case AV_CODEC_ID_UTVIDEO_DEPRECATED: return AV_CODEC_ID_UTVIDEO;
case AV_CODEC_ID_OPUS_DEPRECATED: return AV_CODEC_ID_OPUS;
default : return id;
}
}
2 changes: 1 addition & 1 deletion libavcodec/version.h
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@
*/

#define LIBAVCODEC_VERSION_MAJOR 54
#define LIBAVCODEC_VERSION_MINOR 59
#define LIBAVCODEC_VERSION_MINOR 60
#define LIBAVCODEC_VERSION_MICRO 100

#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
4 changes: 2 additions & 2 deletions libavformat/avio.h
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@
* new elements have been added after this struct in AVFormatContext
* or AVIOContext.
*/
typedef struct {
typedef struct AVIOInterruptCB {
int (*callback)(void*);
void *opaque;
} AVIOInterruptCB;
@@ -65,7 +65,7 @@ typedef struct {
* when implementing custom I/O. Normally these are set to the
* function pointers specified in avio_alloc_context()
*/
typedef struct {
typedef struct AVIOContext {
/**
* A class for private options.
*
56 changes: 51 additions & 5 deletions libavformat/oggenc.c
Original file line number Diff line number Diff line change
@@ -349,6 +349,35 @@ static int ogg_build_speex_headers(AVCodecContext *avctx,
return 0;
}

#define OPUS_HEADER_SIZE 19

static int ogg_build_opus_headers(AVCodecContext *avctx,
OGGStreamContext *oggstream, int bitexact,
AVDictionary **m)
{
uint8_t *p;

if (avctx->extradata_size < OPUS_HEADER_SIZE)
return -1;

/* first packet: Opus header */
p = av_mallocz(avctx->extradata_size);
if (!p)
return AVERROR(ENOMEM);
oggstream->header[0] = p;
oggstream->header_len[0] = avctx->extradata_size;
bytestream_put_buffer(&p, avctx->extradata, avctx->extradata_size);

/* second packet: VorbisComment */
p = ogg_write_vorbiscomment(8, bitexact, &oggstream->header_len[1], m, 0);
if (!p)
return AVERROR(ENOMEM);
oggstream->header[1] = p;
bytestream_put_buffer(&p, "OpusTags", 8);

return 0;
}

static int ogg_write_header(AVFormatContext *s)
{
OGGStreamContext *oggstream;
@@ -359,13 +388,18 @@ static int ogg_write_header(AVFormatContext *s)
unsigned serial_num = i;

if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO)
avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
if (st->codec->codec_id == AV_CODEC_ID_OPUS)
/* Opus requires a fixed 48kHz clock */
avpriv_set_pts_info(st, 64, 1, 48000);
else
avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
else if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO)
avpriv_set_pts_info(st, 64, st->codec->time_base.num, st->codec->time_base.den);
if (st->codec->codec_id != AV_CODEC_ID_VORBIS &&
st->codec->codec_id != AV_CODEC_ID_THEORA &&
st->codec->codec_id != AV_CODEC_ID_SPEEX &&
st->codec->codec_id != AV_CODEC_ID_FLAC) {
st->codec->codec_id != AV_CODEC_ID_FLAC &&
st->codec->codec_id != AV_CODEC_ID_OPUS) {
av_log(s, AV_LOG_ERROR, "Unsupported codec id in stream %d\n", i);
return -1;
}
@@ -407,6 +441,15 @@ static int ogg_write_header(AVFormatContext *s)
av_freep(&st->priv_data);
return err;
}
} else if (st->codec->codec_id == AV_CODEC_ID_OPUS) {
int err = ogg_build_opus_headers(st->codec, oggstream,
st->codec->flags & CODEC_FLAG_BITEXACT,
&s->metadata);
if (err) {
av_log(s, AV_LOG_ERROR, "Error writing Opus headers\n");
av_freep(&st->priv_data);
return err;
}
} else {
uint8_t *p;
const char *cstr = st->codec->codec_id == AV_CODEC_ID_VORBIS ? "vorbis" : "theora";
@@ -503,7 +546,9 @@ static int ogg_write_packet(AVFormatContext *s, AVPacket *pkt)
pframe_count = 0;
}
granule = (oggstream->last_kf_pts<<oggstream->kfgshift) | pframe_count;
} else
} else if (st->codec->codec_id == AV_CODEC_ID_OPUS)
granule = pkt->pts + pkt->duration + av_rescale_q(st->codec->delay, (AVRational){ 1, st->codec->sample_rate }, st->time_base);
else
granule = pkt->pts + pkt->duration;

ret = ogg_buffer_data(s, st, pkt->data, pkt->size, granule, 0);
@@ -531,7 +576,8 @@ static int ogg_write_trailer(AVFormatContext *s)
AVStream *st = s->streams[i];
OGGStreamContext *oggstream = st->priv_data;
if (st->codec->codec_id == AV_CODEC_ID_FLAC ||
st->codec->codec_id == AV_CODEC_ID_SPEEX) {
st->codec->codec_id == AV_CODEC_ID_SPEEX ||
st->codec->codec_id == AV_CODEC_ID_OPUS) {
av_freep(&oggstream->header[0]);
}
av_freep(&oggstream->header[1]);
@@ -544,7 +590,7 @@ AVOutputFormat ff_ogg_muxer = {
.name = "ogg",
.long_name = NULL_IF_CONFIG_SMALL("Ogg"),
.mime_type = "application/ogg",
.extensions = "ogg,ogv,spx",
.extensions = "ogg,ogv,spx,opus",
.priv_data_size = sizeof(OGGContext),
.audio_codec = AV_CODEC_ID_FLAC,
.video_codec = AV_CODEC_ID_THEORA,
2 changes: 1 addition & 1 deletion libavformat/version.h
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@

#define LIBAVFORMAT_VERSION_MAJOR 54
#define LIBAVFORMAT_VERSION_MINOR 29
#define LIBAVFORMAT_VERSION_MICRO 104
#define LIBAVFORMAT_VERSION_MICRO 105

#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \