Imported Upstream version 2.3.1

This commit is contained in:
Andreas Cadhalpun 2014-07-31 21:25:56 +02:00
parent 19fcffb6ec
commit 051de379f5
20 changed files with 286 additions and 43 deletions

View File

@ -1,6 +1,11 @@
Entries are sorted chronologically from oldest to youngest within each release,
releases are sorted from youngest to oldest.
version 2.3.1:
- public AVDCT API/ABI for DCT functions
- g2meet: allow size changes within original sizes
- dv: improved error resilience, fixing Ticket2340 and Ticket2341
version 2.3:
- AC3 fixed-point decoding
- shuffleplanes filter

View File

@ -528,8 +528,8 @@ x86 Michael Niedermayer
Releases
========
2.3 Michael Niedermayer
2.2 Michael Niedermayer
2.1 Michael Niedermayer
1.2 Michael Niedermayer
If you want to maintain an older release, please contact us

View File

@ -1 +1 @@
2.3
2.3.1

View File

@ -105,7 +105,7 @@
Other interesting new features including hqx video filter, a pixel art
scaling filter; a fixed-point AC-3 decoder contributed by Imagination
Technologies; an On2 TrueMotion VP7 video decoder; an HTML5 WebVTT
subtitle decoder that allows creation of WebVTT from any text-based
subtitle encoder that allows creation of WebVTT from any text-based
subtitles; and an 1-bit Direct Stream Digital audio decoder.
┌────────────────────────────┐

View File

@ -1 +1 @@
2.3
2.3.1

View File

@ -35,6 +35,10 @@ API changes, most recent first:
is now setting AVStream.time_base, instead of AVStream.codec.time_base as was
done previously. The old method is now deprecated.
2014-06-11 - 67d29da - lavc 55.66.101 - avcodec.h
Increase FF_INPUT_BUFFER_PADDING_SIZE to 32 due to some corner cases needing
it
2014-06-10 - xxxxxxx - lavf 55.43.100 - avformat.h
New field int64_t max_analyze_duration2 instead of deprecated
int max_analyze_duration.

View File

@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = 2.3
PROJECT_NUMBER = 2.3.1
# With the PROJECT_LOGO tag one can specify a logo or icon that is included
# in the documentation. The maximum height of the logo should not exceed 55

View File

@ -483,6 +483,21 @@ ffplay -f lavfi "movie=test.avi[out0];amovie=test.wav[out1]"
@end itemize
@section libcdio
Audio-CD input device based on cdio.
To enable this input device during configuration you need libcdio
installed on your system.
This device allows playing and grabbing from an Audio-CD.
For example to copy with @command{ffmpeg} the entire Audio-CD in /dev/sr0,
you may run the command:
@example
ffmpeg -f libcdio -i /dev/sr0 cd.wav
@end example
@section libdc1394
IIDC1394 input device, based on libdc1394 and libraw1394.

View File

@ -15,6 +15,7 @@ HEADERS = avcodec.h \
OBJS = allcodecs.o \
audioconvert.o \
avdct.o \
avpacket.o \
avpicture.o \
bitstream.o \

124
libavcodec/avdct.c Normal file
View File

@ -0,0 +1,124 @@
/*
* Copyright (c) 2014 Michael Niedermayer <michaelni@gmx.at>
*
* 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
*/
#include "avcodec.h"
#include "idctdsp.h"
#include "fdctdsp.h"
#include "avdct.h"
#define OFFSET(x) offsetof(AVDCT,x)
#define DEFAULT 0 //should be NAN but it does not work as it is not a constant in glibc as required by ANSI/ISO C
//these names are too long to be readable
#define V AV_OPT_FLAG_VIDEO_PARAM
#define A AV_OPT_FLAG_AUDIO_PARAM
#define E AV_OPT_FLAG_ENCODING_PARAM
#define D AV_OPT_FLAG_DECODING_PARAM
static const AVOption avdct_options[] = {
{"dct", "DCT algorithm", OFFSET(dct_algo), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, V|E, "dct"},
{"auto", "autoselect a good one (default)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_AUTO }, INT_MIN, INT_MAX, V|E, "dct"},
{"fastint", "fast integer (experimental / for debugging)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_FASTINT }, INT_MIN, INT_MAX, V|E, "dct"},
{"int", "accurate integer", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_INT }, INT_MIN, INT_MAX, V|E, "dct"},
{"mmx", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_MMX }, INT_MIN, INT_MAX, V|E, "dct"},
{"altivec", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_ALTIVEC }, INT_MIN, INT_MAX, V|E, "dct"},
{"faan", "floating point AAN DCT (experimental / for debugging)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_FAAN }, INT_MIN, INT_MAX, V|E, "dct"},
{"idct", "select IDCT implementation", OFFSET(idct_algo), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, V|E|D, "idct"},
{"auto", "autoselect a good one (default)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_AUTO }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"int", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_INT }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"simple", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLE }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"simplemmx", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLEMMX }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"arm", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_ARM }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"altivec", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_ALTIVEC }, INT_MIN, INT_MAX, V|E|D, "idct"},
#if FF_API_ARCH_SH4
{"sh4", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SH4 }, INT_MIN, INT_MAX, V|E|D, "idct"},
#endif
{"simplearm", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLEARM }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"simplearmv5te", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLEARMV5TE }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"simplearmv6", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLEARMV6 }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"simpleneon", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLENEON }, INT_MIN, INT_MAX, V|E|D, "idct"},
#if FF_API_ARCH_ALPHA
{"simplealpha", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLEALPHA }, INT_MIN, INT_MAX, V|E|D, "idct"},
#endif
{"ipp", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_IPP }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"xvidmmx", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_XVIDMMX }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"faani", "floating point AAN IDCT (experimental / for debugging)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_FAAN }, INT_MIN, INT_MAX, V|D|E, "idct"},
{"simpleauto", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLEAUTO }, INT_MIN, INT_MAX, V|E|D, "idct"},
{NULL},
};
static const AVClass avdct_class = {
.class_name = "AVDCT",
.option = avdct_options,
.version = LIBAVUTIL_VERSION_INT,
};
const AVClass *avcodec_dct_get_class(void)
{
return &avdct_class;
}
AVDCT *avcodec_dct_alloc(void)
{
AVDCT *dsp = av_mallocz(sizeof(AVDCT));
if (!dsp)
return NULL;
dsp->av_class = &avdct_class;
av_opt_set_defaults(dsp);
return dsp;
}
int avcodec_dct_init(AVDCT *dsp)
{
AVCodecContext *avctx = avcodec_alloc_context3(NULL);
if (!avctx)
return AVERROR(ENOMEM);
avctx->idct_algo = dsp->idct_algo;
avctx->dct_algo = dsp->dct_algo;
#define COPY(src, name) memcpy(&dsp->name, &src.name, sizeof(dsp->name))
#if CONFIG_IDCTDSP
{
IDCTDSPContext idsp;
ff_idctdsp_init(&idsp, avctx);
COPY(idsp, idct);
COPY(idsp, idct_permutation);
}
#endif
#if CONFIG_FDCTDSP
{
FDCTDSPContext fdsp;
ff_fdctdsp_init(&fdsp, avctx);
COPY(fdsp, fdct);
}
#endif
avcodec_close(avctx);
av_free(avctx);
return 0;
}

78
libavcodec/avdct.h Normal file
View File

@ -0,0 +1,78 @@
/*
* 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
*/
#ifndef AVCODEC_AVDCT_H
#define AVCODEC_AVDCT_H
#include "libavutil/opt.h"
/**
* AVDCT context.
* @note function pointers can be NULL if the specific features have been
* disabled at build time.
*/
typedef struct AVDCT {
const AVClass *av_class;
void (*idct)(int16_t *block /* align 16 */);
/**
* IDCT input permutation.
* Several optimized IDCTs need a permutated input (relative to the
* normal order of the reference IDCT).
* This permutation must be performed before the idct_put/add.
* Note, normally this can be merged with the zigzag/alternate scan<br>
* An example to avoid confusion:
* - (->decode coeffs -> zigzag reorder -> dequant -> reference IDCT -> ...)
* - (x -> reference DCT -> reference IDCT -> x)
* - (x -> reference DCT -> simple_mmx_perm = idct_permutation
* -> simple_idct_mmx -> x)
* - (-> decode coeffs -> zigzag reorder -> simple_mmx_perm -> dequant
* -> simple_idct_mmx -> ...)
*/
uint8_t idct_permutation[64];
void (*fdct)(int16_t *block /* align 16 */);
/**
* DCT algorithm.
* must use AVOptions to set this field.
*/
int dct_algo;
/**
* IDCT algorithm.
* must use AVOptions to set this field.
*/
int idct_algo;
} AVDCT;
/**
* Allocates a AVDCT context.
* This needs to be initialized with avcodec_dct_init() after optionally
* configuring it with AVOptions.
*
* To free it use av_free()
*/
AVDCT *avcodec_dct_alloc(void);
int avcodec_dct_init(AVDCT *);
const AVClass *avcodec_dct_get_class(void);
#endif /* AVCODEC_AVDCT_H */

View File

@ -90,6 +90,7 @@ typedef struct G2MContext {
int compression;
int width, height, bpp;
int orig_width, orig_height;
int tile_width, tile_height;
int tiles_x, tiles_y, tile_x, tile_y;
@ -712,8 +713,8 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
}
c->width = bytestream2_get_be32(&bc);
c->height = bytestream2_get_be32(&bc);
if (c->width < 16 || c->width > avctx->width ||
c->height < 16 || c->height > avctx->height) {
if (c->width < 16 || c->width > c->orig_width ||
c->height < 16 || c->height > c->orig_height) {
av_log(avctx, AV_LOG_ERROR,
"Invalid frame dimensions %dx%d\n",
c->width, c->height);
@ -882,6 +883,10 @@ static av_cold int g2m_decode_init(AVCodecContext *avctx)
avctx->pix_fmt = AV_PIX_FMT_RGB24;
// store original sizes and check against those if resize happens
c->orig_width = avctx->width;
c->orig_height = avctx->height;
return 0;
}

View File

@ -342,7 +342,7 @@ QPEL_TABLE 10, 4, w, sse4
%macro LOOP_END 4
lea %1q, [%1q+2*%2q] ; dst += dststride
lea %3q, [%3q+ %4q] ; src += srcstride
add %3q, %4q ; src += srcstride
dec heightd ; cmp height
jnz .loop ; height loop
%endmacro

View File

@ -681,7 +681,7 @@ static int pulse_write_frame(AVFormatContext *h, int stream_index,
AVERROR(EINVAL) : 0;
pkt.data = (*frame)->data[0];
pkt.size = (*frame)->nb_samples * av_get_bytes_per_sample((*frame)->format) * (*frame)->channels;
pkt.size = (*frame)->nb_samples * av_get_bytes_per_sample((*frame)->format) * av_frame_get_channels(*frame);
pkt.dts = (*frame)->pkt_dts;
pkt.duration = av_frame_get_pkt_duration(*frame);
return pulse_write_packet(h, &pkt);

View File

@ -233,9 +233,9 @@ static void filter(SPPContext *p, uint8_t *dst, uint8_t *src,
const int y1 = y + offset[i + count - 1][1];
const int index = x1 + y1*linesize;
p->pdsp.get_pixels(block, p->src + index, linesize);
p->fdsp.fdct(block);
p->requantize(block2, block, qp, p->idsp.idct_permutation);
p->idsp.idct(block2);
p->dct->fdct(block);
p->requantize(block2, block, qp, p->dct->idct_permutation);
p->dct->idct(block2);
add_block(p->temp + index, linesize, block2);
}
}
@ -378,11 +378,11 @@ static av_cold int init(AVFilterContext *ctx)
SPPContext *spp = ctx->priv;
spp->avctx = avcodec_alloc_context3(NULL);
if (!spp->avctx)
spp->dct = avcodec_dct_alloc();
if (!spp->avctx || !spp->dct)
return AVERROR(ENOMEM);
ff_idctdsp_init(&spp->idsp, spp->avctx);
ff_fdctdsp_init(&spp->fdsp, spp->avctx);
ff_pixblockdsp_init(&spp->pdsp, spp->avctx);
avcodec_dct_init(spp->dct);
spp->store_slice = store_slice_c;
switch (spp->mode) {
case MODE_HARD: spp->requantize = hardthresh_c; break;
@ -403,6 +403,7 @@ static av_cold void uninit(AVFilterContext *ctx)
avcodec_close(spp->avctx);
av_freep(&spp->avctx);
}
av_freep(&spp->dct);
av_freep(&spp->non_b_qp_table);
}

View File

@ -24,8 +24,7 @@
#include "libavcodec/avcodec.h"
#include "libavcodec/pixblockdsp.h"
#include "libavcodec/idctdsp.h"
#include "libavcodec/fdctdsp.h"
#include "libavcodec/avdct.h"
#include "avfilter.h"
#define MAX_LEVEL 6 /* quality levels */
@ -41,9 +40,8 @@ typedef struct {
uint8_t *src;
int16_t *temp;
AVCodecContext *avctx;
IDCTDSPContext idsp;
FDCTDSPContext fdsp;
PixblockDSPContext pdsp;
AVDCT *dct;
int8_t *non_b_qp_table;
int non_b_qp_alloc_size;
int use_bframe_qp;

View File

@ -72,30 +72,33 @@ static inline uint16_t dv_audio_12to16(uint16_t sample)
return result;
}
/*
* This is the dumbest implementation of all -- it simply looks at
* a fixed offset and if pack isn't there -- fails. We might want
* to have a fallback mechanism for complete search of missing packs.
*/
static const uint8_t *dv_extract_pack(uint8_t *frame, enum dv_pack_type t)
{
int offs;
int c;
switch (t) {
case dv_audio_source:
offs = (80 * 6 + 80 * 16 * 3 + 3);
break;
case dv_audio_control:
offs = (80 * 6 + 80 * 16 * 4 + 3);
break;
case dv_video_control:
offs = (80 * 5 + 48 + 5);
break;
case dv_timecode:
offs = (80*1 + 3 + 3);
break;
default:
return NULL;
for (c = 0; c < 10; c++) {
switch (t) {
case dv_audio_source:
if (c&1) offs = (80 * 6 + 80 * 16 * 0 + 3 + c*12000);
else offs = (80 * 6 + 80 * 16 * 3 + 3 + c*12000);
break;
case dv_audio_control:
if (c&1) offs = (80 * 6 + 80 * 16 * 1 + 3 + c*12000);
else offs = (80 * 6 + 80 * 16 * 4 + 3 + c*12000);
break;
case dv_video_control:
if (c&1) offs = (80 * 3 + 8 + c*12000);
else offs = (80 * 5 + 48 + 5 + c*12000);
break;
case dv_timecode:
offs = (80*1 + 3 + 3);
break;
default:
return NULL;
}
if (frame[offs] == t)
break;
}
return frame[offs] == t ? &frame[offs] : NULL;

View File

@ -666,6 +666,7 @@ static const AVClass imgname ## _class = {\
};\
AVInputFormat ff_image_ ## imgname ## _pipe_demuxer = {\
.name = AV_STRINGIFY(imgname) "_pipe",\
.long_name = NULL_IF_CONFIG_SMALL("piped " AV_STRINGIFY(imgname) " sequence"),\
.priv_data_size = sizeof(VideoDemuxData),\
.read_probe = imgname ## _probe,\
.read_header = ff_img_read_header,\

View File

@ -19,6 +19,8 @@ test -n "$slot" || die "slot not specified"
test -n "$repo" || die "repo not specified"
test -d "$samples" || die "samples location not specified"
: ${branch:=master}
lock(){
lock=$1/fate.lock
(set -C; exec >$lock) 2>/dev/null || return
@ -28,14 +30,14 @@ lock(){
checkout(){
case "$repo" in
file:*|/*) src="${repo#file:}" ;;
git:*) git clone --quiet "$repo" "$src" ;;
git:*) git clone --quiet --branch "$branch" "$repo" "$src" ;;
esac
}
update()(
cd ${src} || return
case "$repo" in
git:*) git fetch --force && git reset --hard FETCH_HEAD ;;
git:*) git fetch --force && git reset --hard "origin/$branch" ;;
esac
)
@ -82,7 +84,9 @@ clean(){
report(){
date=$(date -u +%Y%m%d%H%M%S)
echo "fate:0:${date}:${slot}:${version}:$1:$2:${comment}" >report
cat ${build}/config.fate ${build}/tests/data/fate/*.rep >>report
# echo "fate:1:${date}:${slot}:${version}:$1:$2:${branch}:${comment}" >report
cat ${build}/config.fate >>report
cat ${build}/tests/data/fate/*.rep >>report || for i in ${build}/tests/data/fate/*.rep ; do cat "$i" >>report ; done
test -n "$fate_recv" && $tar report *.log | gzip | $fate_recv
}

View File

@ -4,7 +4,11 @@
# check for git short hash
if ! test "$revision"; then
revision=$(cd "$1" && git describe --tags --match N 2> /dev/null)
if (cd "$1" && grep git RELEASE 2> /dev/null >/dev/null) ; then
revision=$(cd "$1" && git describe --tags --match N 2> /dev/null)
else
revision=$(cd "$1" && git describe --tags --always 2> /dev/null)
fi
fi
# Shallow Git clones (--depth) do not have the N tag: