1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Merge commit '1470ce21cec5ee26e106e2a884c26bbf84e5aaea'

* commit '1470ce21cec5ee26e106e2a884c26bbf84e5aaea':
  Bump libavcodec and libavformat minor versions for G.723.1 decoder and demuxer
  G.723.1 demuxer and decoder
  Add a shift parameter to celp_lp_synthesis_filter()
  libopenjpeg: K&R formatting cosmetics
  yadif: use emms_c() instead of inline assembly for emms invocations.
  ac3: don't use different names for option tables in the template file.
  lavfi: use const for AVFilterPad declarations in all filters.
  adpcm: don't duplicate identical AVSampleFmt array for each encoder.
  configure: cosmetics: Group test dependencies together
  configure: add more passthrough flags in tms470 filter
  configure: move flag filtering functions out of if/else blocks

Conflicts:
	Changelog
	configure
	doc/general.texi
	libavcodec/Makefile
	libavcodec/ac3enc_fixed.c
	libavcodec/allcodecs.c
	libavcodec/eac3enc.c
	libavcodec/g723_1.c
	libavcodec/g723_1_data.h
	libavcodec/libopenjpegdec.c
	libavcodec/libopenjpegenc.c
	libavcodec/v210dec.h
	libavcodec/version.h
	libavfilter/af_anull.c
	libavfilter/asrc_anullsrc.c
	libavfilter/f_settb.c
	libavfilter/fifo.c
	libavfilter/split.c
	libavfilter/src_movie.c
	libavfilter/vf_aspect.c
	libavfilter/vf_blackframe.c
	libavfilter/vf_boxblur.c
	libavfilter/vf_copy.c
	libavfilter/vf_crop.c
	libavfilter/vf_cropdetect.c
	libavfilter/vf_delogo.c
	libavfilter/vf_drawbox.c
	libavfilter/vf_drawtext.c
	libavfilter/vf_fade.c
	libavfilter/vf_fieldorder.c
	libavfilter/vf_format.c
	libavfilter/vf_frei0r.c
	libavfilter/vf_gradfun.c
	libavfilter/vf_hflip.c
	libavfilter/vf_hqdn3d.c
	libavfilter/vf_libopencv.c
	libavfilter/vf_lut.c
	libavfilter/vf_null.c
	libavfilter/vf_overlay.c
	libavfilter/vf_pad.c
	libavfilter/vf_pixdesctest.c
	libavfilter/vf_scale.c
	libavfilter/vf_select.c
	libavfilter/vf_setpts.c
	libavfilter/vf_showinfo.c
	libavfilter/vf_slicify.c
	libavfilter/vf_transpose.c
	libavfilter/vf_unsharp.c
	libavfilter/vf_vflip.c
	libavfilter/vf_yadif.c
	libavfilter/vsrc_color.c
	libavfilter/vsrc_testsrc.c
	libavformat/Makefile
	libavformat/allformats.c
	libavformat/g723_1.c
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-07-22 22:10:41 +02:00
commit 9023de342f
55 changed files with 724 additions and 702 deletions

168
configure vendored
View File

@ -1810,6 +1810,20 @@ ffserver_extralibs='$ldl'
doc_deps_any="texi2html makeinfo pod2man" doc_deps_any="texi2html makeinfo pod2man"
# tests # tests
colormatrix1_test_deps="colormatrix_filter"
colormatrix2_test_deps="colormatrix_filter"
flashsv2_test_deps="zlib"
mpg_test_deps="mpeg1system_muxer mpegps_demuxer"
mpng_test_deps="zlib"
pp_test_deps="mp_filter"
pp2_test_deps="mp_filter"
pp3_test_deps="mp_filter"
pp4_test_deps="mp_filter"
pp5_test_deps="mp_filter"
pp6_test_deps="mp_filter"
seek_lavf_mxf_d10_test_deps="mxf_d10_test"
zlib_test_deps="zlib"
zmbv_test_deps="zlib"
test_deps(){ test_deps(){
suf1=$1 suf1=$1
@ -1824,8 +1838,6 @@ test_deps(){
done done
} }
seek_lavf_mxf_d10_test_deps="mxf_d10_test"
test_deps _muxer _demuxer \ test_deps _muxer _demuxer \
aiff \ aiff \
pcm_alaw=alaw \ pcm_alaw=alaw \
@ -1851,20 +1863,6 @@ test_deps _muxer _demuxer \
wav \ wav \
yuv4mpegpipe=yuv4mpeg \ yuv4mpegpipe=yuv4mpeg \
colormatrix1_test_deps="colormatrix_filter"
colormatrix2_test_deps="colormatrix_filter"
flashsv2_test_deps="zlib"
mpg_test_deps="mpeg1system_muxer mpegps_demuxer"
mpng_test_deps="zlib"
pp_test_deps="mp_filter"
pp2_test_deps="mp_filter"
pp3_test_deps="mp_filter"
pp4_test_deps="mp_filter"
pp5_test_deps="mp_filter"
pp6_test_deps="mp_filter"
zlib_test_deps="zlib"
zmbv_test_deps="zlib"
# default parameters # default parameters
logfile="config.log" logfile="config.log"
@ -2238,6 +2236,78 @@ EOF
die "Sanity test failed." die "Sanity test failed."
fi fi
pgi_flags(){
for flag; do
case $flag in
-fomit-frame-pointer) echo -Mnoframe ;;
-g) echo -gopt ;;
*) echo $flag ;;
esac
done
}
suncc_flags(){
for flag; do
case $flag in
-march=*|-mcpu=*)
case "${flag#*=}" in
native) echo -xtarget=native ;;
v9|niagara) echo -xarch=sparc ;;
ultrasparc) echo -xarch=sparcvis ;;
ultrasparc3|niagara2) echo -xarch=sparcvis2 ;;
i586|pentium) echo -xchip=pentium ;;
i686|pentiumpro|pentium2) echo -xtarget=pentium_pro ;;
pentium3*|c3-2) echo -xtarget=pentium3 ;;
pentium-m) echo -xarch=sse2 -xchip=pentium3 ;;
pentium4*) echo -xtarget=pentium4 ;;
prescott|nocona) echo -xarch=sse3 -xchip=pentium4 ;;
*-sse3) echo -xarch=sse3 ;;
core2) echo -xarch=ssse3 -xchip=core2 ;;
amdfam10|barcelona) echo -xarch=sse4_1 ;;
athlon-4|athlon-[mx]p) echo -xarch=ssea ;;
k8|opteron|athlon64|athlon-fx)
echo -xarch=sse2a ;;
athlon*) echo -xarch=pentium_proa ;;
esac
;;
-std=c99) echo -xc99 ;;
-fomit-frame-pointer) echo -xregs=frameptr ;;
-fPIC) echo -KPIC -xcode=pic32 ;;
-W*,*) echo $flag ;;
-f*-*|-W*) ;;
*) echo $flag ;;
esac
done
}
tms470_flags(){
for flag; do
case $flag in
-march=*|-mcpu=*)
case "${flag#*=}" in
armv7-a|cortex-a*) echo -mv=7a8 ;;
armv7-r|cortex-r*) echo -mv=7r4 ;;
armv7-m|cortex-m*) echo -mv=7m3 ;;
armv6*|arm11*) echo -mv=6 ;;
armv5*e|arm[79]*e*|arm9[24]6*|arm96*|arm102[26])
echo -mv=5e ;;
armv4*|arm7*|arm9[24]*) echo -mv=4 ;;
esac
;;
-mfpu=neon) echo --float_support=vfpv3 --neon ;;
-mfpu=vfp) echo --float_support=vfpv2 ;;
-mfpu=vfpv3) echo --float_support=vfpv3 ;;
-msoft-float) echo --float_support=vfplib ;;
-O[0-3]|-mf=*) echo $flag ;;
-g) echo -g -mn ;;
-pds=*) echo $flag ;;
-D*|-I*) echo $flag ;;
--gcc|--abi=*) echo $flag ;;
-me) echo $flag ;;
esac
done
}
if $cc -v 2>&1 | grep -q '^gcc.*LLVM'; then if $cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
cc_type=llvm_gcc cc_type=llvm_gcc
gcc_extra_ver=$(expr "$($cc --version | head -n1)" : '.*\((.*)\)') gcc_extra_ver=$(expr "$($cc --version | head -n1)" : '.*\((.*)\)')
@ -2313,30 +2383,6 @@ elif $cc -version 2>/dev/null | grep -q TMS470; then
cflags_speed='-O3 -mf=5' cflags_speed='-O3 -mf=5'
cflags_size='-O3 -mf=2' cflags_size='-O3 -mf=2'
cflags_filter=tms470_flags cflags_filter=tms470_flags
tms470_flags(){
for flag; do
case $flag in
-march=*|-mcpu=*)
case "${flag#*=}" in
armv7-a|cortex-a*) echo -mv=7a8 ;;
armv7-r|cortex-r*) echo -mv=7r4 ;;
armv7-m|cortex-m*) echo -mv=7m3 ;;
armv6*|arm11*) echo -mv=6 ;;
armv5*e|arm[79]*e*|arm9[24]6*|arm96*|arm102[26])
echo -mv=5e ;;
armv4*|arm7*|arm9[24]*) echo -mv=4 ;;
esac
;;
-mfpu=neon) echo --float_support=vfpv3 --neon ;;
-mfpu=vfp) echo --float_support=vfpv2 ;;
-mfpu=vfpv3) echo --float_support=vfpv3 ;;
-msoft-float) echo --float_support=vfplib ;;
-O[0-3]|-mf=*) echo $flag ;;
-g) echo -g -mn ;;
-pds=*) echo $flag ;;
esac
done
}
elif $cc -v 2>&1 | grep -q clang; then elif $cc -v 2>&1 | grep -q clang; then
cc_type=clang cc_type=clang
cc_ident=$($cc --version | head -n1) cc_ident=$($cc --version | head -n1)
@ -2353,39 +2399,6 @@ elif $cc -V 2>&1 | grep -q Sun; then
cflags_speed='-O5' cflags_speed='-O5'
cflags_size='-O5 -xspace' cflags_size='-O5 -xspace'
cflags_filter=suncc_flags cflags_filter=suncc_flags
suncc_flags(){
for flag; do
case $flag in
-march=*|-mcpu=*)
case "${flag#*=}" in
native) echo -xtarget=native ;;
v9|niagara) echo -xarch=sparc ;;
ultrasparc) echo -xarch=sparcvis ;;
ultrasparc3|niagara2) echo -xarch=sparcvis2 ;;
i586|pentium) echo -xchip=pentium ;;
i686|pentiumpro|pentium2) echo -xtarget=pentium_pro ;;
pentium3*|c3-2) echo -xtarget=pentium3 ;;
pentium-m) echo -xarch=sse2 -xchip=pentium3 ;;
pentium4*) echo -xtarget=pentium4 ;;
prescott|nocona) echo -xarch=sse3 -xchip=pentium4 ;;
*-sse3) echo -xarch=sse3 ;;
core2) echo -xarch=ssse3 -xchip=core2 ;;
amdfam10|barcelona) echo -xarch=sse4_1 ;;
athlon-4|athlon-[mx]p) echo -xarch=ssea ;;
k8|opteron|athlon64|athlon-fx)
echo -xarch=sse2a ;;
athlon*) echo -xarch=pentium_proa ;;
esac
;;
-std=c99) echo -xc99 ;;
-fomit-frame-pointer) echo -xregs=frameptr ;;
-fPIC) echo -KPIC -xcode=pic32 ;;
-W*,*) echo $flag ;;
-f*-*|-W*) ;;
*) echo $flag ;;
esac
done
}
elif $cc -v 2>&1 | grep -q 'PathScale\|Path64'; then elif $cc -v 2>&1 | grep -q 'PathScale\|Path64'; then
cc_type=pathscale cc_type=pathscale
cc_ident=$($cc -v 2>&1 | head -n1 | tr -d :) cc_ident=$($cc -v 2>&1 | head -n1 | tr -d :)
@ -2410,15 +2423,6 @@ elif $cc -V 2>&1 | grep -q Portland; then
cflags_size="-O2 -Munroll=c:1 $opt_common" cflags_size="-O2 -Munroll=c:1 $opt_common"
cflags_noopt="-O1" cflags_noopt="-O1"
cflags_filter=pgi_flags cflags_filter=pgi_flags
pgi_flags(){
for flag; do
case $flag in
-fomit-frame-pointer) echo -Mnoframe ;;
-g) echo -gopt ;;
*) echo $flag ;;
esac
done
}
fi fi
test -n "$cc_type" && enable $cc_type || test -n "$cc_type" && enable $cc_type ||

View File

@ -38,7 +38,7 @@
static const AVClass ac3enc_class = { static const AVClass ac3enc_class = {
.class_name = "Fixed-Point AC-3 Encoder", .class_name = "Fixed-Point AC-3 Encoder",
.item_name = av_default_item_name, .item_name = av_default_item_name,
.option = ac3fixed_options, .option = ac3_options,
.version = LIBAVUTIL_VERSION_INT, .version = LIBAVUTIL_VERSION_INT,
}; };

View File

@ -23,13 +23,7 @@
#include "internal.h" #include "internal.h"
#include "ac3.h" #include "ac3.h"
#if AC3ENC_TYPE == AC3ENC_TYPE_AC3_FIXED
static const AVOption ac3fixed_options[] = {
#elif AC3ENC_TYPE == AC3ENC_TYPE_AC3
static const AVOption ac3_options[] = { static const AVOption ac3_options[] = {
#else /* AC3ENC_TYPE_EAC3 */
static const AVOption eac3_options[] = {
#endif
/* Metadata Options */ /* Metadata Options */
{"per_frame_metadata", "Allow Changing Metadata Per-Frame", OFFSET(allow_per_frame_metadata), AV_OPT_TYPE_INT, {.dbl = 0 }, 0, 1, AC3ENC_PARAM}, {"per_frame_metadata", "Allow Changing Metadata Per-Frame", OFFSET(allow_per_frame_metadata), AV_OPT_TYPE_INT, {.dbl = 0 }, 0, 1, AC3ENC_PARAM},
#if AC3ENC_TYPE != AC3ENC_TYPE_EAC3 #if AC3ENC_TYPE != AC3ENC_TYPE_EAC3

View File

@ -717,6 +717,9 @@ error:
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
} }
static const enum AVSampleFormat sample_fmts[] = {
AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE
};
#define ADPCM_ENCODER(id_, name_, long_name_) \ #define ADPCM_ENCODER(id_, name_, long_name_) \
AVCodec ff_ ## name_ ## _encoder = { \ AVCodec ff_ ## name_ ## _encoder = { \
@ -727,8 +730,7 @@ AVCodec ff_ ## name_ ## _encoder = { \
.init = adpcm_encode_init, \ .init = adpcm_encode_init, \
.encode2 = adpcm_encode_frame, \ .encode2 = adpcm_encode_frame, \
.close = adpcm_encode_close, \ .close = adpcm_encode_close, \
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, \ .sample_fmts = sample_fmts, \
AV_SAMPLE_FMT_NONE }, \
.long_name = NULL_IF_CONFIG_SMALL(long_name_), \ .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
} }

View File

@ -36,7 +36,7 @@
static const AVClass eac3enc_class = { static const AVClass eac3enc_class = {
.class_name = "E-AC-3 Encoder", .class_name = "E-AC-3 Encoder",
.item_name = av_default_item_name, .item_name = av_default_item_name,
.option = eac3_options, .option = ac3_options,
.version = LIBAVUTIL_VERSION_INT, .version = LIBAVUTIL_VERSION_INT,
}; };

View File

@ -25,23 +25,27 @@
* G.723.1 compatible decoder * G.723.1 compatible decoder
*/ */
#include "avcodec.h"
#define BITSTREAM_READER_LE #define BITSTREAM_READER_LE
#include "libavutil/audioconvert.h"
#include "libavutil/lzo.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "internal.h" #include "internal.h"
#include "get_bits.h" #include "get_bits.h"
#include "acelp_vectors.h" #include "acelp_vectors.h"
#include "celp_filters.h" #include "celp_filters.h"
#include "celp_math.h" #include "celp_math.h"
#include "lsp.h" #include "lsp.h"
#include "libavutil/lzo.h"
#include "g723_1_data.h" #include "g723_1_data.h"
typedef struct g723_1_context { typedef struct g723_1_context {
AVClass *class;
AVFrame frame; AVFrame frame;
G723_1_Subframe subframe[4]; G723_1_Subframe subframe[4];
FrameType cur_frame_type; enum FrameType cur_frame_type;
FrameType past_frame_type; enum FrameType past_frame_type;
Rate cur_rate; enum Rate cur_rate;
uint8_t lsp_index[LSP_BANDS]; uint8_t lsp_index[LSP_BANDS];
int pitch_lag[2]; int pitch_lag[2];
int erased_frames; int erased_frames;
@ -62,6 +66,7 @@ typedef struct g723_1_context {
int pf_gain; ///< formant postfilter int pf_gain; ///< formant postfilter
///< gain scaling unit memory ///< gain scaling unit memory
int postfilter;
int16_t prev_data[HALF_FRAME_LEN]; int16_t prev_data[HALF_FRAME_LEN];
int16_t prev_weight_sig[PITCH_MAX]; int16_t prev_weight_sig[PITCH_MAX];
@ -80,11 +85,12 @@ static av_cold int g723_1_decode_init(AVCodecContext *avctx)
avctx->sample_fmt = AV_SAMPLE_FMT_S16; avctx->sample_fmt = AV_SAMPLE_FMT_S16;
p->pf_gain = 1 << 12; p->pf_gain = 1 << 12;
memcpy(p->prev_lsp, dc_lsp, LPC_ORDER * sizeof(int16_t));
avcodec_get_frame_defaults(&p->frame); avcodec_get_frame_defaults(&p->frame);
avctx->coded_frame = &p->frame; avctx->coded_frame = &p->frame;
memcpy(p->prev_lsp, dc_lsp, LPC_ORDER * sizeof(*p->prev_lsp));
return 0; return 0;
} }
@ -108,7 +114,7 @@ static int unpack_bitstream(G723_1_Context *p, const uint8_t *buf,
info_bits = get_bits(&gb, 2); info_bits = get_bits(&gb, 2);
if (info_bits == 3) { if (info_bits == 3) {
p->cur_frame_type = UntransmittedFrame; p->cur_frame_type = UNTRANSMITTED_FRAME;
return 0; return 0;
} }
@ -118,14 +124,14 @@ static int unpack_bitstream(G723_1_Context *p, const uint8_t *buf,
p->lsp_index[0] = get_bits(&gb, 8); p->lsp_index[0] = get_bits(&gb, 8);
if (info_bits == 2) { if (info_bits == 2) {
p->cur_frame_type = SIDFrame; p->cur_frame_type = SID_FRAME;
p->subframe[0].amp_index = get_bits(&gb, 6); p->subframe[0].amp_index = get_bits(&gb, 6);
return 0; return 0;
} }
/* Extract the info common to both rates */ /* Extract the info common to both rates */
p->cur_rate = info_bits ? Rate5k3 : Rate6k3; p->cur_rate = info_bits ? RATE_5300 : RATE_6300;
p->cur_frame_type = ActiveFrame; p->cur_frame_type = ACTIVE_FRAME;
p->pitch_lag[0] = get_bits(&gb, 7); p->pitch_lag[0] = get_bits(&gb, 7);
if (p->pitch_lag[0] > 123) /* test if forbidden code */ if (p->pitch_lag[0] > 123) /* test if forbidden code */
@ -146,9 +152,9 @@ static int unpack_bitstream(G723_1_Context *p, const uint8_t *buf,
temp = get_bits(&gb, 12); temp = get_bits(&gb, 12);
ad_cb_len = 170; ad_cb_len = 170;
p->subframe[i].dirac_train = 0; p->subframe[i].dirac_train = 0;
if (p->cur_rate == Rate6k3 && p->pitch_lag[i >> 1] < SUBFRAME_LEN - 2) { if (p->cur_rate == RATE_6300 && p->pitch_lag[i >> 1] < SUBFRAME_LEN - 2) {
p->subframe[i].dirac_train = temp >> 11; p->subframe[i].dirac_train = temp >> 11;
temp &= 0x7ff; temp &= 0x7FF;
ad_cb_len = 85; ad_cb_len = 85;
} }
p->subframe[i].ad_cb_gain = FASTDIV(temp, GAIN_LEVELS); p->subframe[i].ad_cb_gain = FASTDIV(temp, GAIN_LEVELS);
@ -165,7 +171,7 @@ static int unpack_bitstream(G723_1_Context *p, const uint8_t *buf,
p->subframe[2].grid_index = get_bits1(&gb); p->subframe[2].grid_index = get_bits1(&gb);
p->subframe[3].grid_index = get_bits1(&gb); p->subframe[3].grid_index = get_bits1(&gb);
if (p->cur_rate == Rate6k3) { if (p->cur_rate == RATE_6300) {
skip_bits1(&gb); /* skip reserved bit */ skip_bits1(&gb); /* skip reserved bit */
/* Compute pulse_pos index using the 13-bit combined position index */ /* Compute pulse_pos index using the 13-bit combined position index */
@ -192,7 +198,7 @@ static int unpack_bitstream(G723_1_Context *p, const uint8_t *buf,
p->subframe[1].pulse_sign = get_bits(&gb, 5); p->subframe[1].pulse_sign = get_bits(&gb, 5);
p->subframe[2].pulse_sign = get_bits(&gb, 6); p->subframe[2].pulse_sign = get_bits(&gb, 6);
p->subframe[3].pulse_sign = get_bits(&gb, 5); p->subframe[3].pulse_sign = get_bits(&gb, 5);
} else { /* Rate5k3 */ } else { /* 5300 bps */
p->subframe[0].pulse_pos = get_bits(&gb, 12); p->subframe[0].pulse_pos = get_bits(&gb, 12);
p->subframe[1].pulse_pos = get_bits(&gb, 12); p->subframe[1].pulse_pos = get_bits(&gb, 12);
p->subframe[2].pulse_pos = get_bits(&gb, 12); p->subframe[2].pulse_pos = get_bits(&gb, 12);
@ -333,7 +339,7 @@ static void inverse_quant(int16_t *cur_lsp, int16_t *prev_lsp,
break; break;
} }
if (!stable) if (!stable)
memcpy(cur_lsp, prev_lsp, LPC_ORDER * sizeof(int16_t)); memcpy(cur_lsp, prev_lsp, LPC_ORDER * sizeof(*cur_lsp));
} }
/** /**
@ -432,7 +438,7 @@ static void lsp_interpolate(int16_t *lpc, int16_t *cur_lsp, int16_t *prev_lsp)
8192, 8192, 1 << 13, 14, LPC_ORDER); 8192, 8192, 1 << 13, 14, LPC_ORDER);
ff_acelp_weighted_vector_sum(lpc + 2 * LPC_ORDER, cur_lsp, prev_lsp, ff_acelp_weighted_vector_sum(lpc + 2 * LPC_ORDER, cur_lsp, prev_lsp,
12288, 4096, 1 << 13, 14, LPC_ORDER); 12288, 4096, 1 << 13, 14, LPC_ORDER);
memcpy(lpc + 3 * LPC_ORDER, cur_lsp, LPC_ORDER * sizeof(int16_t)); memcpy(lpc + 3 * LPC_ORDER, cur_lsp, LPC_ORDER * sizeof(*lpc));
for (i = 0; i < SUBFRAMES; i++) { for (i = 0; i < SUBFRAMES; i++) {
lsp2lpc(lpc_ptr); lsp2lpc(lpc_ptr);
@ -448,7 +454,7 @@ static void gen_dirac_train(int16_t *buf, int pitch_lag)
int16_t vector[SUBFRAME_LEN]; int16_t vector[SUBFRAME_LEN];
int i, j; int i, j;
memcpy(vector, buf, SUBFRAME_LEN * sizeof(int16_t)); memcpy(vector, buf, SUBFRAME_LEN * sizeof(*vector));
for (i = pitch_lag; i < SUBFRAME_LEN; i += pitch_lag) { for (i = pitch_lag; i < SUBFRAME_LEN; i += pitch_lag) {
for (j = 0; j < SUBFRAME_LEN - i; j++) for (j = 0; j < SUBFRAME_LEN - i; j++)
buf[i + j] += vector[j]; buf[i + j] += vector[j];
@ -465,13 +471,13 @@ static void gen_dirac_train(int16_t *buf, int pitch_lag)
* @param index current subframe index * @param index current subframe index
*/ */
static void gen_fcb_excitation(int16_t *vector, G723_1_Subframe subfrm, static void gen_fcb_excitation(int16_t *vector, G723_1_Subframe subfrm,
Rate cur_rate, int pitch_lag, int index) enum Rate cur_rate, int pitch_lag, int index)
{ {
int temp, i, j; int temp, i, j;
memset(vector, 0, SUBFRAME_LEN * sizeof(int16_t)); memset(vector, 0, SUBFRAME_LEN * sizeof(*vector));
if (cur_rate == Rate6k3) { if (cur_rate == RATE_6300) {
if (subfrm.pulse_pos >= max_pos[index]) if (subfrm.pulse_pos >= max_pos[index])
return; return;
@ -495,7 +501,7 @@ static void gen_fcb_excitation(int16_t *vector, G723_1_Subframe subfrm,
} }
if (subfrm.dirac_train == 1) if (subfrm.dirac_train == 1)
gen_dirac_train(vector, pitch_lag); gen_dirac_train(vector, pitch_lag);
} else { /* Rate5k3 */ } else { /* 5300 bps */
int cb_gain = fixed_cb_gain[subfrm.amp_index]; int cb_gain = fixed_cb_gain[subfrm.amp_index];
int cb_shift = subfrm.grid_index; int cb_shift = subfrm.grid_index;
int cb_sign = subfrm.pulse_sign; int cb_sign = subfrm.pulse_sign;
@ -554,7 +560,7 @@ static void gen_acb_excitation(int16_t *vector, int16_t *prev_excitation,
get_residual(residual, prev_excitation, lag); get_residual(residual, prev_excitation, lag);
/* Select quantization table */ /* Select quantization table */
if (cur_rate == Rate6k3 && pitch_lag < SUBFRAME_LEN - 2) { if (cur_rate == RATE_6300 && pitch_lag < SUBFRAME_LEN - 2) {
cb_ptr = adaptive_cb_gain85; cb_ptr = adaptive_cb_gain85;
} else } else
cb_ptr = adaptive_cb_gain170; cb_ptr = adaptive_cb_gain170;
@ -608,7 +614,7 @@ static int autocorr_max(G723_1_Context *p, int offset, int *ccr_max,
* @param ccr cross-correlation * @param ccr cross-correlation
* @param res_eng residual energy * @param res_eng residual energy
*/ */
static void comp_ppf_gains(int lag, PPFParam *ppf, Rate cur_rate, static void comp_ppf_gains(int lag, PPFParam *ppf, enum Rate cur_rate,
int tgt_eng, int ccr, int res_eng) int tgt_eng, int ccr, int res_eng)
{ {
int pf_residual; /* square of postfiltered residual */ int pf_residual; /* square of postfiltered residual */
@ -657,7 +663,7 @@ static void comp_ppf_gains(int lag, PPFParam *ppf, Rate cur_rate,
* @param cur_rate current bitrate * @param cur_rate current bitrate
*/ */
static void comp_ppf_coeff(G723_1_Context *p, int offset, int pitch_lag, static void comp_ppf_coeff(G723_1_Context *p, int offset, int pitch_lag,
PPFParam *ppf, Rate cur_rate) PPFParam *ppf, enum Rate cur_rate)
{ {
int16_t scale; int16_t scale;
@ -795,15 +801,15 @@ static void residual_interp(int16_t *buf, int16_t *out, int lag,
/* Attenuate */ /* Attenuate */
for (i = 0; i < lag; i++) for (i = 0; i < lag; i++)
vector_ptr[i - lag] = vector_ptr[i - lag] * 3 >> 2; vector_ptr[i - lag] = vector_ptr[i - lag] * 3 >> 2;
av_memcpy_backptr((uint8_t*)vector_ptr, lag * sizeof(int16_t), av_memcpy_backptr((uint8_t*)vector_ptr, lag * sizeof(*vector_ptr),
FRAME_LEN * sizeof(int16_t)); FRAME_LEN * sizeof(*vector_ptr));
memcpy(out, vector_ptr, FRAME_LEN * sizeof(int16_t)); memcpy(out, vector_ptr, FRAME_LEN * sizeof(*vector_ptr));
} else { /* Unvoiced */ } else { /* Unvoiced */
for (i = 0; i < FRAME_LEN; i++) { for (i = 0; i < FRAME_LEN; i++) {
*rseed = *rseed * 521 + 259; *rseed = *rseed * 521 + 259;
out[i] = gain * *rseed >> 15; out[i] = gain * *rseed >> 15;
} }
memset(buf, 0, (FRAME_LEN + PITCH_MAX) * sizeof(int16_t)); memset(buf, 0, (FRAME_LEN + PITCH_MAX) * sizeof(*buf));
} }
} }
@ -889,8 +895,8 @@ static void formant_postfilter(G723_1_Context *p, int16_t *lpc, int16_t *buf)
int filter_signal[LPC_ORDER + FRAME_LEN], *signal_ptr; int filter_signal[LPC_ORDER + FRAME_LEN], *signal_ptr;
int i, j, k; int i, j, k;
memcpy(buf, p->fir_mem, LPC_ORDER * sizeof(int16_t)); memcpy(buf, p->fir_mem, LPC_ORDER * sizeof(*buf));
memcpy(filter_signal, p->iir_mem, LPC_ORDER * sizeof(int)); memcpy(filter_signal, p->iir_mem, LPC_ORDER * sizeof(*filter_signal));
for (i = LPC_ORDER, j = 0; j < SUBFRAMES; i += SUBFRAME_LEN, j++) { for (i = LPC_ORDER, j = 0; j < SUBFRAMES; i += SUBFRAME_LEN, j++) {
for (k = 0; k < LPC_ORDER; k++) { for (k = 0; k < LPC_ORDER; k++) {
@ -977,8 +983,8 @@ static int g723_1_decode_frame(AVCodecContext *avctx, void *data,
if (unpack_bitstream(p, buf, buf_size) < 0) { if (unpack_bitstream(p, buf, buf_size) < 0) {
bad_frame = 1; bad_frame = 1;
p->cur_frame_type = p->past_frame_type == ActiveFrame ? p->cur_frame_type = p->past_frame_type == ACTIVE_FRAME ?
ActiveFrame : UntransmittedFrame; ACTIVE_FRAME : UNTRANSMITTED_FRAME;
} }
p->frame.nb_samples = FRAME_LEN + LPC_ORDER; p->frame.nb_samples = FRAME_LEN + LPC_ORDER;
@ -989,20 +995,21 @@ static int g723_1_decode_frame(AVCodecContext *avctx, void *data,
out= (int16_t*)p->frame.data[0]; out= (int16_t*)p->frame.data[0];
if(p->cur_frame_type == ActiveFrame) { if(p->cur_frame_type == ACTIVE_FRAME) {
if (!bad_frame) { if (!bad_frame)
p->erased_frames = 0; p->erased_frames = 0;
} else if(p->erased_frames != 3) else if(p->erased_frames != 3)
p->erased_frames++; p->erased_frames++;
inverse_quant(cur_lsp, p->prev_lsp, p->lsp_index, bad_frame); inverse_quant(cur_lsp, p->prev_lsp, p->lsp_index, bad_frame);
lsp_interpolate(lpc, cur_lsp, p->prev_lsp); lsp_interpolate(lpc, cur_lsp, p->prev_lsp);
/* Save the lsp_vector for the next frame */ /* Save the lsp_vector for the next frame */
memcpy(p->prev_lsp, cur_lsp, LPC_ORDER * sizeof(int16_t)); memcpy(p->prev_lsp, cur_lsp, LPC_ORDER * sizeof(*p->prev_lsp));
/* Generate the excitation for the frame */ /* Generate the excitation for the frame */
memcpy(p->excitation, p->prev_excitation, PITCH_MAX * sizeof(int16_t)); memcpy(p->excitation, p->prev_excitation,
PITCH_MAX * sizeof(*p->excitation));
vector_ptr = p->excitation + PITCH_MAX; vector_ptr = p->excitation + PITCH_MAX;
if (!p->erased_frames) { if (!p->erased_frames) {
/* Update interpolation gain memory */ /* Update interpolation gain memory */
@ -1118,7 +1125,7 @@ static av_cold int g723_1_encode_init(AVCodecContext *avctx)
} }
if (avctx->bit_rate == 6300) { if (avctx->bit_rate == 6300) {
p->cur_rate = Rate6k3; p->cur_rate = RATE_6300;
} else if (avctx->bit_rate == 5300) { } else if (avctx->bit_rate == 5300) {
av_log(avctx, AV_LOG_ERROR, "Bitrate not supported yet, use 6.3k\n"); av_log(avctx, AV_LOG_ERROR, "Bitrate not supported yet, use 6.3k\n");
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
@ -2041,7 +2048,7 @@ static int pack_bitstream(G723_1_Context *p, unsigned char *frame, int size)
init_put_bits(&pb, frame, size); init_put_bits(&pb, frame, size);
if (p->cur_rate == Rate6k3) { if (p->cur_rate == RATE_6300) {
info_bits = 0; info_bits = 0;
put_bits(&pb, 2, info_bits); put_bits(&pb, 2, info_bits);
} }
@ -2059,7 +2066,7 @@ static int pack_bitstream(G723_1_Context *p, unsigned char *frame, int size)
for (i = 0; i < SUBFRAMES; i++) { for (i = 0; i < SUBFRAMES; i++) {
temp = p->subframe[i].ad_cb_gain * GAIN_LEVELS + temp = p->subframe[i].ad_cb_gain * GAIN_LEVELS +
p->subframe[i].amp_index; p->subframe[i].amp_index;
if (p->cur_rate == Rate6k3) if (p->cur_rate == RATE_6300)
temp += p->subframe[i].dirac_train << 11; temp += p->subframe[i].dirac_train << 11;
put_bits(&pb, 12, temp); put_bits(&pb, 12, temp);
} }
@ -2069,7 +2076,7 @@ static int pack_bitstream(G723_1_Context *p, unsigned char *frame, int size)
put_bits(&pb, 1, p->subframe[2].grid_index); put_bits(&pb, 1, p->subframe[2].grid_index);
put_bits(&pb, 1, p->subframe[3].grid_index); put_bits(&pb, 1, p->subframe[3].grid_index);
if (p->cur_rate == Rate6k3) { if (p->cur_rate == RATE_6300) {
skip_put_bits(&pb, 1); /* reserved bit */ skip_put_bits(&pb, 1); /* reserved bit */
/* Write 13 bit combined position index */ /* Write 13 bit combined position index */
@ -2192,7 +2199,7 @@ static int g723_1_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
/* Reconstruct the excitation */ /* Reconstruct the excitation */
gen_acb_excitation(impulse_resp, p->prev_excitation, p->pitch_lag[i >> 1], gen_acb_excitation(impulse_resp, p->prev_excitation, p->pitch_lag[i >> 1],
p->subframe[i], Rate6k3); p->subframe[i], RATE_6300);
memmove(p->prev_excitation, p->prev_excitation + SUBFRAME_LEN, memmove(p->prev_excitation, p->prev_excitation + SUBFRAME_LEN,
sizeof(int16_t) * (PITCH_MAX - SUBFRAME_LEN)); sizeof(int16_t) * (PITCH_MAX - SUBFRAME_LEN));

View File

@ -25,8 +25,8 @@
* G723.1 compatible decoder data tables * G723.1 compatible decoder data tables
*/ */
#ifndef AVCODEC_G729_DATA_H #ifndef AVCODEC_G729_1_DATA_H
#define AVCODEC_G729_DATA_H #define AVCODEC_G729_1_DATA_H
#include <stdint.h> #include <stdint.h>
@ -49,23 +49,23 @@
/** /**
* G723.1 frame types * G723.1 frame types
*/ */
typedef enum { typedef enum FrameType {
ActiveFrame, ///< Active speech ACTIVE_FRAME, ///< Active speech
SIDFrame, ///< Silence Insertion Descriptor frame SID_FRAME, ///< Silence Insertion Descriptor frame
UntransmittedFrame UNTRANSMITTED_FRAME
} FrameType; } FrameType;
static const uint8_t frame_size[4] = {24, 20, 4, 1}; static const uint8_t frame_size[4] = {24, 20, 4, 1};
typedef enum { typedef enum Rate {
Rate6k3, RATE_6300,
Rate5k3 RATE_5300
} Rate; } Rate;
/** /**
* G723.1 unpacked data subframe * G723.1 unpacked data subframe
*/ */
typedef struct { typedef struct G723_1_Subframe {
int ad_cb_lag; ///< adaptive codebook lag int ad_cb_lag; ///< adaptive codebook lag
int ad_cb_gain; int ad_cb_gain;
int dirac_train; int dirac_train;
@ -1319,4 +1319,4 @@ static const int16_t percept_flt_tbl[2][LPC_ORDER] = {
{16384, 8192, 4096, 2048, 1024, 512, 256, 128, 64, 32} {16384, 8192, 4096, 2048, 1024, 512, 256, 128, 64, 32}
}; };
#endif /* AVCODEC_G729_DATA_H */ #endif /* AVCODEC_G729_1_DATA_H */

View File

@ -20,19 +20,20 @@
*/ */
/** /**
* @file * @file
* JPEG 2000 decoder using libopenjpeg * JPEG 2000 decoder using libopenjpeg
*/ */
#include "libavutil/opt.h"
#include "libavutil/imgutils.h"
#include "libavutil/pixfmt.h"
#include "avcodec.h"
#include "libavutil/intreadwrite.h"
#include "thread.h"
#define OPJ_STATIC #define OPJ_STATIC
#include <openjpeg.h> #include <openjpeg.h>
#include "libavutil/imgutils.h"
#include "libavutil/pixfmt.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "thread.h"
#define JP2_SIG_TYPE 0x6A502020 #define JP2_SIG_TYPE 0x6A502020
#define JP2_SIG_VALUE 0x0D0A870A #define JP2_SIG_VALUE 0x0D0A870A
@ -61,7 +62,8 @@ typedef struct {
int lowqual; int lowqual;
} LibOpenJPEGContext; } LibOpenJPEGContext;
static inline int libopenjpeg_matches_pix_fmt(const opj_image_t *image, enum PixelFormat pix_fmt){ static inline int libopenjpeg_matches_pix_fmt(const opj_image_t *image, enum PixelFormat pix_fmt)
{
AVPixFmtDescriptor descriptor = av_pix_fmt_descriptors[pix_fmt]; AVPixFmtDescriptor descriptor = av_pix_fmt_descriptors[pix_fmt];
int match = 1; int match = 1;
@ -129,7 +131,7 @@ static inline int libopenjpeg_ispacked(enum PixelFormat pix_fmt) {
return 0; return 0;
component_plane = av_pix_fmt_descriptors[pix_fmt].comp[0].plane; component_plane = av_pix_fmt_descriptors[pix_fmt].comp[0].plane;
for(i = 1; i < av_pix_fmt_descriptors[pix_fmt].nb_components; i++) { for (i = 1; i < av_pix_fmt_descriptors[pix_fmt].nb_components; i++) {
if (component_plane != av_pix_fmt_descriptors[pix_fmt].comp[i].plane) if (component_plane != av_pix_fmt_descriptors[pix_fmt].comp[i].plane)
return 0; return 0;
} }
@ -139,11 +141,11 @@ static inline int libopenjpeg_ispacked(enum PixelFormat pix_fmt) {
static inline void libopenjpeg_copy_to_packed8(AVFrame *picture, opj_image_t *image) { static inline void libopenjpeg_copy_to_packed8(AVFrame *picture, opj_image_t *image) {
uint8_t *img_ptr; uint8_t *img_ptr;
int index, x, y, c; int index, x, y, c;
for(y = 0; y < picture->height; y++) { for (y = 0; y < picture->height; y++) {
index = y*picture->width; index = y*picture->width;
img_ptr = picture->data[0] + y*picture->linesize[0]; img_ptr = picture->data[0] + y*picture->linesize[0];
for(x = 0; x < picture->width; x++, index++) { for (x = 0; x < picture->width; x++, index++) {
for(c = 0; c < image->numcomps; c++) { for (c = 0; c < image->numcomps; c++) {
*img_ptr++ = image->comps[c].data[index]; *img_ptr++ = image->comps[c].data[index];
} }
} }
@ -154,9 +156,9 @@ static inline void libopenjpeg_copy_to_packed16(AVFrame *picture, opj_image_t *i
uint16_t *img_ptr; uint16_t *img_ptr;
int index, x, y, c; int index, x, y, c;
int adjust[4]; int adjust[4];
for (x = 0; x < image->numcomps; x++) { for (x = 0; x < image->numcomps; x++)
adjust[x] = FFMAX(FFMIN(16 - image->comps[x].prec, 8), 0); adjust[x] = FFMAX(FFMIN(16 - image->comps[x].prec, 8), 0);
}
for (y = 0; y < picture->height; y++) { for (y = 0; y < picture->height; y++) {
index = y*picture->width; index = y*picture->width;
img_ptr = (uint16_t*) (picture->data[0] + y*picture->linesize[0]); img_ptr = (uint16_t*) (picture->data[0] + y*picture->linesize[0]);
@ -173,11 +175,11 @@ static inline void libopenjpeg_copyto8(AVFrame *picture, opj_image_t *image) {
uint8_t *img_ptr; uint8_t *img_ptr;
int index, x, y; int index, x, y;
for(index = 0; index < image->numcomps; index++) { for (index = 0; index < image->numcomps; index++) {
comp_data = image->comps[index].data; comp_data = image->comps[index].data;
for(y = 0; y < image->comps[index].h; y++) { for (y = 0; y < image->comps[index].h; y++) {
img_ptr = picture->data[index] + y * picture->linesize[index]; img_ptr = picture->data[index] + y * picture->linesize[index];
for(x = 0; x < image->comps[index].w; x++) { for (x = 0; x < image->comps[index].w; x++) {
*img_ptr = (uint8_t) *comp_data; *img_ptr = (uint8_t) *comp_data;
img_ptr++; img_ptr++;
comp_data++; comp_data++;
@ -190,11 +192,11 @@ static inline void libopenjpeg_copyto16(AVFrame *picture, opj_image_t *image) {
int *comp_data; int *comp_data;
uint16_t *img_ptr; uint16_t *img_ptr;
int index, x, y; int index, x, y;
for(index = 0; index < image->numcomps; index++) { for (index = 0; index < image->numcomps; index++) {
comp_data = image->comps[index].data; comp_data = image->comps[index].data;
for(y = 0; y < image->comps[index].h; y++) { for (y = 0; y < image->comps[index].h; y++) {
img_ptr = (uint16_t*) (picture->data[index] + y * picture->linesize[index]); img_ptr = (uint16_t*) (picture->data[index] + y * picture->linesize[index]);
for(x = 0; x < image->comps[index].w; x++) { for (x = 0; x < image->comps[index].w; x++) {
*img_ptr = *comp_data; *img_ptr = *comp_data;
img_ptr++; img_ptr++;
comp_data++; comp_data++;
@ -240,49 +242,55 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx,
*data_size = 0; *data_size = 0;
// Check if input is a raw jpeg2k codestream or in jp2 wrapping // Check if input is a raw jpeg2k codestream or in jp2 wrapping
if((AV_RB32(buf) == 12) && if ((AV_RB32(buf) == 12) &&
(AV_RB32(buf + 4) == JP2_SIG_TYPE) && (AV_RB32(buf + 4) == JP2_SIG_TYPE) &&
(AV_RB32(buf + 8) == JP2_SIG_VALUE)) { (AV_RB32(buf + 8) == JP2_SIG_VALUE)) {
dec = opj_create_decompress(CODEC_JP2); dec = opj_create_decompress(CODEC_JP2);
} else { } else {
// If the AVPacket contains a jp2c box, then skip to /* If the AVPacket contains a jp2c box, then skip to
// the starting byte of the codestream. * the starting byte of the codestream. */
if (AV_RB32(buf + 4) == AV_RB32("jp2c")) if (AV_RB32(buf + 4) == AV_RB32("jp2c"))
buf += 8; buf += 8;
dec = opj_create_decompress(CODEC_J2K); dec = opj_create_decompress(CODEC_J2K);
} }
if(!dec) { if (!dec) {
av_log(avctx, AV_LOG_ERROR, "Error initializing decoder.\n"); av_log(avctx, AV_LOG_ERROR, "Error initializing decoder.\n");
return -1; return -1;
} }
opj_set_event_mgr((opj_common_ptr)dec, NULL, NULL); opj_set_event_mgr((opj_common_ptr)dec, NULL, NULL);
ctx->dec_params.cp_limit_decoding = LIMIT_TO_MAIN_HEADER; ctx->dec_params.cp_limit_decoding = LIMIT_TO_MAIN_HEADER;
ctx->dec_params.cp_layer = ctx->lowqual; ctx->dec_params.cp_layer = ctx->lowqual;
// Tie decoder with decoding parameters // Tie decoder with decoding parameters
opj_setup_decoder(dec, &ctx->dec_params); opj_setup_decoder(dec, &ctx->dec_params);
stream = opj_cio_open((opj_common_ptr)dec, buf, buf_size); stream = opj_cio_open((opj_common_ptr)dec, buf, buf_size);
if(!stream) {
av_log(avctx, AV_LOG_ERROR, "Codestream could not be opened for reading.\n"); if (!stream) {
av_log(avctx, AV_LOG_ERROR,
"Codestream could not be opened for reading.\n");
opj_destroy_decompress(dec); opj_destroy_decompress(dec);
return -1; return -1;
} }
// Decode the header only // Decode the header only.
image = opj_decode_with_info(dec, stream, NULL); image = opj_decode_with_info(dec, stream, NULL);
opj_cio_close(stream); opj_cio_close(stream);
if(!image) {
if (!image) {
av_log(avctx, AV_LOG_ERROR, "Error decoding codestream.\n"); av_log(avctx, AV_LOG_ERROR, "Error decoding codestream.\n");
opj_destroy_decompress(dec); opj_destroy_decompress(dec);
return -1; return -1;
} }
width = image->x1 - image->x0; width = image->x1 - image->x0;
height = image->y1 - image->y0; height = image->y1 - image->y0;
if(av_image_check_size(width, height, 0, avctx) < 0) { if (av_image_check_size(width, height, 0, avctx) < 0) {
av_log(avctx, AV_LOG_ERROR, "%dx%d dimension invalid.\n", width, height); av_log(avctx, AV_LOG_ERROR,
"%dx%d dimension invalid.\n", width, height);
goto done; goto done;
} }
avcodec_set_dimensions(avctx, width, height); avcodec_set_dimensions(avctx, width, height);
if (avctx->pix_fmt != PIX_FMT_NONE) { if (avctx->pix_fmt != PIX_FMT_NONE) {
@ -303,29 +311,30 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx,
if (image->comps[i].prec > avctx->bits_per_raw_sample) if (image->comps[i].prec > avctx->bits_per_raw_sample)
avctx->bits_per_raw_sample = image->comps[i].prec; avctx->bits_per_raw_sample = image->comps[i].prec;
if(picture->data[0]) if (picture->data[0])
ff_thread_release_buffer(avctx, picture); ff_thread_release_buffer(avctx, picture);
if(ff_thread_get_buffer(avctx, picture) < 0){ if (ff_thread_get_buffer(avctx, picture) < 0) {
av_log(avctx, AV_LOG_ERROR, "ff_thread_get_buffer() failed\n"); av_log(avctx, AV_LOG_ERROR, "ff_thread_get_buffer() failed\n");
goto done; goto done;
} }
ctx->dec_params.cp_limit_decoding = NO_LIMITATION; ctx->dec_params.cp_limit_decoding = NO_LIMITATION;
ctx->dec_params.cp_reduce = avctx->lowres; ctx->dec_params.cp_reduce = avctx->lowres;
// Tie decoder with decoding parameters // Tie decoder with decoding parameters.
opj_setup_decoder(dec, &ctx->dec_params); opj_setup_decoder(dec, &ctx->dec_params);
stream = opj_cio_open((opj_common_ptr)dec, buf, buf_size); stream = opj_cio_open((opj_common_ptr)dec, buf, buf_size);
if(!stream) { if (!stream) {
av_log(avctx, AV_LOG_ERROR, "Codestream could not be opened for reading.\n"); av_log(avctx, AV_LOG_ERROR,
"Codestream could not be opened for reading.\n");
goto done; goto done;
} }
opj_image_destroy(image); opj_image_destroy(image);
// Decode the codestream // Decode the codestream.
image = opj_decode_with_info(dec, stream, NULL); image = opj_decode_with_info(dec, stream, NULL);
opj_cio_close(stream); opj_cio_close(stream);
if(!image) { if (!image) {
av_log(avctx, AV_LOG_ERROR, "Error decoding codestream.\n"); av_log(avctx, AV_LOG_ERROR, "Error decoding codestream.\n");
goto done; goto done;
} }
@ -367,7 +376,7 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx,
*output = ctx->image; *output = ctx->image;
*data_size = sizeof(AVPicture); *data_size = sizeof(AVPicture);
ret = buf_size; ret = buf_size;
done: done:
opj_image_destroy(image); opj_image_destroy(image);
@ -379,16 +388,16 @@ static av_cold int libopenjpeg_decode_close(AVCodecContext *avctx)
{ {
LibOpenJPEGContext *ctx = avctx->priv_data; LibOpenJPEGContext *ctx = avctx->priv_data;
if(ctx->image.data[0]) if (ctx->image.data[0])
ff_thread_release_buffer(avctx, &ctx->image); ff_thread_release_buffer(avctx, &ctx->image);
return 0 ; return 0;
} }
#define OFFSET(x) offsetof(LibOpenJPEGContext, x) #define OFFSET(x) offsetof(LibOpenJPEGContext, x)
#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM #define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
static const AVOption options[] = { static const AVOption options[] = {
{ "lowqual", "Limit the number of layers used for decoding", OFFSET(lowqual), AV_OPT_TYPE_INT, { 0 }, 0, INT_MAX, VD }, { "lowqual", "Limit the number of layers used for decoding", OFFSET(lowqual), AV_OPT_TYPE_INT, { 0 }, 0, INT_MAX, VD },
{ NULL }, { NULL },
}; };

View File

@ -20,18 +20,18 @@
*/ */
/** /**
* @file * @file
* JPEG 2000 encoder using libopenjpeg * JPEG 2000 encoder using libopenjpeg
*/ */
#define OPJ_STATIC #define OPJ_STATIC
#include <openjpeg.h> #include <openjpeg.h>
#include "libavutil/opt.h"
#include "libavutil/imgutils.h"
#include "libavutil/avassert.h" #include "libavutil/avassert.h"
#include "avcodec.h" #include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "internal.h" #include "internal.h"
typedef struct { typedef struct {
@ -284,9 +284,8 @@ static int libopenjpeg_copy_unpacked8(AVCodecContext *avctx, const AVFrame *fram
for (y = 0; y < height; ++y) { for (y = 0; y < height; ++y) {
image_index = y * width; image_index = y * width;
frame_index = y * frame->linesize[compno]; frame_index = y * frame->linesize[compno];
for (x = 0; x < width; ++x) { for (x = 0; x < width; ++x)
image->comps[compno].data[image_index++] = frame->data[compno][frame_index++]; image->comps[compno].data[image_index++] = frame->data[compno][frame_index++];
}
} }
} }
@ -319,9 +318,8 @@ static int libopenjpeg_copy_unpacked16(AVCodecContext *avctx, const AVFrame *fra
for (y = 0; y < height; ++y) { for (y = 0; y < height; ++y) {
image_index = y * width; image_index = y * width;
frame_index = y * (frame->linesize[compno] / 2); frame_index = y * (frame->linesize[compno] / 2);
for (x = 0; x < width; ++x) { for (x = 0; x < width; ++x)
image->comps[compno].data[image_index++] = frame_ptr[frame_index++]; image->comps[compno].data[image_index++] = frame_ptr[frame_index++];
}
} }
} }
@ -333,7 +331,7 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
{ {
LibOpenJPEGContext *ctx = avctx->priv_data; LibOpenJPEGContext *ctx = avctx->priv_data;
opj_cinfo_t *compress = ctx->compress; opj_cinfo_t *compress = ctx->compress;
opj_image_t *image = ctx->image; opj_image_t *image = ctx->image;
opj_cio_t *stream; opj_cio_t *stream;
int cpyresult = 0; int cpyresult = 0;
int ret, len; int ret, len;
@ -342,7 +340,7 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
// x1, y1 is the width, height of the reference grid // x1, y1 is the width, height of the reference grid
image->x0 = 0; image->x0 = 0;
image->y0 = 0; image->y0 = 0;
image->x1 = (avctx->width - 1) * ctx->enc_params.subsampling_dx + 1; image->x1 = (avctx->width - 1) * ctx->enc_params.subsampling_dx + 1;
image->y1 = (avctx->height - 1) * ctx->enc_params.subsampling_dy + 1; image->y1 = (avctx->height - 1) * ctx->enc_params.subsampling_dy + 1;
switch (avctx->pix_fmt) { switch (avctx->pix_fmt) {
@ -432,7 +430,7 @@ static av_cold int libopenjpeg_encode_close(AVCodecContext *avctx)
opj_destroy_compress(ctx->compress); opj_destroy_compress(ctx->compress);
opj_image_destroy(ctx->image); opj_image_destroy(ctx->image);
av_freep(&avctx->coded_frame); av_freep(&avctx->coded_frame);
return 0 ; return 0;
} }
#define OFFSET(x) offsetof(LibOpenJPEGContext, x) #define OFFSET(x) offsetof(LibOpenJPEGContext, x)
@ -456,11 +454,11 @@ static const AVOption options[] = {
{ "rpcl", NULL, 0, AV_OPT_TYPE_CONST, { RPCL }, 0, 0, VE, "prog_order" }, { "rpcl", NULL, 0, AV_OPT_TYPE_CONST, { RPCL }, 0, 0, VE, "prog_order" },
{ "pcrl", NULL, 0, AV_OPT_TYPE_CONST, { PCRL }, 0, 0, VE, "prog_order" }, { "pcrl", NULL, 0, AV_OPT_TYPE_CONST, { PCRL }, 0, 0, VE, "prog_order" },
{ "cprl", NULL, 0, AV_OPT_TYPE_CONST, { CPRL }, 0, 0, VE, "prog_order" }, { "cprl", NULL, 0, AV_OPT_TYPE_CONST, { CPRL }, 0, 0, VE, "prog_order" },
{ "numresolution", NULL, OFFSET(numresolution), AV_OPT_TYPE_INT, { 6 }, 1, 10, VE }, { "numresolution", NULL, OFFSET(numresolution), AV_OPT_TYPE_INT, { 6 }, 1, 10, VE },
{ "numlayers", NULL, OFFSET(numlayers), AV_OPT_TYPE_INT, { 1 }, 1, 10, VE }, { "numlayers", NULL, OFFSET(numlayers), AV_OPT_TYPE_INT, { 1 }, 1, 10, VE },
{ "disto_alloc", NULL, OFFSET(disto_alloc), AV_OPT_TYPE_INT, { 1 }, 0, 1, VE }, { "disto_alloc", NULL, OFFSET(disto_alloc), AV_OPT_TYPE_INT, { 1 }, 0, 1, VE },
{ "fixed_alloc", NULL, OFFSET(fixed_alloc), AV_OPT_TYPE_INT, { 0 }, 0, 1, VE }, { "fixed_alloc", NULL, OFFSET(fixed_alloc), AV_OPT_TYPE_INT, { 0 }, 0, 1, VE },
{ "fixed_quality", NULL, OFFSET(fixed_quality), AV_OPT_TYPE_INT, { 0 }, 0, 1, VE }, { "fixed_quality", NULL, OFFSET(fixed_quality), AV_OPT_TYPE_INT, { 0 }, 0, 1, VE },
{ NULL }, { NULL },
}; };
@ -480,7 +478,7 @@ AVCodec ff_libopenjpeg_encoder = {
.encode2 = libopenjpeg_encode_frame, .encode2 = libopenjpeg_encode_frame,
.close = libopenjpeg_encode_close, .close = libopenjpeg_encode_close,
.capabilities = 0, .capabilities = 0,
.pix_fmts = (const enum PixelFormat[]){ .pix_fmts = (const enum PixelFormat[]) {
PIX_FMT_RGB24, PIX_FMT_RGBA, PIX_FMT_RGB48, PIX_FMT_RGBA64, PIX_FMT_RGB24, PIX_FMT_RGBA, PIX_FMT_RGB48, PIX_FMT_RGBA64,
PIX_FMT_GRAY8, PIX_FMT_GRAY8A, PIX_FMT_GRAY16, PIX_FMT_GRAY8, PIX_FMT_GRAY8A, PIX_FMT_GRAY16,
PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUVA420P, PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUVA420P,

View File

@ -27,7 +27,7 @@
*/ */
#define LIBAVCODEC_VERSION_MAJOR 54 #define LIBAVCODEC_VERSION_MAJOR 54
#define LIBAVCODEC_VERSION_MINOR 43 #define LIBAVCODEC_VERSION_MINOR 44
#define LIBAVCODEC_VERSION_MICRO 100 #define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \

View File

@ -133,10 +133,10 @@ AVFilter avfilter_af_aformat = {
.query_formats = query_formats, .query_formats = query_formats,
.priv_size = sizeof(AFormatContext), .priv_size = sizeof(AFormatContext),
.inputs = (AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_AUDIO, }, .type = AVMEDIA_TYPE_AUDIO, },
{ .name = NULL}}, { .name = NULL}},
.outputs = (AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_AUDIO}, .type = AVMEDIA_TYPE_AUDIO},
{ .name = NULL}}, { .name = NULL}},
}; };

View File

@ -32,12 +32,12 @@ AVFilter avfilter_af_anull = {
.priv_size = 0, .priv_size = 0,
.inputs = (const AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_AUDIO, .type = AVMEDIA_TYPE_AUDIO,
.get_audio_buffer = ff_null_get_audio_buffer, }, .get_audio_buffer = ff_null_get_audio_buffer, },
{ .name = NULL}}, { .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_AUDIO, }, .type = AVMEDIA_TYPE_AUDIO, },
{ .name = NULL}}, { .name = NULL}},
}; };

View File

@ -392,12 +392,12 @@ AVFilter avfilter_af_channelmap = {
.query_formats = channelmap_query_formats, .query_formats = channelmap_query_formats,
.priv_size = sizeof(ChannelMapContext), .priv_size = sizeof(ChannelMapContext),
.inputs = (AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_AUDIO, .type = AVMEDIA_TYPE_AUDIO,
.filter_samples = channelmap_filter_samples, .filter_samples = channelmap_filter_samples,
.config_props = channelmap_config_input }, .config_props = channelmap_config_input },
{ .name = NULL }}, { .name = NULL }},
.outputs = (AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_AUDIO }, .type = AVMEDIA_TYPE_AUDIO },
{ .name = NULL }}, { .name = NULL }},
}; };

View File

@ -127,8 +127,8 @@ AVFilter avfilter_asrc_anullsrc = {
.inputs = (const AVFilterPad[]) {{ .name = NULL}}, .inputs = (const AVFilterPad[]) {{ .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_AUDIO, .type = AVMEDIA_TYPE_AUDIO,
.config_props = config_props, .config_props = config_props,
.request_frame = request_frame, }, .request_frame = request_frame, },
{ .name = NULL}}, { .name = NULL}},
}; };

View File

@ -149,13 +149,13 @@ AVFilter avfilter_vsink_buffer = {
.priv_size = sizeof(BufferSinkContext), .priv_size = sizeof(BufferSinkContext),
.uninit = uninit, .uninit = uninit,
.inputs = (AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.start_frame = start_frame, .start_frame = start_frame,
.min_perms = AV_PERM_READ, .min_perms = AV_PERM_READ,
.needs_fifo = 1 }, .needs_fifo = 1 },
{ .name = NULL }}, { .name = NULL }},
.outputs = (AVFilterPad[]) {{ .name = NULL }}, .outputs = (const AVFilterPad[]) {{ .name = NULL }},
}; };
AVFilter avfilter_asink_abuffer = { AVFilter avfilter_asink_abuffer = {
@ -164,11 +164,11 @@ AVFilter avfilter_asink_abuffer = {
.priv_size = sizeof(BufferSinkContext), .priv_size = sizeof(BufferSinkContext),
.uninit = uninit, .uninit = uninit,
.inputs = (AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_AUDIO, .type = AVMEDIA_TYPE_AUDIO,
.filter_samples = filter_samples, .filter_samples = filter_samples,
.min_perms = AV_PERM_READ, .min_perms = AV_PERM_READ,
.needs_fifo = 1 }, .needs_fifo = 1 },
{ .name = NULL }}, { .name = NULL }},
.outputs = (AVFilterPad[]) {{ .name = NULL }}, .outputs = (const AVFilterPad[]) {{ .name = NULL }},
}; };

View File

@ -416,13 +416,13 @@ AVFilter avfilter_vsrc_buffer = {
.init = init_video, .init = init_video,
.uninit = uninit, .uninit = uninit,
.inputs = (AVFilterPad[]) {{ .name = NULL }}, .inputs = (const AVFilterPad[]) {{ .name = NULL }},
.outputs = (AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.request_frame = request_frame, .request_frame = request_frame,
.poll_frame = poll_frame, .poll_frame = poll_frame,
.config_props = config_props, }, .config_props = config_props, },
{ .name = NULL}}, { .name = NULL}},
}; };
AVFilter avfilter_asrc_abuffer = { AVFilter avfilter_asrc_abuffer = {
@ -434,11 +434,11 @@ AVFilter avfilter_asrc_abuffer = {
.init = init_audio, .init = init_audio,
.uninit = uninit, .uninit = uninit,
.inputs = (AVFilterPad[]) {{ .name = NULL }}, .inputs = (const AVFilterPad[]) {{ .name = NULL }},
.outputs = (AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_AUDIO, .type = AVMEDIA_TYPE_AUDIO,
.request_frame = request_frame, .request_frame = request_frame,
.poll_frame = poll_frame, .poll_frame = poll_frame,
.config_props = config_props, }, .config_props = config_props, },
{ .name = NULL}}, { .name = NULL}},
}; };

View File

@ -269,18 +269,18 @@ AVFilter avfilter_vf_fifo = {
.priv_size = sizeof(FifoContext), .priv_size = sizeof(FifoContext),
.inputs = (const AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.get_video_buffer= ff_null_get_video_buffer, .get_video_buffer= ff_null_get_video_buffer,
.start_frame = start_frame, .start_frame = start_frame,
.draw_slice = draw_slice, .draw_slice = draw_slice,
.end_frame = end_frame, .end_frame = end_frame,
.rej_perms = AV_PERM_REUSE2, }, .rej_perms = AV_PERM_REUSE2, },
{ .name = NULL}}, { .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.request_frame = request_frame, }, .request_frame = request_frame, },
{ .name = NULL}}, { .name = NULL}},
}; };
AVFilter avfilter_af_afifo = { AVFilter avfilter_af_afifo = {
@ -292,14 +292,14 @@ AVFilter avfilter_af_afifo = {
.priv_size = sizeof(FifoContext), .priv_size = sizeof(FifoContext),
.inputs = (AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_AUDIO, .type = AVMEDIA_TYPE_AUDIO,
.get_audio_buffer = ff_null_get_audio_buffer, .get_audio_buffer = ff_null_get_audio_buffer,
.filter_samples = add_to_queue, .filter_samples = add_to_queue,
.rej_perms = AV_PERM_REUSE2, }, .rej_perms = AV_PERM_REUSE2, },
{ .name = NULL}}, { .name = NULL}},
.outputs = (AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_AUDIO, .type = AVMEDIA_TYPE_AUDIO,
.request_frame = request_frame, }, .request_frame = request_frame, },
{ .name = NULL}}, { .name = NULL}},
}; };

View File

@ -98,14 +98,14 @@ AVFilter avfilter_vf_split = {
.init = split_init, .init = split_init,
.uninit = split_uninit, .uninit = split_uninit,
.inputs = (const AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.get_video_buffer= ff_null_get_video_buffer, .get_video_buffer= ff_null_get_video_buffer,
.start_frame = start_frame, .start_frame = start_frame,
.draw_slice = draw_slice, .draw_slice = draw_slice,
.end_frame = end_frame, }, .end_frame = end_frame, },
{ .name = NULL}}, { .name = NULL}},
.outputs = (AVFilterPad[]) {{ .name = NULL}}, .outputs = (const AVFilterPad[]) {{ .name = NULL}},
}; };
static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *samplesref) static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *samplesref)

View File

@ -344,11 +344,11 @@ AVFilter avfilter_vsrc_movie = {
.query_formats = movie_query_formats, .query_formats = movie_query_formats,
.inputs = (const AVFilterPad[]) {{ .name = NULL }}, .inputs = (const AVFilterPad[]) {{ .name = NULL }},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.request_frame = movie_request_frame, .request_frame = movie_request_frame,
.config_props = movie_config_output_props, }, .config_props = movie_config_output_props, },
{ .name = NULL}}, { .name = NULL}},
}; };
#endif /* CONFIG_MOVIE_FILTER */ #endif /* CONFIG_MOVIE_FILTER */

View File

@ -86,17 +86,17 @@ AVFilter avfilter_vf_setdar = {
.priv_size = sizeof(AspectContext), .priv_size = sizeof(AspectContext),
.inputs = (const AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.config_props = setdar_config_props, .config_props = setdar_config_props,
.get_video_buffer = ff_null_get_video_buffer, .get_video_buffer = ff_null_get_video_buffer,
.start_frame = start_frame, .start_frame = start_frame,
.end_frame = ff_null_end_frame }, .end_frame = ff_null_end_frame },
{ .name = NULL}}, { .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, }, .type = AVMEDIA_TYPE_VIDEO, },
{ .name = NULL}}, { .name = NULL}},
}; };
#endif /* CONFIG_SETDAR_FILTER */ #endif /* CONFIG_SETDAR_FILTER */
@ -118,16 +118,16 @@ AVFilter avfilter_vf_setsar = {
.priv_size = sizeof(AspectContext), .priv_size = sizeof(AspectContext),
.inputs = (const AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.config_props = setsar_config_props, .config_props = setsar_config_props,
.get_video_buffer = ff_null_get_video_buffer, .get_video_buffer = ff_null_get_video_buffer,
.start_frame = start_frame, .start_frame = start_frame,
.end_frame = ff_null_end_frame }, .end_frame = ff_null_end_frame },
{ .name = NULL}}, { .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, }, .type = AVMEDIA_TYPE_VIDEO, },
{ .name = NULL}}, { .name = NULL}},
}; };
#endif /* CONFIG_SETSAR_FILTER */ #endif /* CONFIG_SETSAR_FILTER */

View File

@ -126,13 +126,13 @@ AVFilter avfilter_vf_blackframe = {
.query_formats = query_formats, .query_formats = query_formats,
.inputs = (const AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.draw_slice = draw_slice, .draw_slice = draw_slice,
.get_video_buffer = ff_null_get_video_buffer, .get_video_buffer = ff_null_get_video_buffer,
.start_frame = ff_null_start_frame_keep_ref, .start_frame = ff_null_start_frame_keep_ref,
.end_frame = end_frame, }, .end_frame = end_frame, },
{ .name = NULL}}, { .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO }, .type = AVMEDIA_TYPE_VIDEO },

View File

@ -339,14 +339,14 @@ AVFilter avfilter_vf_boxblur = {
.uninit = uninit, .uninit = uninit,
.query_formats = query_formats, .query_formats = query_formats,
.inputs = (const AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.config_props = config_input, .config_props = config_input,
.draw_slice = null_draw_slice, .draw_slice = null_draw_slice,
.end_frame = end_frame, .end_frame = end_frame,
.min_perms = AV_PERM_READ }, .min_perms = AV_PERM_READ },
{ .name = NULL}}, { .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, }, .type = AVMEDIA_TYPE_VIDEO, },
{ .name = NULL}}, { .name = NULL}},
}; };

View File

@ -29,14 +29,14 @@ AVFilter avfilter_vf_copy = {
.name = "copy", .name = "copy",
.description = NULL_IF_CONFIG_SMALL("Copy the input video unchanged to the output."), .description = NULL_IF_CONFIG_SMALL("Copy the input video unchanged to the output."),
.inputs = (const AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.get_video_buffer = ff_null_get_video_buffer, .get_video_buffer = ff_null_get_video_buffer,
.start_frame = ff_null_start_frame, .start_frame = ff_null_start_frame,
.end_frame = ff_null_end_frame, .end_frame = ff_null_end_frame,
.rej_perms = ~0 }, .rej_perms = ~0 },
{ .name = NULL}}, { .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, }, .type = AVMEDIA_TYPE_VIDEO, },
{ .name = NULL}}, { .name = NULL}},
}; };

View File

@ -349,16 +349,16 @@ AVFilter avfilter_vf_crop = {
.init = init, .init = init,
.uninit = uninit, .uninit = uninit,
.inputs = (const AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.start_frame = start_frame, .start_frame = start_frame,
.draw_slice = draw_slice, .draw_slice = draw_slice,
.end_frame = end_frame, .end_frame = end_frame,
.get_video_buffer = ff_null_get_video_buffer, .get_video_buffer = ff_null_get_video_buffer,
.config_props = config_input, }, .config_props = config_input, },
{ .name = NULL}}, { .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.config_props = config_output, }, .config_props = config_output, },
{ .name = NULL}}, { .name = NULL}},
}; };

View File

@ -203,15 +203,15 @@ AVFilter avfilter_vf_cropdetect = {
.query_formats = query_formats, .query_formats = query_formats,
.inputs = (const AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.config_props = config_input, .config_props = config_input,
.get_video_buffer = ff_null_get_video_buffer, .get_video_buffer = ff_null_get_video_buffer,
.start_frame = ff_null_start_frame, .start_frame = ff_null_start_frame,
.end_frame = end_frame, }, .end_frame = end_frame, },
{ .name = NULL}}, { .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO }, .type = AVMEDIA_TYPE_VIDEO },
{ .name = NULL}}, { .name = NULL}},
}; };

View File

@ -264,16 +264,16 @@ AVFilter avfilter_vf_delogo = {
.init = init, .init = init,
.query_formats = query_formats, .query_formats = query_formats,
.inputs = (const AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.get_video_buffer = ff_null_get_video_buffer, .get_video_buffer = ff_null_get_video_buffer,
.start_frame = start_frame, .start_frame = start_frame,
.draw_slice = null_draw_slice, .draw_slice = null_draw_slice,
.end_frame = end_frame, .end_frame = end_frame,
.min_perms = AV_PERM_WRITE | AV_PERM_READ, .min_perms = AV_PERM_WRITE | AV_PERM_READ,
.rej_perms = AV_PERM_PRESERVE }, .rej_perms = AV_PERM_PRESERVE },
{ .name = NULL}}, { .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, }, .type = AVMEDIA_TYPE_VIDEO, },
{ .name = NULL}}, { .name = NULL}},
}; };

View File

@ -130,17 +130,17 @@ AVFilter avfilter_vf_drawbox = {
.init = init, .init = init,
.query_formats = query_formats, .query_formats = query_formats,
.inputs = (const AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.config_props = config_input, .config_props = config_input,
.get_video_buffer = ff_null_get_video_buffer, .get_video_buffer = ff_null_get_video_buffer,
.start_frame = ff_null_start_frame, .start_frame = ff_null_start_frame,
.draw_slice = draw_slice, .draw_slice = draw_slice,
.end_frame = ff_null_end_frame, .end_frame = ff_null_end_frame,
.min_perms = AV_PERM_WRITE | AV_PERM_READ, .min_perms = AV_PERM_WRITE | AV_PERM_READ,
.rej_perms = AV_PERM_PRESERVE }, .rej_perms = AV_PERM_PRESERVE },
{ .name = NULL}}, { .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, }, .type = AVMEDIA_TYPE_VIDEO, },
{ .name = NULL}}, { .name = NULL}},
}; };

View File

@ -813,19 +813,19 @@ AVFilter avfilter_vf_drawtext = {
.uninit = uninit, .uninit = uninit,
.query_formats = query_formats, .query_formats = query_formats,
.inputs = (const AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.get_video_buffer = ff_null_get_video_buffer, .get_video_buffer = ff_null_get_video_buffer,
.start_frame = ff_null_start_frame, .start_frame = ff_null_start_frame,
.draw_slice = null_draw_slice, .draw_slice = null_draw_slice,
.end_frame = end_frame, .end_frame = end_frame,
.config_props = config_input, .config_props = config_input,
.min_perms = AV_PERM_WRITE | .min_perms = AV_PERM_WRITE |
AV_PERM_READ, AV_PERM_READ,
.rej_perms = AV_PERM_PRESERVE }, .rej_perms = AV_PERM_PRESERVE },
{ .name = NULL}}, { .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, }, .type = AVMEDIA_TYPE_VIDEO, },
{ .name = NULL}}, { .name = NULL}},
.process_command = command, .process_command = command,
}; };

View File

@ -279,17 +279,17 @@ AVFilter avfilter_vf_fade = {
.priv_size = sizeof(FadeContext), .priv_size = sizeof(FadeContext),
.query_formats = query_formats, .query_formats = query_formats,
.inputs = (const AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.config_props = config_props, .config_props = config_props,
.get_video_buffer = ff_null_get_video_buffer, .get_video_buffer = ff_null_get_video_buffer,
.start_frame = ff_null_start_frame, .start_frame = ff_null_start_frame,
.draw_slice = draw_slice, .draw_slice = draw_slice,
.end_frame = end_frame, .end_frame = end_frame,
.min_perms = AV_PERM_READ | AV_PERM_WRITE, .min_perms = AV_PERM_READ | AV_PERM_WRITE,
.rej_perms = AV_PERM_PRESERVE, }, .rej_perms = AV_PERM_PRESERVE, },
{ .name = NULL}}, { .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, }, .type = AVMEDIA_TYPE_VIDEO, },
{ .name = NULL}}, { .name = NULL}},
}; };

View File

@ -221,17 +221,17 @@ AVFilter avfilter_vf_fieldorder = {
.init = init, .init = init,
.priv_size = sizeof(FieldOrderContext), .priv_size = sizeof(FieldOrderContext),
.query_formats = query_formats, .query_formats = query_formats,
.inputs = (const AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.config_props = config_input, .config_props = config_input,
.start_frame = start_frame, .start_frame = start_frame,
.get_video_buffer = get_video_buffer, .get_video_buffer = get_video_buffer,
.draw_slice = draw_slice, .draw_slice = draw_slice,
.end_frame = end_frame, .end_frame = end_frame,
.min_perms = AV_PERM_READ, .min_perms = AV_PERM_READ,
.rej_perms = AV_PERM_REUSE2|AV_PERM_PRESERVE,}, .rej_perms = AV_PERM_REUSE2|AV_PERM_PRESERVE,},
{ .name = NULL}}, { .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, }, .type = AVMEDIA_TYPE_VIDEO, },
{ .name = NULL}}, { .name = NULL}},
}; };

View File

@ -103,16 +103,16 @@ AVFilter avfilter_vf_format = {
.priv_size = sizeof(FormatContext), .priv_size = sizeof(FormatContext),
.inputs = (const AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.get_video_buffer= ff_null_get_video_buffer, .get_video_buffer= ff_null_get_video_buffer,
.start_frame = ff_null_start_frame, .start_frame = ff_null_start_frame,
.draw_slice = ff_null_draw_slice, .draw_slice = ff_null_draw_slice,
.end_frame = ff_null_end_frame, }, .end_frame = ff_null_end_frame, },
{ .name = NULL}}, { .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO }, .type = AVMEDIA_TYPE_VIDEO },
{ .name = NULL}}, { .name = NULL}},
}; };
#endif /* CONFIG_FORMAT_FILTER */ #endif /* CONFIG_FORMAT_FILTER */
@ -133,15 +133,15 @@ AVFilter avfilter_vf_noformat = {
.priv_size = sizeof(FormatContext), .priv_size = sizeof(FormatContext),
.inputs = (const AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.get_video_buffer= ff_null_get_video_buffer, .get_video_buffer= ff_null_get_video_buffer,
.start_frame = ff_null_start_frame, .start_frame = ff_null_start_frame,
.draw_slice = ff_null_draw_slice, .draw_slice = ff_null_draw_slice,
.end_frame = ff_null_end_frame, }, .end_frame = ff_null_end_frame, },
{ .name = NULL}}, { .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO }, .type = AVMEDIA_TYPE_VIDEO },
{ .name = NULL}}, { .name = NULL}},
}; };
#endif /* CONFIG_NOFORMAT_FILTER */ #endif /* CONFIG_NOFORMAT_FILTER */

View File

@ -260,15 +260,15 @@ AVFilter avfilter_vf_fps = {
.priv_size = sizeof(FPSContext), .priv_size = sizeof(FPSContext),
.inputs = (AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.start_frame = null_start_frame, .start_frame = null_start_frame,
.draw_slice = null_draw_slice, .draw_slice = null_draw_slice,
.end_frame = end_frame, }, .end_frame = end_frame, },
{ .name = NULL}}, { .name = NULL}},
.outputs = (AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.request_frame = request_frame, .request_frame = request_frame,
.config_props = config_props}, .config_props = config_props},
{ .name = NULL}}, { .name = NULL}},
}; };

View File

@ -366,17 +366,17 @@ AVFilter avfilter_vf_frei0r = {
.priv_size = sizeof(Frei0rContext), .priv_size = sizeof(Frei0rContext),
.inputs = (const AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.draw_slice = null_draw_slice, .draw_slice = null_draw_slice,
.config_props = config_input_props, .config_props = config_input_props,
.end_frame = end_frame, .end_frame = end_frame,
.min_perms = AV_PERM_READ }, .min_perms = AV_PERM_READ },
{ .name = NULL}}, { .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, }, .type = AVMEDIA_TYPE_VIDEO, },
{ .name = NULL}}, { .name = NULL}},
}; };
static av_cold int source_init(AVFilterContext *ctx, const char *args) static av_cold int source_init(AVFilterContext *ctx, const char *args)
@ -458,9 +458,9 @@ AVFilter avfilter_vsrc_frei0r_src = {
.inputs = (const AVFilterPad[]) {{ .name = NULL}}, .inputs = (const AVFilterPad[]) {{ .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.request_frame = source_request_frame, .request_frame = source_request_frame,
.config_props = source_config_props }, .config_props = source_config_props },
{ .name = NULL}}, { .name = NULL}},
}; };

View File

@ -235,15 +235,15 @@ AVFilter avfilter_vf_gradfun = {
.uninit = uninit, .uninit = uninit,
.query_formats = query_formats, .query_formats = query_formats,
.inputs = (const AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.config_props = config_input, .config_props = config_input,
.start_frame = start_frame, .start_frame = start_frame,
.draw_slice = null_draw_slice, .draw_slice = null_draw_slice,
.end_frame = end_frame, .end_frame = end_frame,
.min_perms = AV_PERM_READ, }, .min_perms = AV_PERM_READ, },
{ .name = NULL}}, { .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, }, .type = AVMEDIA_TYPE_VIDEO, },
{ .name = NULL}}, { .name = NULL}},
}; };

View File

@ -168,14 +168,14 @@ AVFilter avfilter_vf_hflip = {
.priv_size = sizeof(FlipContext), .priv_size = sizeof(FlipContext),
.query_formats = query_formats, .query_formats = query_formats,
.inputs = (const AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.start_frame = start_frame, .start_frame = start_frame,
.draw_slice = draw_slice, .draw_slice = draw_slice,
.config_props = config_props, .config_props = config_props,
.min_perms = AV_PERM_READ, }, .min_perms = AV_PERM_READ, },
{ .name = NULL}}, { .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, }, .type = AVMEDIA_TYPE_VIDEO, },
{ .name = NULL}}, { .name = NULL}},
}; };

View File

@ -333,14 +333,14 @@ AVFilter avfilter_vf_hqdn3d = {
.uninit = uninit, .uninit = uninit,
.query_formats = query_formats, .query_formats = query_formats,
.inputs = (const AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.draw_slice = null_draw_slice, .draw_slice = null_draw_slice,
.config_props = config_input, .config_props = config_input,
.end_frame = end_frame }, .end_frame = end_frame },
{ .name = NULL}}, { .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO }, .type = AVMEDIA_TYPE_VIDEO },
{ .name = NULL}}, { .name = NULL}},
}; };

View File

@ -379,14 +379,14 @@ AVFilter avfilter_vf_ocv = {
.init = init, .init = init,
.uninit = uninit, .uninit = uninit,
.inputs = (const AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.draw_slice = null_draw_slice, .draw_slice = null_draw_slice,
.end_frame = end_frame, .end_frame = end_frame,
.min_perms = AV_PERM_READ }, .min_perms = AV_PERM_READ },
{ .name = NULL}}, { .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, }, .type = AVMEDIA_TYPE_VIDEO, },
{ .name = NULL}}, { .name = NULL}},
}; };

View File

@ -335,6 +335,19 @@ static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
ff_draw_slice(outlink, y, h, slice_dir); ff_draw_slice(outlink, y, h, slice_dir);
} }
static const AVFilterPad inputs[] = {
{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO,
.draw_slice = draw_slice,
.config_props = config_props,
.min_perms = AV_PERM_READ, },
{ .name = NULL}
};
static const AVFilterPad outputs[] = {
{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, },
{ .name = NULL}
};
#define DEFINE_LUT_FILTER(name_, description_, init_) \ #define DEFINE_LUT_FILTER(name_, description_, init_) \
AVFilter avfilter_vf_##name_ = { \ AVFilter avfilter_vf_##name_ = { \
.name = #name_, \ .name = #name_, \
@ -345,15 +358,8 @@ static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
.uninit = uninit, \ .uninit = uninit, \
.query_formats = query_formats, \ .query_formats = query_formats, \
\ \
.inputs = (const AVFilterPad[]) {{ .name = "default", \ .inputs = inputs, \
.type = AVMEDIA_TYPE_VIDEO, \ .outputs = outputs, \
.draw_slice = draw_slice, \
.config_props = config_props, \
.min_perms = AV_PERM_READ, }, \
{ .name = NULL}}, \
.outputs = (const AVFilterPad[]) {{ .name = "default", \
.type = AVMEDIA_TYPE_VIDEO, }, \
{ .name = NULL}}, \
} }
#if CONFIG_LUT_FILTER #if CONFIG_LUT_FILTER

View File

@ -31,14 +31,14 @@ AVFilter avfilter_vf_null = {
.priv_size = 0, .priv_size = 0,
.inputs = (const AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.get_video_buffer = ff_null_get_video_buffer, .get_video_buffer = ff_null_get_video_buffer,
.start_frame = ff_null_start_frame, .start_frame = ff_null_start_frame,
.end_frame = ff_null_end_frame }, .end_frame = ff_null_end_frame },
{ .name = NULL}}, { .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, }, .type = AVMEDIA_TYPE_VIDEO, },
{ .name = NULL}}, { .name = NULL}},
}; };

View File

@ -610,27 +610,27 @@ AVFilter avfilter_vf_overlay = {
.query_formats = query_formats, .query_formats = query_formats,
.inputs = (const AVFilterPad[]) {{ .name = "main", .inputs = (const AVFilterPad[]) {{ .name = "main",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.get_video_buffer= get_video_buffer, .get_video_buffer= get_video_buffer,
.config_props = config_input_main, .config_props = config_input_main,
.start_frame = start_frame_main, .start_frame = start_frame_main,
.draw_slice = draw_slice_main, .draw_slice = draw_slice_main,
.end_frame = end_frame_main, .end_frame = end_frame_main,
.min_perms = AV_PERM_READ, .min_perms = AV_PERM_READ,
.rej_perms = AV_PERM_REUSE2|AV_PERM_PRESERVE, }, .rej_perms = AV_PERM_REUSE2|AV_PERM_PRESERVE, },
{ .name = "overlay", { .name = "overlay",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.config_props = config_input_overlay, .config_props = config_input_overlay,
.start_frame = start_frame_over, .start_frame = start_frame_over,
.draw_slice = null_draw_slice, .draw_slice = null_draw_slice,
.end_frame = end_frame_over, .end_frame = end_frame_over,
.min_perms = AV_PERM_READ, .min_perms = AV_PERM_READ,
.rej_perms = AV_PERM_REUSE2, }, .rej_perms = AV_PERM_REUSE2, },
{ .name = NULL}}, { .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.config_props = config_output, .config_props = config_output,
.request_frame = request_frame, }, .request_frame = request_frame, },
{ .name = NULL}}, { .name = NULL}},
}; };

View File

@ -370,16 +370,16 @@ AVFilter avfilter_vf_pad = {
.init = init, .init = init,
.query_formats = query_formats, .query_formats = query_formats,
.inputs = (const AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.config_props = config_input, .config_props = config_input,
.get_video_buffer = get_video_buffer, .get_video_buffer = get_video_buffer,
.start_frame = start_frame, .start_frame = start_frame,
.draw_slice = draw_slice, }, .draw_slice = draw_slice, },
{ .name = NULL}}, { .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.config_props = config_output, }, .config_props = config_output, },
{ .name = NULL}}, { .name = NULL}},
}; };

View File

@ -118,15 +118,15 @@ AVFilter avfilter_vf_pixdesctest = {
.priv_size = sizeof(PixdescTestContext), .priv_size = sizeof(PixdescTestContext),
.uninit = uninit, .uninit = uninit,
.inputs = (const AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.start_frame = start_frame, .start_frame = start_frame,
.draw_slice = draw_slice, .draw_slice = draw_slice,
.config_props = config_props, .config_props = config_props,
.min_perms = AV_PERM_READ, }, .min_perms = AV_PERM_READ, },
{ .name = NULL}}, { .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, }, .type = AVMEDIA_TYPE_VIDEO, },
{ .name = NULL}}, { .name = NULL}},
}; };

View File

@ -385,14 +385,14 @@ AVFilter avfilter_vf_scale = {
.priv_size = sizeof(ScaleContext), .priv_size = sizeof(ScaleContext),
.inputs = (const AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.start_frame = start_frame, .start_frame = start_frame,
.draw_slice = draw_slice, .draw_slice = draw_slice,
.min_perms = AV_PERM_READ, }, .min_perms = AV_PERM_READ, },
{ .name = NULL}}, { .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.config_props = config_props, }, .config_props = config_props, },
{ .name = NULL}}, { .name = NULL}},
}; };

View File

@ -402,17 +402,17 @@ AVFilter avfilter_vf_select = {
.priv_size = sizeof(SelectContext), .priv_size = sizeof(SelectContext),
.inputs = (const AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.get_video_buffer = ff_null_get_video_buffer, .get_video_buffer = ff_null_get_video_buffer,
.config_props = config_input, .config_props = config_input,
.start_frame = start_frame, .start_frame = start_frame,
.draw_slice = draw_slice, .draw_slice = draw_slice,
.end_frame = end_frame }, .end_frame = end_frame },
{ .name = NULL }}, { .name = NULL }},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.poll_frame = poll_frame, .poll_frame = poll_frame,
.request_frame = request_frame, }, .request_frame = request_frame, },
{ .name = NULL}}, { .name = NULL}},
}; };

View File

@ -139,13 +139,13 @@ AVFilter avfilter_vf_setpts = {
.priv_size = sizeof(SetPTSContext), .priv_size = sizeof(SetPTSContext),
.inputs = (const AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.get_video_buffer = ff_null_get_video_buffer, .get_video_buffer = ff_null_get_video_buffer,
.config_props = config_input, .config_props = config_input,
.start_frame = start_frame, }, .start_frame = start_frame, },
{ .name = NULL }}, { .name = NULL }},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, }, .type = AVMEDIA_TYPE_VIDEO, },
{ .name = NULL}}, { .name = NULL}},
}; };

View File

@ -91,15 +91,15 @@ AVFilter avfilter_vf_showinfo = {
.priv_size = sizeof(ShowInfoContext), .priv_size = sizeof(ShowInfoContext),
.init = init, .init = init,
.inputs = (const AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.get_video_buffer = ff_null_get_video_buffer, .get_video_buffer = ff_null_get_video_buffer,
.start_frame = ff_null_start_frame_keep_ref, .start_frame = ff_null_start_frame_keep_ref,
.end_frame = end_frame, .end_frame = end_frame,
.min_perms = AV_PERM_READ, }, .min_perms = AV_PERM_READ, },
{ .name = NULL}}, { .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO }, .type = AVMEDIA_TYPE_VIDEO },
{ .name = NULL}}, { .name = NULL}},
}; };

View File

@ -106,15 +106,15 @@ AVFilter avfilter_vf_slicify = {
.priv_size = sizeof(SliceContext), .priv_size = sizeof(SliceContext),
.inputs = (const AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.get_video_buffer = ff_null_get_video_buffer, .get_video_buffer = ff_null_get_video_buffer,
.start_frame = start_frame, .start_frame = start_frame,
.draw_slice = draw_slice, .draw_slice = draw_slice,
.config_props = config_props, .config_props = config_props,
.end_frame = ff_null_end_frame, }, .end_frame = ff_null_end_frame, },
{ .name = NULL}}, { .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, }, .type = AVMEDIA_TYPE_VIDEO, },
{ .name = NULL}}, { .name = NULL}},
}; };

View File

@ -204,15 +204,15 @@ AVFilter avfilter_vf_transpose = {
.query_formats = query_formats, .query_formats = query_formats,
.inputs = (const AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.start_frame = start_frame, .start_frame = start_frame,
.draw_slice = null_draw_slice, .draw_slice = null_draw_slice,
.end_frame = end_frame, .end_frame = end_frame,
.min_perms = AV_PERM_READ, }, .min_perms = AV_PERM_READ, },
{ .name = NULL}}, { .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.config_props = config_props_output, .config_props = config_props_output,
.type = AVMEDIA_TYPE_VIDEO, }, .type = AVMEDIA_TYPE_VIDEO, },
{ .name = NULL}}, { .name = NULL}},
}; };

View File

@ -243,15 +243,15 @@ AVFilter avfilter_vf_unsharp = {
.uninit = uninit, .uninit = uninit,
.query_formats = query_formats, .query_formats = query_formats,
.inputs = (const AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.draw_slice = draw_slice, .draw_slice = draw_slice,
.end_frame = end_frame, .end_frame = end_frame,
.config_props = config_props, .config_props = config_props,
.min_perms = AV_PERM_READ, }, .min_perms = AV_PERM_READ, },
{ .name = NULL}}, { .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, }, .type = AVMEDIA_TYPE_VIDEO, },
{ .name = NULL}}, { .name = NULL}},
}; };

View File

@ -95,14 +95,14 @@ AVFilter avfilter_vf_vflip = {
.priv_size = sizeof(FlipContext), .priv_size = sizeof(FlipContext),
.inputs = (const AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.get_video_buffer = get_video_buffer, .get_video_buffer = get_video_buffer,
.start_frame = start_frame, .start_frame = start_frame,
.draw_slice = draw_slice, .draw_slice = draw_slice,
.config_props = config_input, }, .config_props = config_input, },
{ .name = NULL}}, { .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, }, .type = AVMEDIA_TYPE_VIDEO, },
{ .name = NULL}}, { .name = NULL}},
}; };

View File

@ -134,9 +134,8 @@ static void filter(AVFilterContext *ctx, AVFilterBufferRef *dstpic,
} }
} }
} }
#if HAVE_MMX
__asm__ volatile("emms \n\t" : : : "memory"); emms_c();
#endif
} }
static AVFilterBufferRef *get_video_buffer(AVFilterLink *link, int perms, int w, int h) static AVFilterBufferRef *get_video_buffer(AVFilterLink *link, int perms, int w, int h)
@ -403,19 +402,19 @@ AVFilter avfilter_vf_yadif = {
.uninit = uninit, .uninit = uninit,
.query_formats = query_formats, .query_formats = query_formats,
.inputs = (const AVFilterPad[]) {{ .name = "default", .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.start_frame = start_frame, .start_frame = start_frame,
.get_video_buffer = get_video_buffer, .get_video_buffer = get_video_buffer,
.draw_slice = null_draw_slice, .draw_slice = null_draw_slice,
.end_frame = end_frame, .end_frame = end_frame,
.rej_perms = AV_PERM_REUSE2, }, .rej_perms = AV_PERM_REUSE2, },
{ .name = NULL}}, { .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.poll_frame = poll_frame, .poll_frame = poll_frame,
.request_frame = request_frame, .request_frame = request_frame,
.config_props = config_props, }, .config_props = config_props, },
{ .name = NULL}}, { .name = NULL}},
}; };

View File

@ -174,9 +174,9 @@ AVFilter avfilter_vsrc_color = {
.inputs = (const AVFilterPad[]) {{ .name = NULL}}, .inputs = (const AVFilterPad[]) {{ .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.request_frame = color_request_frame, .request_frame = color_request_frame,
.config_props = color_config_props }, .config_props = color_config_props },
{ .name = NULL}}, { .name = NULL}},
}; };

View File

@ -401,10 +401,10 @@ AVFilter avfilter_vsrc_testsrc = {
.inputs = (const AVFilterPad[]) {{ .name = NULL}}, .inputs = (const AVFilterPad[]) {{ .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.request_frame = request_frame, .request_frame = request_frame,
.config_props = config_props, }, .config_props = config_props, },
{ .name = NULL }}, { .name = NULL }},
}; };
#endif /* CONFIG_TESTSRC_FILTER */ #endif /* CONFIG_TESTSRC_FILTER */
@ -525,10 +525,10 @@ AVFilter avfilter_vsrc_rgbtestsrc = {
.inputs = (const AVFilterPad[]) {{ .name = NULL}}, .inputs = (const AVFilterPad[]) {{ .name = NULL}},
.outputs = (const AVFilterPad[]) {{ .name = "default", .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.request_frame = request_frame, .request_frame = request_frame,
.config_props = rgbtest_config_props, }, .config_props = rgbtest_config_props, },
{ .name = NULL }}, { .name = NULL }},
}; };
#endif /* CONFIG_RGBTESTSRC_FILTER */ #endif /* CONFIG_RGBTESTSRC_FILTER */

View File

@ -24,10 +24,11 @@
* G.723.1 demuxer * G.723.1 demuxer
*/ */
#include "libavutil/audioconvert.h"
#include "avformat.h" #include "avformat.h"
#include "internal.h" #include "internal.h"
static const uint8_t frame_size[4] = {24, 20, 4, 1}; static const uint8_t frame_size[4] = { 24, 20, 4, 1 };
static int g723_1_init(AVFormatContext *s) static int g723_1_init(AVFormatContext *s)
{ {
@ -37,12 +38,14 @@ static int g723_1_init(AVFormatContext *s)
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
st->codec->codec_id = CODEC_ID_G723_1; st->codec->codec_id = CODEC_ID_G723_1;
st->codec->channels = 1; st->codec->channel_layout = AV_CH_LAYOUT_MONO;
st->codec->sample_rate = 8000; st->codec->channels = 1;
st->codec->sample_rate = 8000;
avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate); avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
st->start_time = 0;
return 0; return 0;
} }
@ -77,6 +80,6 @@ AVInputFormat ff_g723_1_demuxer = {
.long_name = NULL_IF_CONFIG_SMALL("G.723.1 format"), .long_name = NULL_IF_CONFIG_SMALL("G.723.1 format"),
.read_header = g723_1_init, .read_header = g723_1_init,
.read_packet = g723_1_read_packet, .read_packet = g723_1_read_packet,
.extensions = "tco,rco,g723_1", .extensions = "tco,rco,g723_1",
.flags = AVFMT_GENERIC_INDEX .flags = AVFMT_GENERIC_INDEX
}; };

View File

@ -30,7 +30,7 @@
#include "libavutil/avutil.h" #include "libavutil/avutil.h"
#define LIBAVFORMAT_VERSION_MAJOR 54 #define LIBAVFORMAT_VERSION_MAJOR 54
#define LIBAVFORMAT_VERSION_MINOR 18 #define LIBAVFORMAT_VERSION_MINOR 19
#define LIBAVFORMAT_VERSION_MICRO 100 #define LIBAVFORMAT_VERSION_MICRO 100
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \