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

Merge remote-tracking branch 'qatar/master'

* qatar/master: (22 commits)
  rv40dsp x86: use only one register, for both increment and loop counter
  rv40dsp: implement prescaled versions for biweight.
  avconv: use default channel layouts when they are unknown
  avconv: parse channel layout string
  nutdec: K&R formatting cosmetics
  vda: Signal 4 byte NAL headers to the decoder regardless of what's in the extradata
  mem: Consistently return NULL for av_malloc(0)
  vf_overlay: implement poll_frame()
  vf_scale: support named constants for sws flags.
  lavc doxy: add all installed headers to doxy groups.
  lavc doxy: add avfft to the main lavc group.
  lavc doxy: add remaining avcodec.h functions to a misc doxygen group.
  lavc doxy: add AVPicture functions to a doxy group.
  lavc doxy: add resampling functions to a doxy group.
  lavc doxy: replace \ with /
  lavc doxy: add encoding functions to a doxy group.
  lavc doxy: add decoding functions to a doxy group.
  lavc doxy: fix formatting of AV_PKT_DATA_{PARAM_CHANGE,H263_MB_INFO}
  lavc doxy: add AVPacket-related stuff to a separate doxy group.
  lavc doxy: add core functions/definitions to a doxy group.
  ...

Conflicts:
	ffmpeg.c
	libavcodec/avcodec.h
	libavcodec/vda.c
	libavcodec/x86/rv40dsp.asm
	libavfilter/vf_scale.c
	libavformat/nutdec.c
	libavutil/mem.c
	tests/ref/acodec/pcm_s24daud

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-04-10 22:06:53 +02:00
commit e387c9d5dd
28 changed files with 1784 additions and 1337 deletions

View File

@ -1282,7 +1282,7 @@ static void do_audio_out(AVFormatContext *s, OutputStream *ost,
swr_set_compensation(ost->swr, comp, enc->sample_rate); swr_set_compensation(ost->swr, comp, enc->sample_rate);
} }
} }
} else } else if (audio_sync_method == 0)
ost->sync_opts = lrintf(get_sync_ipts(ost, ist->pts) * enc->sample_rate) - ost->sync_opts = lrintf(get_sync_ipts(ost, ist->pts) * enc->sample_rate) -
av_fifo_size(ost->fifo) / (enc->channels * osize); // FIXME wrong av_fifo_size(ost->fifo) / (enc->channels * osize); // FIXME wrong
@ -2328,10 +2328,57 @@ static void print_sdp(OutputFile *output_files, int n)
av_freep(&avc); av_freep(&avc);
} }
static void get_default_channel_layouts(OutputStream *ost, InputStream *ist)
{
char layout_name[256];
AVCodecContext *enc = ost->st->codec;
AVCodecContext *dec = ist->st->codec;
if (!dec->channel_layout) {
if (enc->channel_layout && dec->channels == enc->channels) {
dec->channel_layout = enc->channel_layout;
} else {
dec->channel_layout = av_get_default_channel_layout(dec->channels);
if (!dec->channel_layout) {
av_log(NULL, AV_LOG_FATAL, "Unable to find default channel "
"layout for Input Stream #%d.%d\n", ist->file_index,
ist->st->index);
exit_program(1);
}
}
av_get_channel_layout_string(layout_name, sizeof(layout_name),
dec->channels, dec->channel_layout);
av_log(NULL, AV_LOG_WARNING, "Guessed Channel Layout for Input Stream "
"#%d.%d : %s\n", ist->file_index, ist->st->index, layout_name);
}
if (!enc->channel_layout) {
if (dec->channels == enc->channels) {
enc->channel_layout = dec->channel_layout;
return;
} else {
enc->channel_layout = av_get_default_channel_layout(enc->channels);
}
if (!enc->channel_layout) {
av_log(NULL, AV_LOG_FATAL, "Unable to find default channel layout "
"for Output Stream #%d.%d\n", ost->file_index,
ost->st->index);
exit_program(1);
}
av_get_channel_layout_string(layout_name, sizeof(layout_name),
enc->channels, enc->channel_layout);
av_log(NULL, AV_LOG_WARNING, "Guessed Channel Layout for Output Stream "
"#%d.%d : %s\n", ost->file_index, ost->st->index, layout_name);
}
}
static int init_input_stream(int ist_index, OutputStream *output_streams, int nb_output_streams, static int init_input_stream(int ist_index, OutputStream *output_streams, int nb_output_streams,
char *error, int error_len) char *error, int error_len)
{ {
InputStream *ist = &input_streams[ist_index]; InputStream *ist = &input_streams[ist_index];
int i;
if (ist->decoding_needed) { if (ist->decoding_needed) {
AVCodec *codec = ist->dec; AVCodec *codec = ist->dec;
if (!codec) { if (!codec) {
@ -2356,6 +2403,17 @@ static int init_input_stream(int ist_index, OutputStream *output_streams, int nb
} }
assert_codec_experimental(ist->st->codec, 0); assert_codec_experimental(ist->st->codec, 0);
assert_avoptions(ist->opts); assert_avoptions(ist->opts);
if (ist->st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
for (i = 0; i < nb_output_streams; i++) {
OutputStream *ost = &output_streams[i];
if (ost->source_index == ist_index) {
if (!ist->st->codec->channel_layout || !ost->st->codec->channel_layout)
get_default_channel_layouts(ost, ist);
break;
}
}
}
} }
ist->dts = ist->st->avg_frame_rate.num ? - ist->st->codec->has_b_frames * AV_TIME_BASE / av_q2d(ist->st->avg_frame_rate) : 0; ist->dts = ist->st->avg_frame_rate.num ? - ist->st->codec->has_b_frames * AV_TIME_BASE / av_q2d(ist->st->avg_frame_rate) : 0;
@ -4943,6 +5001,41 @@ static void parse_cpuflags(int argc, char **argv, const OptionDef *options)
opt_cpuflags("cpuflags", argv[idx + 1]); opt_cpuflags("cpuflags", argv[idx + 1]);
} }
static int opt_channel_layout(OptionsContext *o, const char *opt, const char *arg)
{
char layout_str[32];
char *stream_str;
char *ac_str;
int ret, channels, ac_str_size;
uint64_t layout;
layout = av_get_channel_layout(arg);
if (!layout) {
av_log(NULL, AV_LOG_ERROR, "Unknown channel layout: %s\n", arg);
return AVERROR(EINVAL);
}
snprintf(layout_str, sizeof(layout_str), "%"PRIu64, layout);
ret = opt_default(opt, layout_str);
if (ret < 0)
return ret;
/* set 'ac' option based on channel layout */
channels = av_get_channel_layout_nb_channels(layout);
snprintf(layout_str, sizeof(layout_str), "%d", channels);
stream_str = strchr(opt, ':');
ac_str_size = 3 + (stream_str ? strlen(stream_str) : 0);
ac_str = av_mallocz(ac_str_size);
if (!ac_str)
return AVERROR(ENOMEM);
av_strlcpy(ac_str, "ac", 3);
if (stream_str)
av_strlcat(ac_str, stream_str, ac_str_size);
ret = parse_option(o, ac_str, layout_str, options);
av_free(ac_str);
return ret;
}
#define OFFSET(x) offsetof(OptionsContext, x) #define OFFSET(x) offsetof(OptionsContext, x)
static const OptionDef options[] = { static const OptionDef options[] = {
/* main options */ /* main options */
@ -5051,6 +5144,7 @@ static const OptionDef options[] = {
{ "vol", OPT_INT | HAS_ARG | OPT_AUDIO, {(void*)&audio_volume}, "change audio volume (256=normal)" , "volume" }, // { "vol", OPT_INT | HAS_ARG | OPT_AUDIO, {(void*)&audio_volume}, "change audio volume (256=normal)" , "volume" }, //
{ "sample_fmt", HAS_ARG | OPT_EXPERT | OPT_AUDIO | OPT_SPEC | OPT_STRING, {.off = OFFSET(sample_fmts)}, "set sample format", "format" }, { "sample_fmt", HAS_ARG | OPT_EXPERT | OPT_AUDIO | OPT_SPEC | OPT_STRING, {.off = OFFSET(sample_fmts)}, "set sample format", "format" },
{ "rmvol", HAS_ARG | OPT_AUDIO | OPT_FLOAT | OPT_SPEC, {.off = OFFSET(rematrix_volume)}, "rematrix volume (as factor)", "volume" }, { "rmvol", HAS_ARG | OPT_AUDIO | OPT_FLOAT | OPT_SPEC, {.off = OFFSET(rematrix_volume)}, "rematrix volume (as factor)", "volume" },
{ "channel_layout", HAS_ARG | OPT_EXPERT | OPT_AUDIO | OPT_FUNC2, {(void*)opt_channel_layout}, "set channel layout", "layout" },
/* subtitle options */ /* subtitle options */
{ "sn", OPT_BOOL | OPT_SUBTITLE | OPT_OFFSET, {.off = OFFSET(subtitle_disable)}, "disable subtitle" }, { "sn", OPT_BOOL | OPT_SUBTITLE | OPT_OFFSET, {.off = OFFSET(subtitle_disable)}, "disable subtitle" },

View File

@ -128,8 +128,8 @@ void ff_rv40dsp_init_neon(RV34DSPContext *c, DSPContext* dsp)
c->avg_chroma_pixels_tab[0] = ff_avg_rv40_chroma_mc8_neon; c->avg_chroma_pixels_tab[0] = ff_avg_rv40_chroma_mc8_neon;
c->avg_chroma_pixels_tab[1] = ff_avg_rv40_chroma_mc4_neon; c->avg_chroma_pixels_tab[1] = ff_avg_rv40_chroma_mc4_neon;
c->rv40_weight_pixels_tab[0] = ff_rv40_weight_func_16_neon; c->rv40_weight_pixels_tab[0][0] = ff_rv40_weight_func_16_neon;
c->rv40_weight_pixels_tab[1] = ff_rv40_weight_func_8_neon; c->rv40_weight_pixels_tab[0][1] = ff_rv40_weight_func_8_neon;
c->rv40_loop_filter_strength[0] = ff_rv40_h_loop_filter_strength_neon; c->rv40_loop_filter_strength[0] = ff_rv40_h_loop_filter_strength_neon;
c->rv40_loop_filter_strength[1] = ff_rv40_v_loop_filter_strength_neon; c->rv40_loop_filter_strength[1] = ff_rv40_v_loop_filter_strength_neon;

File diff suppressed because it is too large Load Diff

View File

@ -19,6 +19,19 @@
#ifndef AVCODEC_AVFFT_H #ifndef AVCODEC_AVFFT_H
#define AVCODEC_AVFFT_H #define AVCODEC_AVFFT_H
/**
* @file
* @ingroup lavc_fft
* FFT functions
*/
/**
* @defgroup lavc_fft FFT functions
* @ingroup lavc_misc
*
* @{
*/
typedef float FFTSample; typedef float FFTSample;
typedef struct FFTComplex { typedef struct FFTComplex {
@ -96,4 +109,8 @@ DCTContext *av_dct_init(int nbits, enum DCTTransformType type);
void av_dct_calc(DCTContext *s, FFTSample *data); void av_dct_calc(DCTContext *s, FFTSample *data);
void av_dct_end (DCTContext *s); void av_dct_end (DCTContext *s);
/**
* @}
*/
#endif /* AVCODEC_AVFFT_H */ #endif /* AVCODEC_AVFFT_H */

View File

@ -23,11 +23,24 @@
#ifndef AVCODEC_DXVA_H #ifndef AVCODEC_DXVA_H
#define AVCODEC_DXVA_H #define AVCODEC_DXVA_H
/**
* @file
* @ingroup lavc_codec_hwaccel_dxva2
* Public libavcodec DXVA2 header.
*/
#include <stdint.h> #include <stdint.h>
#include <d3d9.h> #include <d3d9.h>
#include <dxva2api.h> #include <dxva2api.h>
/**
* @defgroup lavc_codec_hwaccel_dxva2 DXVA2
* @ingroup lavc_codec_hwaccel
*
* @{
*/
#define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for DXVA2 and old UVD/UVD+ ATI video cards #define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for DXVA2 and old UVD/UVD+ ATI video cards
/** /**
@ -68,4 +81,8 @@ struct dxva_context {
unsigned report_id; unsigned report_id;
}; };
/**
* @}
*/
#endif /* AVCODEC_DXVA_H */ #endif /* AVCODEC_DXVA_H */

View File

@ -48,7 +48,7 @@ void ff_gmc1_altivec(uint8_t *dst /* align 8 */, uint8_t *src /* align1 */, int
unsigned long dst_odd = (unsigned long)dst & 0x0000000F; unsigned long dst_odd = (unsigned long)dst & 0x0000000F;
unsigned long src_really_odd = (unsigned long)src & 0x0000000F; unsigned long src_really_odd = (unsigned long)src & 0x0000000F;
tempA = vec_ld(0, (unsigned short*)ABCD); tempA = vec_ld(0, (const unsigned short*)ABCD);
Av = vec_splat(tempA, 0); Av = vec_splat(tempA, 0);
Bv = vec_splat(tempA, 1); Bv = vec_splat(tempA, 1);
Cv = vec_splat(tempA, 2); Cv = vec_splat(tempA, 2);

View File

@ -79,7 +79,8 @@ static int ssd_int8_vs_int16_altivec(const int8_t *pix1, const int16_t *pix2,
return u.score[3]; return u.score[3];
} }
static int32_t scalarproduct_int16_altivec(const int16_t * v1, const int16_t * v2, int order, const int shift) static int32_t scalarproduct_int16_altivec(int16_t *v1, const int16_t *v2,
int order, const int shift)
{ {
int i; int i;
LOAD_ZERO; LOAD_ZERO;

View File

@ -521,7 +521,7 @@ static void rv34_pred_mv(RV34DecContext *r, int block_type, int subblock_no, int
*/ */
static int calc_add_mv(RV34DecContext *r, int dir, int val) static int calc_add_mv(RV34DecContext *r, int dir, int val)
{ {
int mul = dir ? -r->weight2 : r->weight1; int mul = dir ? -r->mv_weight2 : r->mv_weight1;
return (val * mul + 0x2000) >> 14; return (val * mul + 0x2000) >> 14;
} }
@ -776,19 +776,19 @@ static void rv34_mc_1mv(RV34DecContext *r, const int block_type,
static void rv4_weight(RV34DecContext *r) static void rv4_weight(RV34DecContext *r)
{ {
r->rdsp.rv40_weight_pixels_tab[0](r->s.dest[0], r->rdsp.rv40_weight_pixels_tab[r->scaled_weight][0](r->s.dest[0],
r->tmp_b_block_y[0], r->tmp_b_block_y[0],
r->tmp_b_block_y[1], r->tmp_b_block_y[1],
r->weight1, r->weight1,
r->weight2, r->weight2,
r->s.linesize); r->s.linesize);
r->rdsp.rv40_weight_pixels_tab[1](r->s.dest[1], r->rdsp.rv40_weight_pixels_tab[r->scaled_weight][1](r->s.dest[1],
r->tmp_b_block_uv[0], r->tmp_b_block_uv[0],
r->tmp_b_block_uv[2], r->tmp_b_block_uv[2],
r->weight1, r->weight1,
r->weight2, r->weight2,
r->s.uvlinesize); r->s.uvlinesize);
r->rdsp.rv40_weight_pixels_tab[1](r->s.dest[2], r->rdsp.rv40_weight_pixels_tab[r->scaled_weight][1](r->s.dest[2],
r->tmp_b_block_uv[1], r->tmp_b_block_uv[1],
r->tmp_b_block_uv[3], r->tmp_b_block_uv[3],
r->weight1, r->weight1,
@ -1708,10 +1708,20 @@ int ff_rv34_decode_frame(AVCodecContext *avctx,
int dist1 = GET_PTS_DIFF(r->next_pts, r->cur_pts); int dist1 = GET_PTS_DIFF(r->next_pts, r->cur_pts);
if(!refdist){ if(!refdist){
r->weight1 = r->weight2 = 8192; r->mv_weight1 = r->mv_weight2 = r->weight1 = r->weight2 = 8192;
r->scaled_weight = 0;
}else{ }else{
r->weight1 = (dist0 << 14) / refdist; r->mv_weight1 = (dist0 << 14) / refdist;
r->weight2 = (dist1 << 14) / refdist; r->mv_weight2 = (dist1 << 14) / refdist;
if((r->mv_weight1|r->mv_weight2) & 511){
r->weight1 = r->mv_weight1;
r->weight2 = r->mv_weight2;
r->scaled_weight = 0;
}else{
r->weight1 = r->mv_weight1 >> 9;
r->weight2 = r->mv_weight2 >> 9;
r->scaled_weight = 1;
}
} }
} }
s->mb_x = s->mb_y = 0; s->mb_x = s->mb_y = 0;

View File

@ -106,7 +106,9 @@ typedef struct RV34DecContext{
int rpr; ///< one field size in RV30 slice header int rpr; ///< one field size in RV30 slice header
int cur_pts, last_pts, next_pts; int cur_pts, last_pts, next_pts;
int scaled_weight;
int weight1, weight2; ///< B frame distance fractions (0.14) used in motion compensation int weight1, weight2; ///< B frame distance fractions (0.14) used in motion compensation
int mv_weight1, mv_weight2;
uint16_t *cbp_luma; ///< CBP values for luma subblocks uint16_t *cbp_luma; ///< CBP values for luma subblocks
uint8_t *cbp_chroma; ///< CBP values for chroma subblocks uint8_t *cbp_chroma; ///< CBP values for chroma subblocks

View File

@ -58,7 +58,12 @@ typedef struct RV34DSPContext {
qpel_mc_func avg_pixels_tab[4][16]; qpel_mc_func avg_pixels_tab[4][16];
h264_chroma_mc_func put_chroma_pixels_tab[3]; h264_chroma_mc_func put_chroma_pixels_tab[3];
h264_chroma_mc_func avg_chroma_pixels_tab[3]; h264_chroma_mc_func avg_chroma_pixels_tab[3];
rv40_weight_func rv40_weight_pixels_tab[2]; /**
* Biweight functions, first dimension is transform size (16/8),
* second is whether the weight is prescaled by 1/512 to skip
* the intermediate shifting.
*/
rv40_weight_func rv40_weight_pixels_tab[2][2];
rv34_inv_transform_func rv34_inv_transform; rv34_inv_transform_func rv34_inv_transform;
rv34_inv_transform_func rv34_inv_transform_dc; rv34_inv_transform_func rv34_inv_transform_dc;
rv34_idct_add_func rv34_idct_add; rv34_idct_add_func rv34_idct_add;

View File

@ -278,7 +278,7 @@ RV40_CHROMA_MC(put_, op_put)
RV40_CHROMA_MC(avg_, op_avg) RV40_CHROMA_MC(avg_, op_avg)
#define RV40_WEIGHT_FUNC(size) \ #define RV40_WEIGHT_FUNC(size) \
static void rv40_weight_func_ ## size (uint8_t *dst, uint8_t *src1, uint8_t *src2, int w1, int w2, ptrdiff_t stride)\ static void rv40_weight_func_rnd_ ## size (uint8_t *dst, uint8_t *src1, uint8_t *src2, int w1, int w2, ptrdiff_t stride)\
{\ {\
int i, j;\ int i, j;\
\ \
@ -289,6 +289,18 @@ static void rv40_weight_func_ ## size (uint8_t *dst, uint8_t *src1, uint8_t *src
src2 += stride;\ src2 += stride;\
dst += stride;\ dst += stride;\
}\ }\
}\
static void rv40_weight_func_nornd_ ## size (uint8_t *dst, uint8_t *src1, uint8_t *src2, int w1, int w2, ptrdiff_t stride)\
{\
int i, j;\
\
for (j = 0; j < size; j++) {\
for (i = 0; i < size; i++)\
dst[i] = (w2 * src1[i] + w1 * src2[i] + 0x10) >> 5;\
src1 += stride;\
src2 += stride;\
dst += stride;\
}\
} }
RV40_WEIGHT_FUNC(16) RV40_WEIGHT_FUNC(16)
@ -578,8 +590,10 @@ av_cold void ff_rv40dsp_init(RV34DSPContext *c, DSPContext* dsp) {
c->avg_chroma_pixels_tab[0] = avg_rv40_chroma_mc8_c; c->avg_chroma_pixels_tab[0] = avg_rv40_chroma_mc8_c;
c->avg_chroma_pixels_tab[1] = avg_rv40_chroma_mc4_c; c->avg_chroma_pixels_tab[1] = avg_rv40_chroma_mc4_c;
c->rv40_weight_pixels_tab[0] = rv40_weight_func_16; c->rv40_weight_pixels_tab[0][0] = rv40_weight_func_rnd_16;
c->rv40_weight_pixels_tab[1] = rv40_weight_func_8; c->rv40_weight_pixels_tab[0][1] = rv40_weight_func_rnd_8;
c->rv40_weight_pixels_tab[1][0] = rv40_weight_func_nornd_16;
c->rv40_weight_pixels_tab[1][1] = rv40_weight_func_nornd_8;
c->rv40_weak_loop_filter[0] = rv40_h_weak_loop_filter; c->rv40_weak_loop_filter[0] = rv40_h_weak_loop_filter;
c->rv40_weak_loop_filter[1] = rv40_v_weak_loop_filter; c->rv40_weak_loop_filter[1] = rv40_v_weak_loop_filter;

View File

@ -24,11 +24,17 @@
#ifndef AVCODEC_VAAPI_H #ifndef AVCODEC_VAAPI_H
#define AVCODEC_VAAPI_H #define AVCODEC_VAAPI_H
/**
* @file
* @ingroup lavc_codec_hwaccel_vaapi
* Public libavcodec VA API header.
*/
#include <stdint.h> #include <stdint.h>
/** /**
* @defgroup VAAPI_Decoding VA API Decoding * @defgroup lavc_codec_hwaccel_vaapi VA API Decoding
* @ingroup Decoder * @ingroup lavc_codec_hwaccel
* @{ * @{
*/ */

View File

@ -149,20 +149,55 @@ int ff_vda_create_decoder(struct vda_context *vda_ctx,
pthread_mutex_init(&vda_ctx->queue_mutex, NULL); pthread_mutex_init(&vda_ctx->queue_mutex, NULL);
<<<<<<< HEAD
if (extradata[4]==0xFE) { if (extradata[4]==0xFE) {
// convert 3 byte NAL sizes to 4 byte // convert 3 byte NAL sizes to 4 byte
extradata[4] = 0xFF; extradata[4] = 0xFF;
} }
||||||| merged common ancestors
=======
/* Each VCL NAL in the bistream sent to the decoder
* is preceeded by a 4 bytes length header.
* Change the avcC atom header if needed, to signal headers of 4 bytes. */
if (extradata_size >= 4 && (extradata[4] & 0x03) != 0x03) {
uint8_t *rw_extradata;
if (!(rw_extradata = av_malloc(extradata_size)))
return AVERROR(ENOMEM);
memcpy(rw_extradata, extradata, extradata_size);
rw_extradata[4] |= 0x03;
avc_data = CFDataCreate(kCFAllocatorDefault, rw_extradata, extradata_size);
av_freep(&rw_extradata);
} else {
avc_data = CFDataCreate(kCFAllocatorDefault, extradata, extradata_size);
}
>>>>>>> qatar/master
config_info = CFDictionaryCreateMutable(kCFAllocatorDefault, config_info = CFDictionaryCreateMutable(kCFAllocatorDefault,
4, 4,
&kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks); &kCFTypeDictionaryValueCallBacks);
<<<<<<< HEAD
height = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &vda_ctx->height); height = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &vda_ctx->height);
width = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &vda_ctx->width); width = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &vda_ctx->width);
format = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &vda_ctx->format); format = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &vda_ctx->format);
avc_data = CFDataCreate(kCFAllocatorDefault, extradata, extradata_size); avc_data = CFDataCreate(kCFAllocatorDefault, extradata, extradata_size);
||||||| merged common ancestors
height = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &vda_ctx->height);
width = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &vda_ctx->width);
format = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &vda_ctx->format);
avc_data = CFDataCreate(kCFAllocatorDefault, extradata, extradata_size);
=======
height = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &vda_ctx->height);
width = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &vda_ctx->width);
format = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &vda_ctx->format);
>>>>>>> qatar/master
CFDictionarySetValue(config_info, kVDADecoderConfiguration_Height, height); CFDictionarySetValue(config_info, kVDADecoderConfiguration_Height, height);
CFDictionarySetValue(config_info, kVDADecoderConfiguration_Width, width); CFDictionarySetValue(config_info, kVDADecoderConfiguration_Width, width);

View File

@ -23,6 +23,12 @@
#ifndef AVCODEC_VDA_H #ifndef AVCODEC_VDA_H
#define AVCODEC_VDA_H #define AVCODEC_VDA_H
/**
* @file
* @ingroup lavc_codec_hwaccel_vda
* Public libavcodec VDA header.
*/
#include <pthread.h> #include <pthread.h>
#include <stdint.h> #include <stdint.h>
@ -34,6 +40,13 @@
#include <VideoDecodeAcceleration/VDADecoder.h> #include <VideoDecodeAcceleration/VDADecoder.h>
#undef Picture #undef Picture
/**
* @defgroup lavc_codec_hwaccel_vda VDA
* @ingroup lavc_codec_hwaccel
*
* @{
*/
/** /**
* This structure is used to store a decoded frame information and data. * This structure is used to store a decoded frame information and data.
*/ */
@ -165,4 +178,8 @@ vda_frame *ff_vda_queue_pop(struct vda_context *vda_ctx);
/** Release the given frame. */ /** Release the given frame. */
void ff_vda_release_vda_frame(vda_frame *frame); void ff_vda_release_vda_frame(vda_frame *frame);
/**
* @}
*/
#endif /* AVCODEC_VDA_H */ #endif /* AVCODEC_VDA_H */

View File

@ -25,7 +25,15 @@
#define AVCODEC_VDPAU_H #define AVCODEC_VDPAU_H
/** /**
* @defgroup Decoder VDPAU Decoder and Renderer * @file
* @ingroup lavc_codec_hwaccel_vdpau
* Public libavcodec VDPAU header.
*/
/**
* @defgroup lavc_codec_hwaccel_vdpau VDPAU Decoder and Renderer
* @ingroup lavc_codec_hwaccel
* *
* VDPAU hardware acceleration has two modules * VDPAU hardware acceleration has two modules
* - VDPAU decoding * - VDPAU decoding
@ -38,8 +46,6 @@
* and rendering (API calls) are done as part of the VDPAU * and rendering (API calls) are done as part of the VDPAU
* presentation (vo_vdpau.c) module. * presentation (vo_vdpau.c) module.
* *
* @defgroup VDPAU_Decoding VDPAU Decoding
* @ingroup Decoder
* @{ * @{
*/ */

View File

@ -20,6 +20,12 @@
#ifndef AVCODEC_VERSION_H #ifndef AVCODEC_VERSION_H
#define AVCODEC_VERSION_H #define AVCODEC_VERSION_H
/**
* @file
* @ingroup libavc
* Libavcodec version macros.
*/
#define LIBAVCODEC_VERSION_MAJOR 54 #define LIBAVCODEC_VERSION_MAJOR 54
#define LIBAVCODEC_VERSION_MINOR 14 #define LIBAVCODEC_VERSION_MINOR 14
#define LIBAVCODEC_VERSION_MICRO 101 #define LIBAVCODEC_VERSION_MICRO 101

View File

@ -32,13 +32,14 @@ SECTION .text
; %1=5bits weights?, %2=dst %3=src1 %4=src3 %5=stride if sse2 ; %1=5bits weights?, %2=dst %3=src1 %4=src3 %5=stride if sse2
%macro RV40_WCORE 4-5 %macro RV40_WCORE 4-5
movh m4, [%3 + 0] movh m4, [%3 + r6 + 0]
movh m5, [%4 + 0] movh m5, [%4 + r6 + 0]
%if %0 == 4 %if %0 == 4
%define OFFSET mmsize / 2 %define OFFSET r6 + mmsize / 2
%else %else
; 8x8 block and sse2, stride was provided ; 8x8 block and sse2, stride was provided
%define OFFSET %5 %define OFFSET r6
add r6, r5
%endif %endif
movh m6, [%3 + OFFSET] movh m6, [%3 + OFFSET]
movh m7, [%4 + OFFSET] movh m7, [%4 + OFFSET]
@ -99,10 +100,12 @@ SECTION .text
packuswb m4, m6 packuswb m4, m6
%if %0 == 5 %if %0 == 5
; Only called for 8x8 blocks and sse2 ; Only called for 8x8 blocks and sse2
movh [%2 + 0], m4 sub r6, r5
movhps [%2 + %5], m4 movh [%2 + r6], m4
add r6, r5
movhps [%2 + r6], m4
%else %else
mova [%2], m4 mova [%2 + r6], m4
%endif %endif
%endmacro %endmacro
@ -115,93 +118,79 @@ SECTION .text
%endif %endif
; Prepare for next loop ; Prepare for next loop
add r0, r5 add r6, r5
add r1, r5
add r2, r5
%else %else
%ifidn %1, 8 %ifidn %1, 8
RV40_WCORE %2, r0, r1, r2, r5 RV40_WCORE %2, r0, r1, r2, r5
; Prepare 2 next lines ; Prepare 2 next lines
lea r0, [r0 + 2 * r5] add r6, r5
lea r1, [r1 + 2 * r5]
lea r2, [r2 + 2 * r5]
%else %else
RV40_WCORE %2, r0, r1, r2 RV40_WCORE %2, r0, r1, r2
; Prepare single next line ; Prepare single next line
add r0, r5 add r6, r5
add r1, r5
add r2, r5
%endif %endif
%endif %endif
dec r6
%endmacro %endmacro
; rv40_weight_func_%1(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w1, int w2, int stride) ; rv40_weight_func_%1(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w1, int w2, int stride)
; %1=size %2=num of xmm regs ; %1=size %2=num of xmm regs
%macro RV40_WEIGHT 2 ; The weights are FP0.14 notation of fractions depending on pts.
cglobal rv40_weight_func_%1, 6, 7, %2 ; For timebases without rounding error (i.e. PAL), the fractions
; can be simplified, and several operations can be avoided.
; Therefore, we check here whether they are multiples of 2^9 for
; those simplifications to occur.
%macro RV40_WEIGHT 3
cglobal rv40_weight_func_%1_%2, 6, 7, 8
%if cpuflag(ssse3) %if cpuflag(ssse3)
mova m1, [shift_round] mova m1, [shift_round]
%else %else
mova m1, [pw_16] mova m1, [pw_16]
%endif %endif
pxor m0, m0 pxor m0, m0
mov r6, r3
or r6, r4
; The weights are FP0.14 notation of fractions depending on pts.
; For timebases without rounding error (i.e. PAL), the fractions
; can be simplified, and several operations can be avoided.
; Therefore, we check here whether they are multiples of 2^9 for
; those simplifications to occur.
and r6, 0x1FF
; Set loop counter and increments ; Set loop counter and increments
%if mmsize == 8 mov r6, r5
mov r6, %1 shl r6, %3
%else add r0, r6
mov r6, (%1 * %1) / mmsize add r1, r6
%endif add r2, r6
neg r6
; Use result of test now
jz .loop_512
movd m2, r3d movd m2, r3d
movd m3, r4d movd m3, r4d
%ifidn %1,rnd
%define RND 0
SPLATW m2, m2 SPLATW m2, m2
%else
%define RND 1
%if cpuflag(ssse3)
punpcklbw m3, m2
%else
SPLATW m2, m2
%endif
%endif
SPLATW m3, m3 SPLATW m3, m3
.loop: .loop:
MAIN_LOOP %1, 0 MAIN_LOOP %2, RND
jnz .loop jnz .loop
REP_RET REP_RET
; Weights are multiple of 512, which allows some shortcuts
.loop_512:
sar r3, 9
sar r4, 9
movd m2, r3d
movd m3, r4d
%if cpuflag(ssse3)
punpcklbw m3, m2
SPLATW m3, m3
%else
SPLATW m2, m2
SPLATW m3, m3
%endif
.loop2:
MAIN_LOOP %1, 1
jnz .loop2
REP_RET
%endmacro %endmacro
INIT_MMX mmx INIT_MMX mmx
RV40_WEIGHT 8, 0 RV40_WEIGHT rnd, 8, 3
RV40_WEIGHT 16, 0 RV40_WEIGHT rnd, 16, 4
RV40_WEIGHT nornd, 8, 3
RV40_WEIGHT nornd, 16, 4
INIT_XMM sse2 INIT_XMM sse2
RV40_WEIGHT 8, 8 RV40_WEIGHT rnd, 8, 3
RV40_WEIGHT 16, 8 RV40_WEIGHT rnd, 16, 4
RV40_WEIGHT nornd, 8, 3
RV40_WEIGHT nornd, 16, 4
INIT_XMM ssse3 INIT_XMM ssse3
RV40_WEIGHT 8, 8 RV40_WEIGHT rnd, 8, 3
RV40_WEIGHT 16, 8 RV40_WEIGHT rnd, 16, 4
RV40_WEIGHT nornd, 8, 3
RV40_WEIGHT nornd, 16, 4

View File

@ -41,9 +41,13 @@ void ff_avg_rv40_chroma_mc4_3dnow(uint8_t *dst, uint8_t *src,
int stride, int h, int x, int y); int stride, int h, int x, int y);
#define DECLARE_WEIGHT(opt) \ #define DECLARE_WEIGHT(opt) \
void ff_rv40_weight_func_16_##opt(uint8_t *dst, uint8_t *src1, uint8_t *src2, \ void ff_rv40_weight_func_rnd_16_##opt(uint8_t *dst, uint8_t *src1, uint8_t *src2, \
int w1, int w2, ptrdiff_t stride); \ int w1, int w2, ptrdiff_t stride); \
void ff_rv40_weight_func_8_##opt (uint8_t *dst, uint8_t *src1, uint8_t *src2, \ void ff_rv40_weight_func_rnd_8_##opt (uint8_t *dst, uint8_t *src1, uint8_t *src2, \
int w1, int w2, ptrdiff_t stride); \
void ff_rv40_weight_func_nornd_16_##opt(uint8_t *dst, uint8_t *src1, uint8_t *src2, \
int w1, int w2, ptrdiff_t stride); \
void ff_rv40_weight_func_nornd_8_##opt (uint8_t *dst, uint8_t *src1, uint8_t *src2, \
int w1, int w2, ptrdiff_t stride); int w1, int w2, ptrdiff_t stride);
DECLARE_WEIGHT(mmx) DECLARE_WEIGHT(mmx)
DECLARE_WEIGHT(sse2) DECLARE_WEIGHT(sse2)
@ -57,8 +61,10 @@ void ff_rv40dsp_init_x86(RV34DSPContext *c, DSPContext *dsp)
if (mm_flags & AV_CPU_FLAG_MMX) { if (mm_flags & AV_CPU_FLAG_MMX) {
c->put_chroma_pixels_tab[0] = ff_put_rv40_chroma_mc8_mmx; c->put_chroma_pixels_tab[0] = ff_put_rv40_chroma_mc8_mmx;
c->put_chroma_pixels_tab[1] = ff_put_rv40_chroma_mc4_mmx; c->put_chroma_pixels_tab[1] = ff_put_rv40_chroma_mc4_mmx;
c->rv40_weight_pixels_tab[0] = ff_rv40_weight_func_16_mmx; c->rv40_weight_pixels_tab[0][0] = ff_rv40_weight_func_rnd_16_mmx;
c->rv40_weight_pixels_tab[1] = ff_rv40_weight_func_8_mmx; c->rv40_weight_pixels_tab[0][1] = ff_rv40_weight_func_rnd_8_mmx;
c->rv40_weight_pixels_tab[1][0] = ff_rv40_weight_func_nornd_16_mmx;
c->rv40_weight_pixels_tab[1][1] = ff_rv40_weight_func_nornd_8_mmx;
} }
if (mm_flags & AV_CPU_FLAG_MMX2) { if (mm_flags & AV_CPU_FLAG_MMX2) {
c->avg_chroma_pixels_tab[0] = ff_avg_rv40_chroma_mc8_mmx2; c->avg_chroma_pixels_tab[0] = ff_avg_rv40_chroma_mc8_mmx2;
@ -68,12 +74,16 @@ void ff_rv40dsp_init_x86(RV34DSPContext *c, DSPContext *dsp)
c->avg_chroma_pixels_tab[1] = ff_avg_rv40_chroma_mc4_3dnow; c->avg_chroma_pixels_tab[1] = ff_avg_rv40_chroma_mc4_3dnow;
} }
if (mm_flags & AV_CPU_FLAG_SSE2) { if (mm_flags & AV_CPU_FLAG_SSE2) {
c->rv40_weight_pixels_tab[0] = ff_rv40_weight_func_16_sse2; c->rv40_weight_pixels_tab[0][0] = ff_rv40_weight_func_rnd_16_sse2;
c->rv40_weight_pixels_tab[1] = ff_rv40_weight_func_8_sse2; c->rv40_weight_pixels_tab[0][1] = ff_rv40_weight_func_rnd_8_sse2;
c->rv40_weight_pixels_tab[1][0] = ff_rv40_weight_func_nornd_16_sse2;
c->rv40_weight_pixels_tab[1][1] = ff_rv40_weight_func_nornd_8_sse2;
} }
if (mm_flags & AV_CPU_FLAG_SSSE3) { if (mm_flags & AV_CPU_FLAG_SSSE3) {
c->rv40_weight_pixels_tab[0] = ff_rv40_weight_func_16_ssse3; c->rv40_weight_pixels_tab[0][0] = ff_rv40_weight_func_rnd_16_ssse3;
c->rv40_weight_pixels_tab[1] = ff_rv40_weight_func_8_ssse3; c->rv40_weight_pixels_tab[0][1] = ff_rv40_weight_func_rnd_8_ssse3;
c->rv40_weight_pixels_tab[1][0] = ff_rv40_weight_func_nornd_16_ssse3;
c->rv40_weight_pixels_tab[1][1] = ff_rv40_weight_func_nornd_8_ssse3;
} }
#endif #endif
} }

View File

@ -21,10 +21,23 @@
#ifndef AVCODEC_XVMC_H #ifndef AVCODEC_XVMC_H
#define AVCODEC_XVMC_H #define AVCODEC_XVMC_H
/**
* @file
* @ingroup lavc_codec_hwaccel_xvmc
* Public libavcodec XvMC header.
*/
#include <X11/extensions/XvMC.h> #include <X11/extensions/XvMC.h>
#include "avcodec.h" #include "avcodec.h"
/**
* @defgroup lavc_codec_hwaccel_xvmc XvMC
* @ingroup lavc_codec_hwaccel
*
* @{
*/
#define AV_XVMC_ID 0x1DC711C0 /**< special value to ensure that regular pixel routines haven't corrupted the struct #define AV_XVMC_ID 0x1DC711C0 /**< special value to ensure that regular pixel routines haven't corrupted the struct
the number is 1337 speak for the letters IDCT MCo (motion compensation) */ the number is 1337 speak for the letters IDCT MCo (motion compensation) */
@ -148,4 +161,8 @@ struct xvmc_pix_fmt {
int next_free_data_block_num; int next_free_data_block_num;
}; };
/**
* @}
*/
#endif /* AVCODEC_XVMC_H */ #endif /* AVCODEC_XVMC_H */

View File

@ -510,6 +510,18 @@ static void null_draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir) {
static void null_end_frame(AVFilterLink *inlink) { } static void null_end_frame(AVFilterLink *inlink) { }
static int poll_frame(AVFilterLink *link)
{
AVFilterContext *s = link->src;
OverlayContext *over = s->priv;
int ret = avfilter_poll_frame(s->inputs[OVERLAY]);
if (ret == AVERROR_EOF)
ret = !!over->overpicref;
return ret && avfilter_poll_frame(s->inputs[MAIN]);
}
AVFilter avfilter_vf_overlay = { AVFilter avfilter_vf_overlay = {
.name = "overlay", .name = "overlay",
.description = NULL_IF_CONFIG_SMALL("Overlay a video source on top of the input."), .description = NULL_IF_CONFIG_SMALL("Overlay a video source on top of the input."),
@ -541,6 +553,7 @@ AVFilter avfilter_vf_overlay = {
{ .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,
.poll_frame = poll_frame },
{ .name = NULL}}, { .name = NULL}},
}; };

View File

@ -27,6 +27,7 @@
#include "libavutil/avstring.h" #include "libavutil/avstring.h"
#include "libavutil/eval.h" #include "libavutil/eval.h"
#include "libavutil/mathematics.h" #include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h" #include "libavutil/pixdesc.h"
#include "libavutil/imgutils.h" #include "libavutil/imgutils.h"
#include "libavutil/avassert.h" #include "libavutil/avassert.h"
@ -92,7 +93,15 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
if (args) { if (args) {
sscanf(args, "%255[^:]:%255[^:]", scale->w_expr, scale->h_expr); sscanf(args, "%255[^:]:%255[^:]", scale->w_expr, scale->h_expr);
p = strstr(args,"flags="); p = strstr(args,"flags=");
if (p) scale->flags = strtoul(p+6, NULL, 0); if (p) {
const AVClass *class = sws_get_class();
const AVOption *o = av_opt_find(&class, "sws_flags", NULL, 0,
AV_OPT_SEARCH_FAKE_OBJ);
int ret = av_opt_eval_flags(&class, o, p + 6, &scale->flags);
if (ret < 0)
return ret;
}
if(strstr(args,"interl=1")){ if(strstr(args,"interl=1")){
scale->interlaced=1; scale->interlaced=1;
}else if(strstr(args,"interl=-1")) }else if(strstr(args,"interl=-1"))

View File

@ -33,7 +33,8 @@
#define NUT_MAX_STREAMS 256 /* arbitrary sanity check value */ #define NUT_MAX_STREAMS 256 /* arbitrary sanity check value */
static int get_str(AVIOContext *bc, char *string, unsigned int maxlen){ static int get_str(AVIOContext *bc, char *string, unsigned int maxlen)
{
unsigned int len = ffio_read_varlen(bc); unsigned int len = ffio_read_varlen(bc);
if (len && maxlen) if (len && maxlen)
@ -52,40 +53,56 @@ static int get_str(AVIOContext *bc, char *string, unsigned int maxlen){
return 0; return 0;
} }
static int64_t get_s(AVIOContext *bc){ static int64_t get_s(AVIOContext *bc)
{
int64_t v = ffio_read_varlen(bc) + 1; int64_t v = ffio_read_varlen(bc) + 1;
if (v&1) return -(v>>1); if (v & 1)
else return (v>>1); return -(v >> 1);
else
return (v >> 1);
} }
static uint64_t get_fourcc(AVIOContext *bc){ static uint64_t get_fourcc(AVIOContext *bc)
{
unsigned int len = ffio_read_varlen(bc); unsigned int len = ffio_read_varlen(bc);
if (len==2) return avio_rl16(bc); if (len == 2)
else if(len==4) return avio_rl32(bc); return avio_rl16(bc);
else return -1; else if (len == 4)
return avio_rl32(bc);
else
return -1;
} }
#ifdef TRACE #ifdef TRACE
static inline uint64_t get_v_trace(AVIOContext *bc, char *file, char *func, int line){ static inline uint64_t get_v_trace(AVIOContext *bc, char *file,
char *func, int line)
{
uint64_t v = ffio_read_varlen(bc); uint64_t v = ffio_read_varlen(bc);
av_log(NULL, AV_LOG_DEBUG, "get_v %5"PRId64" / %"PRIX64" in %s %s:%d\n", v, v, file, func, line); av_log(NULL, AV_LOG_DEBUG, "get_v %5"PRId64" / %"PRIX64" in %s %s:%d\n",
v, v, file, func, line);
return v; return v;
} }
static inline int64_t get_s_trace(AVIOContext *bc, char *file, char *func, int line){ static inline int64_t get_s_trace(AVIOContext *bc, char *file,
char *func, int line)
{
int64_t v = get_s(bc); int64_t v = get_s(bc);
av_log(NULL, AV_LOG_DEBUG, "get_s %5"PRId64" / %"PRIX64" in %s %s:%d\n", v, v, file, func, line); av_log(NULL, AV_LOG_DEBUG, "get_s %5"PRId64" / %"PRIX64" in %s %s:%d\n",
v, v, file, func, line);
return v; return v;
} }
static inline uint64_t get_vb_trace(AVIOContext *bc, char *file, char *func, int line){ static inline uint64_t get_vb_trace(AVIOContext *bc, char *file,
char *func, int line)
{
uint64_t v = get_vb(bc); uint64_t v = get_vb(bc);
av_log(NULL, AV_LOG_DEBUG, "get_vb %5"PRId64" / %"PRIX64" in %s %s:%d\n", v, v, file, func, line); av_log(NULL, AV_LOG_DEBUG, "get_vb %5"PRId64" / %"PRIX64" in %s %s:%d\n",
v, v, file, func, line);
return v; return v;
} }
#define ffio_read_varlen(bc) get_v_trace(bc, __FILE__, __PRETTY_FUNCTION__, __LINE__) #define ffio_read_varlen(bc) get_v_trace(bc, __FILE__, __PRETTY_FUNCTION__, __LINE__)
@ -93,7 +110,8 @@ static inline uint64_t get_vb_trace(AVIOContext *bc, char *file, char *func, int
#define get_vb(bc) get_vb_trace(bc, __FILE__, __PRETTY_FUNCTION__, __LINE__) #define get_vb(bc) get_vb_trace(bc, __FILE__, __PRETTY_FUNCTION__, __LINE__)
#endif #endif
static int get_packetheader(NUTContext *nut, AVIOContext *bc, int calculate_checksum, uint64_t startcode) static int get_packetheader(NUTContext *nut, AVIOContext *bc,
int calculate_checksum, uint64_t startcode)
{ {
int64_t size; int64_t size;
// start = avio_tell(bc) - 8; // start = avio_tell(bc) - 8;
@ -113,12 +131,14 @@ static int get_packetheader(NUTContext *nut, AVIOContext *bc, int calculate_chec
return size; return size;
} }
static uint64_t find_any_startcode(AVIOContext *bc, int64_t pos){ static uint64_t find_any_startcode(AVIOContext *bc, int64_t pos)
{
uint64_t state = 0; uint64_t state = 0;
if (pos >= 0) if (pos >= 0)
avio_seek(bc, pos, SEEK_SET); //note, this may fail if the stream is not seekable, but that should not matter, as in this case we simply start where we currently are /* Note, this may fail if the stream is not seekable, but that should
* not matter, as in this case we simply start where we currently are */
avio_seek(bc, pos, SEEK_SET);
while (!url_feof(bc)) { while (!url_feof(bc)) {
state = (state << 8) | avio_r8(bc); state = (state << 8) | avio_r8(bc);
if ((state >> 56) != 'N') if ((state >> 56) != 'N')
@ -142,7 +162,8 @@ static uint64_t find_any_startcode(AVIOContext *bc, int64_t pos){
* @param pos the start position of the search, or -1 if the current position * @param pos the start position of the search, or -1 if the current position
* @return the position of the startcode or -1 if not found * @return the position of the startcode or -1 if not found
*/ */
static int64_t find_startcode(AVIOContext *bc, uint64_t code, int64_t pos){ static int64_t find_startcode(AVIOContext *bc, uint64_t code, int64_t pos)
{
for (;;) { for (;;) {
uint64_t startcode = find_any_startcode(bc, pos); uint64_t startcode = find_any_startcode(bc, pos);
if (startcode == code) if (startcode == code)
@ -153,7 +174,8 @@ static int64_t find_startcode(AVIOContext *bc, uint64_t code, int64_t pos){
} }
} }
static int nut_probe(AVProbeData *p){ static int nut_probe(AVProbeData *p)
{
int i; int i;
uint64_t code = 0; uint64_t code = 0;
@ -173,7 +195,8 @@ static int nut_probe(AVProbeData *p){
} \ } \
dst = tmp; dst = tmp;
static int skip_reserved(AVIOContext *bc, int64_t pos){ static int skip_reserved(AVIOContext *bc, int64_t pos)
{
pos -= avio_tell(bc); pos -= avio_tell(bc);
if (pos < 0) { if (pos < 0) {
avio_seek(bc, pos, SEEK_CUR); avio_seek(bc, pos, SEEK_CUR);
@ -185,12 +208,14 @@ static int skip_reserved(AVIOContext *bc, int64_t pos){
} }
} }
static int decode_main_header(NUTContext *nut){ static int decode_main_header(NUTContext *nut)
{
AVFormatContext *s = nut->avf; AVFormatContext *s = nut->avf;
AVIOContext *bc = s->pb; AVIOContext *bc = s->pb;
uint64_t tmp, end; uint64_t tmp, end;
unsigned int stream_count; unsigned int stream_count;
int i, j, tmp_stream, tmp_mul, tmp_pts, tmp_size, count, tmp_res, tmp_head_idx; int i, j, count;
int tmp_stream, tmp_mul, tmp_pts, tmp_size, tmp_res, tmp_head_idx;
end = get_packetheader(nut, bc, 1, MAIN_STARTCODE); end = get_packetheader(nut, bc, 1, MAIN_STARTCODE);
end += avio_tell(bc); end += avio_tell(bc);
@ -222,17 +247,29 @@ static int decode_main_header(NUTContext *nut){
for (i = 0; i < 256;) { for (i = 0; i < 256;) {
int tmp_flags = ffio_read_varlen(bc); int tmp_flags = ffio_read_varlen(bc);
int tmp_fields = ffio_read_varlen(bc); int tmp_fields = ffio_read_varlen(bc);
if(tmp_fields>0) tmp_pts = get_s(bc);
if(tmp_fields>1) tmp_mul = ffio_read_varlen(bc); if (tmp_fields > 0)
if(tmp_fields>2) tmp_stream= ffio_read_varlen(bc); tmp_pts = get_s(bc);
if(tmp_fields>3) tmp_size = ffio_read_varlen(bc); if (tmp_fields > 1)
else tmp_size = 0; tmp_mul = ffio_read_varlen(bc);
if(tmp_fields>4) tmp_res = ffio_read_varlen(bc); if (tmp_fields > 2)
else tmp_res = 0; tmp_stream = ffio_read_varlen(bc);
if(tmp_fields>5) count = ffio_read_varlen(bc); if (tmp_fields > 3)
else count = tmp_mul - tmp_size; tmp_size = ffio_read_varlen(bc);
if(tmp_fields>6) get_s(bc); else
if(tmp_fields>7) tmp_head_idx= ffio_read_varlen(bc); tmp_size = 0;
if (tmp_fields > 4)
tmp_res = ffio_read_varlen(bc);
else
tmp_res = 0;
if (tmp_fields > 5)
count = ffio_read_varlen(bc);
else
count = tmp_mul - tmp_size;
if (tmp_fields > 6)
get_s(bc);
if (tmp_fields > 7)
tmp_head_idx = ffio_read_varlen(bc);
while (tmp_fields-- > 8) while (tmp_fields-- > 8)
ffio_read_varlen(bc); ffio_read_varlen(bc);
@ -286,14 +323,14 @@ static int decode_main_header(NUTContext *nut){
} }
nut->stream = av_mallocz(sizeof(StreamContext) * stream_count); nut->stream = av_mallocz(sizeof(StreamContext) * stream_count);
for(i=0; i<stream_count; i++){ for (i = 0; i < stream_count; i++)
avformat_new_stream(s, NULL); avformat_new_stream(s, NULL);
}
return 0; return 0;
} }
static int decode_stream_header(NUTContext *nut){ static int decode_stream_header(NUTContext *nut)
{
AVFormatContext *s = nut->avf; AVFormatContext *s = nut->avf;
AVIOContext *bc = s->pb; AVIOContext *bc = s->pb;
StreamContext *stc; StreamContext *stc;
@ -306,7 +343,6 @@ static int decode_stream_header(NUTContext *nut){
GET_V(stream_id, tmp < s->nb_streams && !nut->stream[tmp].time_base); GET_V(stream_id, tmp < s->nb_streams && !nut->stream[tmp].time_base);
stc = &nut->stream[stream_id]; stc = &nut->stream[stream_id];
st = s->streams[stream_id]; st = s->streams[stream_id];
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
@ -314,12 +350,14 @@ static int decode_stream_header(NUTContext *nut){
class = ffio_read_varlen(bc); class = ffio_read_varlen(bc);
tmp = get_fourcc(bc); tmp = get_fourcc(bc);
st->codec->codec_tag = tmp; st->codec->codec_tag = tmp;
switch(class) switch (class) {
{
case 0: case 0:
st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
st->codec->codec_id = av_codec_get_id( st->codec->codec_id = av_codec_get_id((const AVCodecTag * const []) {
(const AVCodecTag * const []) { ff_codec_bmp_tags, ff_nut_video_tags, 0 }, ff_codec_bmp_tags,
ff_nut_video_tags,
0
},
tmp); tmp);
break; break;
case 1: case 1:
@ -338,7 +376,8 @@ static int decode_stream_header(NUTContext *nut){
return -1; return -1;
} }
if (class < 3 && st->codec->codec_id == CODEC_ID_NONE) if (class < 3 && st->codec->codec_id == CODEC_ID_NONE)
av_log(s, AV_LOG_ERROR, "Unknown codec tag '0x%04x' for stream number %d\n", av_log(s, AV_LOG_ERROR,
"Unknown codec tag '0x%04x' for stream number %d\n",
(unsigned int) tmp, stream_id); (unsigned int) tmp, stream_id);
GET_V(stc->time_base_id, tmp < nut->time_base_count); GET_V(stc->time_base_id, tmp < nut->time_base_count);
@ -350,7 +389,8 @@ static int decode_stream_header(NUTContext *nut){
GET_V(st->codec->extradata_size, tmp < (1 << 30)); GET_V(st->codec->extradata_size, tmp < (1 << 30));
if (st->codec->extradata_size) { if (st->codec->extradata_size) {
st->codec->extradata= av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE); st->codec->extradata = av_mallocz(st->codec->extradata_size +
FF_INPUT_BUFFER_PADDING_SIZE);
avio_read(bc, st->codec->extradata, st->codec->extradata_size); avio_read(bc, st->codec->extradata, st->codec->extradata_size);
} }
@ -360,7 +400,8 @@ static int decode_stream_header(NUTContext *nut){
st->sample_aspect_ratio.num = ffio_read_varlen(bc); st->sample_aspect_ratio.num = ffio_read_varlen(bc);
st->sample_aspect_ratio.den = ffio_read_varlen(bc); st->sample_aspect_ratio.den = ffio_read_varlen(bc);
if ((!st->sample_aspect_ratio.num) != (!st->sample_aspect_ratio.den)) { if ((!st->sample_aspect_ratio.num) != (!st->sample_aspect_ratio.den)) {
av_log(s, AV_LOG_ERROR, "invalid aspect ratio %d/%d\n", st->sample_aspect_ratio.num, st->sample_aspect_ratio.den); av_log(s, AV_LOG_ERROR, "invalid aspect ratio %d/%d\n",
st->sample_aspect_ratio.num, st->sample_aspect_ratio.den);
return -1; return -1;
} }
ffio_read_varlen(bc); /* csp type */ ffio_read_varlen(bc); /* csp type */
@ -370,20 +411,24 @@ static int decode_stream_header(NUTContext *nut){
GET_V(st->codec->channels, tmp > 0) GET_V(st->codec->channels, tmp > 0)
} }
if (skip_reserved(bc, end) || ffio_get_checksum(bc)) { if (skip_reserved(bc, end) || ffio_get_checksum(bc)) {
av_log(s, AV_LOG_ERROR, "stream header %d checksum mismatch\n", stream_id); av_log(s, AV_LOG_ERROR,
"stream header %d checksum mismatch\n", stream_id);
return -1; return -1;
} }
stc->time_base = &nut->time_base[stc->time_base_id]; stc->time_base = &nut->time_base[stc->time_base_id];
avpriv_set_pts_info(s->streams[stream_id], 63, stc->time_base->num, stc->time_base->den); avpriv_set_pts_info(s->streams[stream_id], 63, stc->time_base->num,
stc->time_base->den);
return 0; return 0;
} }
static void set_disposition_bits(AVFormatContext* avf, char* value, int stream_id){ static void set_disposition_bits(AVFormatContext *avf, char *value,
int stream_id)
{
int flag = 0, i; int flag = 0, i;
for (i=0; ff_nut_dispositions[i].flag; ++i) {
for (i = 0; ff_nut_dispositions[i].flag; ++i)
if (!strcmp(ff_nut_dispositions[i].str, value)) if (!strcmp(ff_nut_dispositions[i].str, value))
flag = ff_nut_dispositions[i].flag; flag = ff_nut_dispositions[i].flag;
}
if (!flag) if (!flag)
av_log(avf, AV_LOG_INFO, "unknown disposition type '%s'\n", value); av_log(avf, AV_LOG_INFO, "unknown disposition type '%s'\n", value);
for (i = 0; i < avf->nb_streams; ++i) for (i = 0; i < avf->nb_streams; ++i)
@ -391,7 +436,8 @@ static void set_disposition_bits(AVFormatContext* avf, char* value, int stream_i
avf->streams[i]->disposition |= flag; avf->streams[i]->disposition |= flag;
} }
static int decode_info_header(NUTContext *nut){ static int decode_info_header(NUTContext *nut)
{
AVFormatContext *s = nut->avf; AVFormatContext *s = nut->avf;
AVIOContext *bc = s->pb; AVIOContext *bc = s->pb;
uint64_t tmp, chapter_start, chapter_len; uint64_t tmp, chapter_start, chapter_len;
@ -416,7 +462,8 @@ static int decode_info_header(NUTContext *nut){
if (chapter_id && !stream_id_plus1) { if (chapter_id && !stream_id_plus1) {
int64_t start = chapter_start / nut->time_base_count; int64_t start = chapter_start / nut->time_base_count;
chapter = avpriv_new_chapter(s, chapter_id, chapter = avpriv_new_chapter(s, chapter_id,
nut->time_base[chapter_start % nut->time_base_count], nut->time_base[chapter_start %
nut->time_base_count],
start, start + chapter_len, NULL); start, start + chapter_len, NULL);
metadata = &chapter->metadata; metadata = &chapter->metadata;
} else if (stream_id_plus1) { } else if (stream_id_plus1) {
@ -458,8 +505,8 @@ static int decode_info_header(NUTContext *nut){
set_disposition_bits(s, str_value, stream_id_plus1 - 1); set_disposition_bits(s, str_value, stream_id_plus1 - 1);
continue; continue;
} }
if(metadata && av_strcasecmp(name,"Uses") if (metadata && av_strcasecmp(name, "Uses") &&
&& av_strcasecmp(name,"Depends") && av_strcasecmp(name,"Replaces")) av_strcasecmp(name, "Depends") && av_strcasecmp(name, "Replaces"))
av_dict_set(metadata, name, str_value, 0); av_dict_set(metadata, name, str_value, 0);
} }
} }
@ -471,7 +518,8 @@ static int decode_info_header(NUTContext *nut){
return 0; return 0;
} }
static int decode_syncpoint(NUTContext *nut, int64_t *ts, int64_t *back_ptr){ static int decode_syncpoint(NUTContext *nut, int64_t *ts, int64_t *back_ptr)
{
AVFormatContext *s = nut->avf; AVFormatContext *s = nut->avf;
AVIOContext *bc = s->pb; AVIOContext *bc = s->pb;
int64_t end, tmp; int64_t end, tmp;
@ -486,20 +534,23 @@ static int decode_syncpoint(NUTContext *nut, int64_t *ts, int64_t *back_ptr){
if (*back_ptr < 0) if (*back_ptr < 0)
return -1; return -1;
ff_nut_reset_ts(nut, nut->time_base[tmp % nut->time_base_count], tmp / nut->time_base_count); ff_nut_reset_ts(nut, nut->time_base[tmp % nut->time_base_count],
tmp / nut->time_base_count);
if (skip_reserved(bc, end) || ffio_get_checksum(bc)) { if (skip_reserved(bc, end) || ffio_get_checksum(bc)) {
av_log(s, AV_LOG_ERROR, "sync point checksum mismatch\n"); av_log(s, AV_LOG_ERROR, "sync point checksum mismatch\n");
return -1; return -1;
} }
*ts= tmp / s->nb_streams * av_q2d(nut->time_base[tmp % s->nb_streams])*AV_TIME_BASE; *ts = tmp / s->nb_streams *
av_q2d(nut->time_base[tmp % s->nb_streams]) * AV_TIME_BASE;
ff_nut_add_sp(nut, nut->last_syncpoint_pos, *back_ptr, *ts); ff_nut_add_sp(nut, nut->last_syncpoint_pos, *back_ptr, *ts);
return 0; return 0;
} }
static int find_and_decode_index(NUTContext *nut){ static int find_and_decode_index(NUTContext *nut)
{
AVFormatContext *s = nut->avf; AVFormatContext *s = nut->avf;
AVIOContext *bc = s->pb; AVIOContext *bc = s->pb;
uint64_t tmp, end; uint64_t tmp, end;
@ -572,13 +623,8 @@ static int find_and_decode_index(NUTContext *nut){
// eor_pts[j][i] = last_pts + A + B // eor_pts[j][i] = last_pts + A + B
} else } else
B = 0; B = 0;
av_add_index_entry( av_add_index_entry(s->streams[i], 16 * syncpoints[j - 1],
s->streams[i], last_pts + A, 0, 0, AVINDEX_KEYFRAME);
16*syncpoints[j-1],
last_pts + A,
0,
0,
AVINDEX_KEYFRAME);
last_pts += A + B; last_pts += A + B;
} }
} }
@ -590,6 +636,7 @@ static int find_and_decode_index(NUTContext *nut){
goto fail; goto fail;
} }
ret = 0; ret = 0;
fail: fail:
av_free(syncpoints); av_free(syncpoints);
av_free(has_keyframe); av_free(has_keyframe);
@ -660,7 +707,9 @@ static int nut_read_header(AVFormatContext *s)
return 0; return 0;
} }
static int decode_frame_header(NUTContext *nut, int64_t *pts, int *stream_id, uint8_t *header_idx, int frame_code){ static int decode_frame_header(NUTContext *nut, int64_t *pts, int *stream_id,
uint8_t *header_idx, int frame_code)
{
AVFormatContext *s = nut->avf; AVFormatContext *s = nut->avf;
AVIOContext *bc = s->pb; AVIOContext *bc = s->pb;
StreamContext *stc; StreamContext *stc;
@ -668,7 +717,9 @@ static int decode_frame_header(NUTContext *nut, int64_t *pts, int *stream_id, ui
uint64_t tmp; uint64_t tmp;
if (avio_tell(bc) > nut->last_syncpoint_pos + nut->max_distance) { if (avio_tell(bc) > nut->last_syncpoint_pos + nut->max_distance) {
av_log(s, AV_LOG_ERROR, "Last frame must have been damaged %"PRId64" > %"PRId64" + %d\n", avio_tell(bc), nut->last_syncpoint_pos, nut->max_distance); av_log(s, AV_LOG_ERROR,
"Last frame must have been damaged %"PRId64" > %"PRId64" + %d\n",
avio_tell(bc), nut->last_syncpoint_pos, nut->max_distance);
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
@ -697,9 +748,8 @@ static int decode_frame_header(NUTContext *nut, int64_t *pts, int *stream_id, ui
*pts = coded_pts - (1 << stc->msb_pts_shift); *pts = coded_pts - (1 << stc->msb_pts_shift);
} else } else
*pts = stc->last_pts + pts_delta; *pts = stc->last_pts + pts_delta;
if(flags&FLAG_SIZE_MSB){ if (flags & FLAG_SIZE_MSB)
size += size_mul * ffio_read_varlen(bc); size += size_mul * ffio_read_varlen(bc);
}
if (flags & FLAG_MATCH_TIME) if (flags & FLAG_MATCH_TIME)
get_s(bc); get_s(bc);
if (flags & FLAG_HEADER_IDX) if (flags & FLAG_HEADER_IDX)
@ -719,7 +769,8 @@ static int decode_frame_header(NUTContext *nut, int64_t *pts, int *stream_id, ui
if (flags & FLAG_CHECKSUM) { if (flags & FLAG_CHECKSUM) {
avio_rb32(bc); // FIXME check this avio_rb32(bc); // FIXME check this
}else if(size > 2*nut->max_distance || FFABS(stc->last_pts - *pts) > stc->max_pts_distance){ } else if (size > 2 * nut->max_distance || FFABS(stc->last_pts - *pts) >
stc->max_pts_distance) {
av_log(s, AV_LOG_ERROR, "frame size > 2max_distance and no checksum\n"); av_log(s, AV_LOG_ERROR, "frame size > 2max_distance and no checksum\n");
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
@ -730,7 +781,8 @@ static int decode_frame_header(NUTContext *nut, int64_t *pts, int *stream_id, ui
return size; return size;
} }
static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code){ static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code)
{
AVFormatContext *s = nut->avf; AVFormatContext *s = nut->avf;
AVIOContext *bc = s->pb; AVIOContext *bc = s->pb;
int size, stream_id, discard; int size, stream_id, discard;
@ -749,10 +801,11 @@ static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code){
discard = s->streams[stream_id]->discard; discard = s->streams[stream_id]->discard;
last_IP_pts = s->streams[stream_id]->last_IP_pts; last_IP_pts = s->streams[stream_id]->last_IP_pts;
if( (discard >= AVDISCARD_NONKEY && !(stc->last_flags & FLAG_KEY)) if ((discard >= AVDISCARD_NONKEY && !(stc->last_flags & FLAG_KEY)) ||
||(discard >= AVDISCARD_BIDIR && last_IP_pts != AV_NOPTS_VALUE && last_IP_pts > pts) (discard >= AVDISCARD_BIDIR && last_IP_pts != AV_NOPTS_VALUE &&
|| discard >= AVDISCARD_ALL last_IP_pts > pts) ||
|| stc->skip_until_key_frame){ discard >= AVDISCARD_ALL ||
stc->skip_until_key_frame) {
avio_skip(bc, size); avio_skip(bc, size);
return 1; return 1;
} }
@ -813,7 +866,7 @@ static int nut_read_packet(AVFormatContext *s, AVPacket *pkt)
ret = decode_frame(nut, pkt, frame_code); ret = decode_frame(nut, pkt, frame_code);
if (ret == 0) if (ret == 0)
return 0; return 0;
else if(ret==1) //ok but discard packet else if (ret == 1) // OK but discard packet
break; break;
default: default:
resync: resync:
@ -827,11 +880,14 @@ av_log(s, AV_LOG_DEBUG, "sync\n");
} }
} }
static int64_t nut_read_timestamp(AVFormatContext *s, int stream_index, int64_t *pos_arg, int64_t pos_limit){ static int64_t nut_read_timestamp(AVFormatContext *s, int stream_index,
int64_t *pos_arg, int64_t pos_limit)
{
NUTContext *nut = s->priv_data; NUTContext *nut = s->priv_data;
AVIOContext *bc = s->pb; AVIOContext *bc = s->pb;
int64_t pos, pts, back_ptr; int64_t pos, pts, back_ptr;
av_log(s, AV_LOG_DEBUG, "read_timestamp(X,%d,%"PRId64",%"PRId64")\n", stream_index, *pos_arg, pos_limit); av_log(s, AV_LOG_DEBUG, "read_timestamp(X,%d,%"PRId64",%"PRId64")\n",
stream_index, *pos_arg, pos_limit);
pos = *pos_arg; pos = *pos_arg;
do { do {
@ -846,13 +902,17 @@ av_log(s, AV_LOG_DEBUG, "read_timestamp(X,%d,%"PRId64",%"PRId64")\n", stream_ind
assert(nut->last_syncpoint_pos == *pos_arg); assert(nut->last_syncpoint_pos == *pos_arg);
av_log(s, AV_LOG_DEBUG, "return %"PRId64" %"PRId64"\n", pts, back_ptr); av_log(s, AV_LOG_DEBUG, "return %"PRId64" %"PRId64"\n", pts, back_ptr);
if (stream_index == -1) return pts; if (stream_index == -1)
else if(stream_index == -2) return back_ptr; return pts;
else if (stream_index == -2)
return back_ptr;
assert(0); assert(0);
} }
static int read_seek(AVFormatContext *s, int stream_index, int64_t pts, int flags){ static int read_seek(AVFormatContext *s, int stream_index,
int64_t pts, int flags)
{
NUTContext *nut = s->priv_data; NUTContext *nut = s->priv_data;
AVStream *st = s->streams[stream_index]; AVStream *st = s->streams[stream_index];
Syncpoint dummy = { .ts = pts * av_q2d(st->time_base) * AV_TIME_BASE }; Syncpoint dummy = { .ts = pts * av_q2d(st->time_base) * AV_TIME_BASE };
@ -871,18 +931,23 @@ static int read_seek(AVFormatContext *s, int stream_index, int64_t pts, int flag
} else { } else {
av_tree_find(nut->syncpoints, &dummy, (void *) ff_nut_sp_pts_cmp, av_tree_find(nut->syncpoints, &dummy, (void *) ff_nut_sp_pts_cmp,
(void **) next_node); (void **) next_node);
av_log(s, AV_LOG_DEBUG, "%"PRIu64"-%"PRIu64" %"PRId64"-%"PRId64"\n", next_node[0]->pos, next_node[1]->pos, av_log(s, AV_LOG_DEBUG, "%"PRIu64"-%"PRIu64" %"PRId64"-%"PRId64"\n",
next_node[0]->ts , next_node[1]->ts); next_node[0]->pos, next_node[1]->pos, next_node[0]->ts,
pos = ff_gen_search(s, -1, dummy.ts, next_node[0]->pos, next_node[1]->pos, next_node[1]->pos, next_node[1]->ts);
next_node[0]->ts , next_node[1]->ts, AVSEEK_FLAG_BACKWARD, &ts, nut_read_timestamp); pos = ff_gen_search(s, -1, dummy.ts, next_node[0]->pos,
next_node[1]->pos, next_node[1]->pos,
next_node[0]->ts, next_node[1]->ts,
AVSEEK_FLAG_BACKWARD, &ts, nut_read_timestamp);
if (!(flags & AVSEEK_FLAG_BACKWARD)) { if (!(flags & AVSEEK_FLAG_BACKWARD)) {
dummy.pos = pos + 16; dummy.pos = pos + 16;
next_node[1] = &nopts_sp; next_node[1] = &nopts_sp;
av_tree_find(nut->syncpoints, &dummy, (void *) ff_nut_sp_pos_cmp, av_tree_find(nut->syncpoints, &dummy, (void *) ff_nut_sp_pos_cmp,
(void **) next_node); (void **) next_node);
pos2 = ff_gen_search(s, -2, dummy.pos, next_node[0]->pos , next_node[1]->pos, next_node[1]->pos, pos2 = ff_gen_search(s, -2, dummy.pos, next_node[0]->pos,
next_node[0]->back_ptr, next_node[1]->back_ptr, flags, &ts, nut_read_timestamp); next_node[1]->pos, next_node[1]->pos,
next_node[0]->back_ptr, next_node[1]->back_ptr,
flags, &ts, nut_read_timestamp);
if (pos2 >= 0) if (pos2 >= 0)
pos = pos2; pos = pos2;
// FIXME dir but I think it does not matter // FIXME dir but I think it does not matter
@ -898,9 +963,8 @@ static int read_seek(AVFormatContext *s, int stream_index, int64_t pts, int flag
pos = find_startcode(s->pb, SYNCPOINT_STARTCODE, pos2); pos = find_startcode(s->pb, SYNCPOINT_STARTCODE, pos2);
avio_seek(s->pb, pos, SEEK_SET); avio_seek(s->pb, pos, SEEK_SET);
av_log(NULL, AV_LOG_DEBUG, "SP: %"PRId64"\n", pos); av_log(NULL, AV_LOG_DEBUG, "SP: %"PRId64"\n", pos);
if(pos2 > pos || pos2 + 15 < pos){ if (pos2 > pos || pos2 + 15 < pos)
av_log(NULL, AV_LOG_ERROR, "no syncpoint at backptr pos\n"); av_log(NULL, AV_LOG_ERROR, "no syncpoint at backptr pos\n");
}
for (i = 0; i < s->nb_streams; i++) for (i = 0; i < s->nb_streams; i++)
nut->stream[i].skip_until_key_frame = 1; nut->stream[i].skip_until_key_frame = 1;

View File

@ -1,4 +1,4 @@
46f44f86a18984a832206ab9e29a79f2 *./tests/data/acodec/pcm_f32le.wav 653d82a64b7bd96ac193e105e9f92d4c *./tests/data/acodec/pcm_f32le.wav
2116880 ./tests/data/acodec/pcm_f32le.wav 2116880 ./tests/data/acodec/pcm_f32le.wav
64151e4bcc2b717aa5a8454d424d6a1f *./tests/data/pcm_f32le.acodec.out.wav 64151e4bcc2b717aa5a8454d424d6a1f *./tests/data/pcm_f32le.acodec.out.wav
stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400 stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400

View File

@ -1,4 +1,4 @@
ba17c6d1a270e1333e981f239bf7eb45 *./tests/data/acodec/pcm_f64le.wav 48b4cd378f47a50dc902aa03cc8280ed *./tests/data/acodec/pcm_f64le.wav
4233680 ./tests/data/acodec/pcm_f64le.wav 4233680 ./tests/data/acodec/pcm_f64le.wav
64151e4bcc2b717aa5a8454d424d6a1f *./tests/data/pcm_f64le.acodec.out.wav 64151e4bcc2b717aa5a8454d424d6a1f *./tests/data/pcm_f64le.acodec.out.wav
stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400 stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400

View File

@ -1,4 +1,4 @@
1b75d5198ae789ab3c48f7024e08f4a9 *./tests/data/acodec/pcm_s24daud.302 1b75d5198ae789ab3c48f7024e08f4a9 *./tests/data/acodec/pcm_s24daud.302
10368730 ./tests/data/acodec/pcm_s24daud.302 10368730 ./tests/data/acodec/pcm_s24daud.302
4708f86529c594e29404603c64bb208c *./tests/data/pcm_s24daud.acodec.out.wav 70ec0ba6bc151ddc7509c09804d95d3b *./tests/data/pcm_s24daud.acodec.out.wav
stddev: 8967.92 PSNR: 17.28 MAXDIFF:42548 bytes: 6911796/ 1058400 stddev: 8967.92 PSNR: 17.28 MAXDIFF:42548 bytes: 6911796/ 1058400

View File

@ -1,4 +1,4 @@
a85380fb79b0d4fff38e24ac1e34bb94 *./tests/data/acodec/pcm_s24le.wav 18ea73985dbdf59e23f5aba66145e6fe *./tests/data/acodec/pcm_s24le.wav
1587668 ./tests/data/acodec/pcm_s24le.wav 1587668 ./tests/data/acodec/pcm_s24le.wav
64151e4bcc2b717aa5a8454d424d6a1f *./tests/data/pcm_s24le.acodec.out.wav 64151e4bcc2b717aa5a8454d424d6a1f *./tests/data/pcm_s24le.acodec.out.wav
stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400 stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400

View File

@ -1,4 +1,4 @@
da6ed80f4f40f0082577dea80827e014 *./tests/data/acodec/pcm_s32le.wav 8d8849fa5c5d91b9cb74f5c74e937faf *./tests/data/acodec/pcm_s32le.wav
2116868 ./tests/data/acodec/pcm_s32le.wav 2116868 ./tests/data/acodec/pcm_s32le.wav
64151e4bcc2b717aa5a8454d424d6a1f *./tests/data/pcm_s32le.acodec.out.wav 64151e4bcc2b717aa5a8454d424d6a1f *./tests/data/pcm_s32le.acodec.out.wav
stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400 stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400

View File

@ -1,3 +1,3 @@
df9ebf2812784a653d3337cf12c0c687 *./tests/data/lavf/lavf.caf 71e1abdfc59613fe05fca2939f02e02d *./tests/data/lavf/lavf.caf
90180 ./tests/data/lavf/lavf.caf 90204 ./tests/data/lavf/lavf.caf
./tests/data/lavf/lavf.caf CRC=0xf1ae5536 ./tests/data/lavf/lavf.caf CRC=0xf1ae5536