Merge remote-tracking branch 'qatar/master'

* qatar/master:
  mpc8: return more meaningful error codes.
  mpc: return more meaningful error codes.
  wv,mpc8: don't return apetag data in packets.
  rtmp: do not warn about receiving metadata packets
  x86: h264dsp: Adjust YASM #ifdefs
  x86: yadif: Mark mmxext optimizations as such
  h264: convert loop filter strength dsp function to yasm.
  Improve descriptiveness of a number of codec and container long names

Conflicts:
	libavcodec/flvdec.c
	libavcodec/libopenjpegdec.c
	libavformat/apetag.c
	libavformat/mp3dec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-07-31 22:41:00 +02:00
commit d1dad7c824
64 changed files with 301 additions and 257 deletions

View File

@ -2914,7 +2914,7 @@ AVCodec ff_aac_latm_decoder = {
.init = latm_decode_init,
.close = aac_decode_close,
.decode = latm_decode_frame,
.long_name = NULL_IF_CONFIG_SMALL("AAC LATM (Advanced Audio Codec LATM syntax)"),
.long_name = NULL_IF_CONFIG_SMALL("AAC LATM (Advanced Audio Coding LATM syntax)"),
.sample_fmts = (const enum AVSampleFormat[]) {
AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE
},

View File

@ -829,6 +829,6 @@ AVCodec ff_aac_encoder = {
CODEC_CAP_EXPERIMENTAL,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT,
AV_SAMPLE_FMT_NONE },
.long_name = NULL_IF_CONFIG_SMALL("Advanced Audio Coding"),
.long_name = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"),
.priv_class = &aacenc_class,
};

View File

@ -1080,7 +1080,7 @@ AVCodec ff_amrnb_decoder = {
.init = amrnb_decode_init,
.decode = amrnb_decode_frame,
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("Adaptive Multi-Rate NarrowBand"),
.long_name = NULL_IF_CONFIG_SMALL("AMR-NB (Adaptive Multi-Rate NarrowBand)"),
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT,
AV_SAMPLE_FMT_NONE },
};

View File

@ -1262,7 +1262,7 @@ AVCodec ff_amrwb_decoder = {
.init = amrwb_decode_init,
.decode = amrwb_decode_frame,
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("Adaptive Multi-Rate WideBand"),
.long_name = NULL_IF_CONFIG_SMALL("AMR-WB (Adaptive Multi-Rate WideBand)"),
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT,
AV_SAMPLE_FMT_NONE },
};

View File

@ -68,7 +68,7 @@ static int ass_decode_close(AVCodecContext *avctx)
AVCodec ff_ass_decoder = {
.name = "ass",
.long_name = NULL_IF_CONFIG_SMALL("Advanced SubStation Alpha subtitle"),
.long_name = NULL_IF_CONFIG_SMALL("SSA (SubStation Alpha) subtitle"),
.type = AVMEDIA_TYPE_SUBTITLE,
.id = CODEC_ID_SSA,
.init = ass_decode_init,

View File

@ -59,7 +59,7 @@ static int ass_encode_frame(AVCodecContext *avctx,
AVCodec ff_ass_encoder = {
.name = "ass",
.long_name = NULL_IF_CONFIG_SMALL("Advanced SubStation Alpha subtitle"),
.long_name = NULL_IF_CONFIG_SMALL("SSA (SubStation Alpha) subtitle"),
.type = AVMEDIA_TYPE_SUBTITLE,
.id = CODEC_ID_SSA,
.init = ass_encode_init,

View File

@ -358,5 +358,5 @@ AVCodec ff_bmp_decoder = {
.close = bmp_decode_end,
.decode = bmp_decode_frame,
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("BMP image"),
.long_name = NULL_IF_CONFIG_SMALL("BMP (Windows and OS/2 bitmap)"),
};

View File

@ -179,5 +179,5 @@ AVCodec ff_bmp_encoder = {
PIX_FMT_MONOBLACK,
PIX_FMT_NONE
},
.long_name = NULL_IF_CONFIG_SMALL("BMP image"),
.long_name = NULL_IF_CONFIG_SMALL("BMP (Windows and OS/2 bitmap)"),
};

View File

@ -740,5 +740,5 @@ AVCodec ff_cavs_decoder = {
.decode = cavs_decode_frame,
.capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY,
.flush = cavs_flush,
.long_name = NULL_IF_CONFIG_SMALL("Chinese AVS video (AVS1-P2, JiZhun profile)"),
.long_name = NULL_IF_CONFIG_SMALL("Chinese AVS (Audio Video Standard) (AVS1-P2, JiZhun profile)"),
};

View File

@ -1319,5 +1319,5 @@ AVCodec ff_cook_decoder = {
.close = cook_decode_close,
.decode = cook_decode_frame,
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("COOK"),
.long_name = NULL_IF_CONFIG_SMALL("Cook / Cooker / Gecko (RealAudio G2)"),
};

View File

@ -128,6 +128,6 @@ AVCodec ff_flv_decoder = {
.decode = ff_h263_decode_frame,
.capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
.max_lowres = 3,
.long_name = NULL_IF_CONFIG_SMALL("Flash Video (FLV) / Sorenson Spark / Sorenson H.263"),
.long_name = NULL_IF_CONFIG_SMALL("FLV / Sorenson Spark / Sorenson H.263 (Flash Video)"),
.pix_fmts = ff_pixfmt_list_420,
};

View File

@ -95,6 +95,6 @@ AVCodec ff_flv_encoder = {
.encode2 = ff_MPV_encode_picture,
.close = ff_MPV_encode_end,
.pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P, PIX_FMT_NONE },
.long_name = NULL_IF_CONFIG_SMALL("Flash Video (FLV) / Sorenson Spark / Sorenson H.263"),
.long_name = NULL_IF_CONFIG_SMALL("FLV / Sorenson Spark / Sorenson H.263 (Flash Video)"),
.priv_class = &flv_class,
};

View File

@ -245,7 +245,7 @@ AVCodec ff_libfaac_encoder = {
.capabilities = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
.long_name = NULL_IF_CONFIG_SMALL("libfaac AAC (Advanced Audio Codec)"),
.long_name = NULL_IF_CONFIG_SMALL("libfaac AAC (Advanced Audio Coding)"),
.profiles = NULL_IF_CONFIG_SMALL(profiles),
.channel_layouts = faac_channel_layouts,
};

View File

@ -114,7 +114,7 @@ AVCodec ff_libilbc_decoder = {
.init = ilbc_decode_init,
.decode = ilbc_decode_frame,
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("Internet Low Bitrate Codec (iLBC)"),
.long_name = NULL_IF_CONFIG_SMALL("iLBC (Internet Low Bitrate Codec)"),
.priv_class = &ilbc_dec_class,
};
@ -209,7 +209,7 @@ AVCodec ff_libilbc_encoder = {
.close = ilbc_encode_close,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
.long_name = NULL_IF_CONFIG_SMALL("Internet Low Bitrate Codec (iLBC)"),
.long_name = NULL_IF_CONFIG_SMALL("iLBC (Internet Low Bitrate Codec)"),
.defaults = ilbc_encode_defaults,
.priv_class = &ilbc_enc_class,
};

View File

@ -180,7 +180,7 @@ AVCodec ff_libopencore_amrnb_decoder = {
.close = amr_nb_decode_close,
.decode = amr_nb_decode_frame,
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("OpenCORE Adaptive Multi-Rate (AMR) Narrow-Band"),
.long_name = NULL_IF_CONFIG_SMALL("OpenCORE AMR-NB (Adaptive Multi-Rate Narrow-Band)"),
};
static av_cold int amr_nb_encode_init(AVCodecContext *avctx)
@ -297,7 +297,7 @@ AVCodec ff_libopencore_amrnb_encoder = {
.capabilities = CODEC_CAP_DELAY | CODEC_CAP_SMALL_LAST_FRAME,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
.long_name = NULL_IF_CONFIG_SMALL("OpenCORE Adaptive Multi-Rate (AMR) Narrow-Band"),
.long_name = NULL_IF_CONFIG_SMALL("OpenCORE AMR-NB (Adaptive Multi-Rate Narrow-Band)"),
.priv_class = &class,
};
@ -384,7 +384,7 @@ AVCodec ff_libopencore_amrwb_decoder = {
.close = amr_wb_decode_close,
.decode = amr_wb_decode_frame,
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("OpenCORE Adaptive Multi-Rate (AMR) Wide-Band"),
.long_name = NULL_IF_CONFIG_SMALL("OpenCORE AMR-WB (Adaptive Multi-Rate Wide-Band)"),
};
#endif /* CONFIG_LIBOPENCORE_AMRWB */

View File

@ -197,5 +197,5 @@ AVCodec ff_libvo_aacenc_encoder = {
.capabilities = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
.long_name = NULL_IF_CONFIG_SMALL("Android VisualOn AAC"),
.long_name = NULL_IF_CONFIG_SMALL("Android VisualOn AAC (Advanced Audio Coding)"),
};

View File

@ -148,7 +148,7 @@ AVCodec ff_libvo_amrwbenc_encoder = {
.close = amr_wb_encode_close,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
.long_name = NULL_IF_CONFIG_SMALL("Android VisualOn Adaptive "
"Multi-Rate (AMR) Wide-Band"),
.long_name = NULL_IF_CONFIG_SMALL("Android VisualOn AMR-WB "
"(Adaptive Multi-Rate Wide-Band)"),
.priv_class = &class,
};

View File

@ -424,7 +424,7 @@ AVCodec ff_libxavs_encoder = {
.close = XAVS_close,
.capabilities = CODEC_CAP_DELAY | CODEC_CAP_AUTO_THREADS,
.pix_fmts = (const enum PixelFormat[]) { PIX_FMT_YUV420P, PIX_FMT_NONE },
.long_name = NULL_IF_CONFIG_SMALL("libxavs - the Chinese Audio Video Standard Encoder"),
.long_name = NULL_IF_CONFIG_SMALL("libxavs Chinese AVS (Audio Video Standard)"),
.priv_class = &class,
.defaults = xavs_defaults,
};

View File

@ -474,5 +474,5 @@ AVCodec ff_tta_decoder = {
.close = tta_decode_close,
.decode = tta_decode_frame,
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("True Audio (TTA)"),
.long_name = NULL_IF_CONFIG_SMALL("TTA (True Audio)"),
};

View File

@ -27,6 +27,10 @@
%include "libavutil/x86/x86inc.asm"
%include "libavutil/x86/x86util.asm"
SECTION_RODATA
pb_3_1: times 4 db 3, 1
SECTION .text
cextern pb_0
@ -921,3 +925,167 @@ ff_chroma_intra_body_mmx2:
paddb m1, m5
paddb m2, m6
ret
;-----------------------------------------------------------------------------
; void h264_loop_filter_strength(int16_t bs[2][4][4], uint8_t nnz[40],
; int8_t ref[2][40], int16_t mv[2][40][2],
; int bidir, int edges, int step,
; int mask_mv0, int mask_mv1, int field);
;
; bidir is 0 or 1
; edges is 1 or 4
; step is 1 or 2
; mask_mv0 is 0 or 3
; mask_mv1 is 0 or 1
; field is 0 or 1
;-----------------------------------------------------------------------------
%macro loop_filter_strength_iteration 7 ; edges, step, mask_mv,
; dir, d_idx, mask_dir, bidir
%define edgesd %1
%define stepd %2
%define mask_mvd %3
%define dir %4
%define d_idx %5
%define mask_dir %6
%define bidir %7
xor b_idxd, b_idxd ; for (b_idx = 0; b_idx < edges; b_idx += step)
%%.b_idx_loop:
%if mask_dir == 0
pxor m0, m0
%endif
test b_idxd, dword mask_mvd
jnz %%.skip_loop_iter ; if (!(b_idx & mask_mv))
%if bidir == 1
movd m2, [refq+b_idxq+d_idx+12] ; { ref0[bn] }
punpckldq m2, [refq+b_idxq+d_idx+52] ; { ref0[bn], ref1[bn] }
pshufw m0, [refq+b_idxq+12], 0x44 ; { ref0[b], ref0[b] }
pshufw m1, [refq+b_idxq+52], 0x44 ; { ref1[b], ref1[b] }
pshufw m3, m2, 0x4E ; { ref1[bn], ref0[bn] }
psubb m0, m2 ; { ref0[b] != ref0[bn],
; ref0[b] != ref1[bn] }
psubb m1, m3 ; { ref1[b] != ref1[bn],
; ref1[b] != ref0[bn] }
por m0, m1
mova m1, [mvq+b_idxq*4+(d_idx+12)*4]
mova m2, [mvq+b_idxq*4+(d_idx+12)*4+mmsize]
mova m3, m1
mova m4, m2
psubw m1, [mvq+b_idxq*4+12*4]
psubw m2, [mvq+b_idxq*4+12*4+mmsize]
psubw m3, [mvq+b_idxq*4+52*4]
psubw m4, [mvq+b_idxq*4+52*4+mmsize]
packsswb m1, m2
packsswb m3, m4
paddb m1, m6
paddb m3, m6
psubusb m1, m5 ; abs(mv[b] - mv[bn]) >= limit
psubusb m3, m5
packsswb m1, m3
por m0, m1
mova m1, [mvq+b_idxq*4+(d_idx+52)*4]
mova m2, [mvq+b_idxq*4+(d_idx+52)*4+mmsize]
mova m3, m1
mova m4, m2
psubw m1, [mvq+b_idxq*4+12*4]
psubw m2, [mvq+b_idxq*4+12*4+mmsize]
psubw m3, [mvq+b_idxq*4+52*4]
psubw m4, [mvq+b_idxq*4+52*4+mmsize]
packsswb m1, m2
packsswb m3, m4
paddb m1, m6
paddb m3, m6
psubusb m1, m5 ; abs(mv[b] - mv[bn]) >= limit
psubusb m3, m5
packsswb m1, m3
pshufw m1, m1, 0x4E
por m0, m1
pshufw m1, m0, 0x4E
pminub m0, m1
%else ; bidir == 0
movd m0, [refq+b_idxq+12]
psubb m0, [refq+b_idxq+d_idx+12] ; ref[b] != ref[bn]
mova m1, [mvq+b_idxq*4+12*4]
mova m2, [mvq+b_idxq*4+12*4+mmsize]
psubw m1, [mvq+b_idxq*4+(d_idx+12)*4]
psubw m2, [mvq+b_idxq*4+(d_idx+12)*4+mmsize]
packsswb m1, m2
paddb m1, m6
psubusb m1, m5 ; abs(mv[b] - mv[bn]) >= limit
packsswb m1, m1
por m0, m1
%endif ; bidir == 1/0
%%.skip_loop_iter:
movd m1, [nnzq+b_idxq+12]
por m1, [nnzq+b_idxq+d_idx+12] ; nnz[b] || nnz[bn]
pminub m1, m7
pminub m0, m7
psllw m1, 1
pxor m2, m2
pmaxub m1, m0
punpcklbw m1, m2
movq [bsq+b_idxq+32*dir], m1
add b_idxd, dword stepd
cmp b_idxd, dword edgesd
jl %%.b_idx_loop
%endmacro
INIT_MMX mmx2
cglobal h264_loop_filter_strength, 9, 9, 0, bs, nnz, ref, mv, bidir, edges, \
step, mask_mv0, mask_mv1, field
%define b_idxq bidirq
%define b_idxd bidird
cmp dword fieldm, 0
mova m7, [pb_1]
mova m5, [pb_3]
je .nofield
mova m5, [pb_3_1]
.nofield:
mova m6, m5
paddb m5, m5
shl dword stepd, 3
shl dword edgesd, 3
%if ARCH_X86_32
%define mask_mv0d mask_mv0m
%define mask_mv1d mask_mv1m
%endif
shl dword mask_mv1d, 3
shl dword mask_mv0d, 3
cmp dword bidird, 0
jne .bidir
loop_filter_strength_iteration edgesd, stepd, mask_mv1d, 1, -8, 0, 0
loop_filter_strength_iteration 32, 8, mask_mv0d, 0, -1, -1, 0
mova m0, [bsq+mmsize*0]
mova m1, [bsq+mmsize*1]
mova m2, [bsq+mmsize*2]
mova m3, [bsq+mmsize*3]
TRANSPOSE4x4W 0, 1, 2, 3, 4
mova [bsq+mmsize*0], m0
mova [bsq+mmsize*1], m1
mova [bsq+mmsize*2], m2
mova [bsq+mmsize*3], m3
RET
.bidir:
loop_filter_strength_iteration edgesd, stepd, mask_mv1d, 1, -8, 0, 1
loop_filter_strength_iteration 32, 8, mask_mv0d, 0, -1, -1, 1
mova m0, [bsq+mmsize*0]
mova m1, [bsq+mmsize*1]
mova m2, [bsq+mmsize*2]
mova m3, [bsq+mmsize*3]
TRANSPOSE4x4W 0, 1, 2, 3, 4
mova [bsq+mmsize*0], m0
mova [bsq+mmsize*1], m1
mova [bsq+mmsize*2], m2
mova [bsq+mmsize*3], m3
RET

View File

@ -88,158 +88,10 @@ void ff_h264_luma_dc_dequant_idct_sse2(DCTELEM *output, DCTELEM *input, int qmul
/***********************************/
/* deblocking */
#define h264_loop_filter_strength_iteration_mmx2(bS, nz, ref, mv, bidir, edges, step, mask_mv, dir, d_idx, mask_dir) \
do { \
x86_reg b_idx; \
mask_mv <<= 3; \
for( b_idx=0; b_idx<edges; b_idx+=step ) { \
if (!mask_dir) \
__asm__ volatile( \
"pxor %%mm0, %%mm0 \n\t" \
:: \
); \
if(!(mask_mv & b_idx)) { \
if(bidir) { \
__asm__ volatile( \
"movd %a3(%0,%2), %%mm2 \n" \
"punpckldq %a4(%0,%2), %%mm2 \n" /* { ref0[bn], ref1[bn] } */ \
"pshufw $0x44, 12(%0,%2), %%mm0 \n" /* { ref0[b], ref0[b] } */ \
"pshufw $0x44, 52(%0,%2), %%mm1 \n" /* { ref1[b], ref1[b] } */ \
"pshufw $0x4E, %%mm2, %%mm3 \n" \
"psubb %%mm2, %%mm0 \n" /* { ref0[b]!=ref0[bn], ref0[b]!=ref1[bn] } */ \
"psubb %%mm3, %%mm1 \n" /* { ref1[b]!=ref1[bn], ref1[b]!=ref0[bn] } */ \
\
"por %%mm1, %%mm0 \n" \
"movq %a5(%1,%2,4), %%mm1 \n" \
"movq %a6(%1,%2,4), %%mm2 \n" \
"movq %%mm1, %%mm3 \n" \
"movq %%mm2, %%mm4 \n" \
"psubw 48(%1,%2,4), %%mm1 \n" \
"psubw 56(%1,%2,4), %%mm2 \n" \
"psubw 208(%1,%2,4), %%mm3 \n" \
"psubw 216(%1,%2,4), %%mm4 \n" \
"packsswb %%mm2, %%mm1 \n" \
"packsswb %%mm4, %%mm3 \n" \
"paddb %%mm6, %%mm1 \n" \
"paddb %%mm6, %%mm3 \n" \
"psubusb %%mm5, %%mm1 \n" /* abs(mv[b] - mv[bn]) >= limit */ \
"psubusb %%mm5, %%mm3 \n" \
"packsswb %%mm3, %%mm1 \n" \
\
"por %%mm1, %%mm0 \n" \
"movq %a7(%1,%2,4), %%mm1 \n" \
"movq %a8(%1,%2,4), %%mm2 \n" \
"movq %%mm1, %%mm3 \n" \
"movq %%mm2, %%mm4 \n" \
"psubw 48(%1,%2,4), %%mm1 \n" \
"psubw 56(%1,%2,4), %%mm2 \n" \
"psubw 208(%1,%2,4), %%mm3 \n" \
"psubw 216(%1,%2,4), %%mm4 \n" \
"packsswb %%mm2, %%mm1 \n" \
"packsswb %%mm4, %%mm3 \n" \
"paddb %%mm6, %%mm1 \n" \
"paddb %%mm6, %%mm3 \n" \
"psubusb %%mm5, %%mm1 \n" /* abs(mv[b] - mv[bn]) >= limit */ \
"psubusb %%mm5, %%mm3 \n" \
"packsswb %%mm3, %%mm1 \n" \
\
"pshufw $0x4E, %%mm1, %%mm1 \n" \
"por %%mm1, %%mm0 \n" \
"pshufw $0x4E, %%mm0, %%mm1 \n" \
"pminub %%mm1, %%mm0 \n" \
::"r"(ref), \
"r"(mv), \
"r"(b_idx), \
"i"(d_idx+12), \
"i"(d_idx+52), \
"i"(d_idx*4+48), \
"i"(d_idx*4+56), \
"i"(d_idx*4+208), \
"i"(d_idx*4+216) \
); \
} else { \
__asm__ volatile( \
"movd 12(%0,%2), %%mm0 \n" \
"psubb %a3(%0,%2), %%mm0 \n" /* ref[b] != ref[bn] */ \
"movq 48(%1,%2,4), %%mm1 \n" \
"movq 56(%1,%2,4), %%mm2 \n" \
"psubw %a4(%1,%2,4), %%mm1 \n" \
"psubw %a5(%1,%2,4), %%mm2 \n" \
"packsswb %%mm2, %%mm1 \n" \
"paddb %%mm6, %%mm1 \n" \
"psubusb %%mm5, %%mm1 \n" /* abs(mv[b] - mv[bn]) >= limit */ \
"packsswb %%mm1, %%mm1 \n" \
"por %%mm1, %%mm0 \n" \
::"r"(ref), \
"r"(mv), \
"r"(b_idx), \
"i"(d_idx+12), \
"i"(d_idx*4+48), \
"i"(d_idx*4+56) \
); \
} \
} \
__asm__ volatile( \
"movd 12(%0,%1), %%mm1 \n" \
"por %a2(%0,%1), %%mm1 \n" /* nnz[b] || nnz[bn] */ \
::"r"(nnz), \
"r"(b_idx), \
"i"(d_idx+12) \
); \
__asm__ volatile( \
"pminub %%mm7, %%mm1 \n" \
"pminub %%mm7, %%mm0 \n" \
"psllw $1, %%mm1 \n" \
"pxor %%mm2, %%mm2 \n" \
"pmaxub %%mm0, %%mm1 \n" \
"punpcklbw %%mm2, %%mm1 \n" \
"movq %%mm1, %a1(%0,%2) \n" \
::"r"(bS), \
"i"(32*dir), \
"r"(b_idx) \
:"memory" \
); \
} \
} while (0)
static void h264_loop_filter_strength_mmx2( int16_t bS[2][4][4], uint8_t nnz[40], int8_t ref[2][40], int16_t mv[2][40][2],
int bidir, int edges, int step, int mask_mv0, int mask_mv1, int field ) {
__asm__ volatile(
"movq %0, %%mm7 \n"
"movq %1, %%mm6 \n"
::"m"(ff_pb_1), "m"(ff_pb_3)
);
if(field)
__asm__ volatile(
"movq %0, %%mm6 \n"
::"m"(ff_pb_3_1)
);
__asm__ volatile(
"movq %%mm6, %%mm5 \n"
"paddb %%mm5, %%mm5 \n"
:);
// could do a special case for dir==0 && edges==1, but it only reduces the
// average filter time by 1.2%
step <<= 3;
edges <<= 3;
h264_loop_filter_strength_iteration_mmx2(bS, nnz, ref, mv, bidir, edges, step, mask_mv1, 1, -8, 0);
h264_loop_filter_strength_iteration_mmx2(bS, nnz, ref, mv, bidir, 32, 8, mask_mv0, 0, -1, -1);
__asm__ volatile(
"movq (%0), %%mm0 \n\t"
"movq 8(%0), %%mm1 \n\t"
"movq 16(%0), %%mm2 \n\t"
"movq 24(%0), %%mm3 \n\t"
TRANSPOSE4(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4)
"movq %%mm0, (%0) \n\t"
"movq %%mm3, 8(%0) \n\t"
"movq %%mm4, 16(%0) \n\t"
"movq %%mm2, 24(%0) \n\t"
::"r"(bS[0])
:"memory"
);
}
void ff_h264_loop_filter_strength_mmx2(int16_t bS[2][4][4], uint8_t nnz[40],
int8_t ref[2][40], int16_t mv[2][40][2],
int bidir, int edges, int step,
int mask_mv0, int mask_mv1, int field);
#define LF_FUNC(DIR, TYPE, DEPTH, OPT) \
void ff_deblock_ ## DIR ## _ ## TYPE ## _ ## DEPTH ## _ ## OPT (uint8_t *pix, int stride, \
@ -342,14 +194,14 @@ H264_BIWEIGHT_10_SSE( 4, 10)
void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth, const int chroma_format_idc)
{
#if HAVE_YASM
int mm_flags = av_get_cpu_flags();
if (chroma_format_idc == 1 && mm_flags & AV_CPU_FLAG_MMX2) {
c->h264_loop_filter_strength= h264_loop_filter_strength_mmx2;
c->h264_loop_filter_strength = ff_h264_loop_filter_strength_mmx2;
}
if (bit_depth == 8) {
#if HAVE_YASM
if (mm_flags & AV_CPU_FLAG_MMX) {
c->h264_idct_dc_add =
c->h264_idct_add = ff_h264_idct_add_8_mmx;
@ -430,9 +282,7 @@ void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth, const int chrom
}
}
}
#endif
} else if (bit_depth == 10) {
#if HAVE_YASM
if (mm_flags & AV_CPU_FLAG_MMX) {
if (mm_flags & AV_CPU_FLAG_MMX2) {
#if ARCH_X86_32
@ -510,6 +360,6 @@ void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth, const int chrom
#endif /* HAVE_AVX */
}
}
#endif
}
#endif
}

View File

@ -296,7 +296,7 @@ static const AVClass oss_demuxer_class = {
AVInputFormat ff_oss_demuxer = {
.name = "oss",
.long_name = NULL_IF_CONFIG_SMALL("Open Sound System capture"),
.long_name = NULL_IF_CONFIG_SMALL("OSS (Open Sound System) capture"),
.priv_data_size = sizeof(AudioData),
.read_header = audio_read_header,
.read_packet = audio_read_packet,
@ -309,7 +309,7 @@ AVInputFormat ff_oss_demuxer = {
#if CONFIG_OSS_OUTDEV
AVOutputFormat ff_oss_muxer = {
.name = "oss",
.long_name = NULL_IF_CONFIG_SMALL("Open Sound System playback"),
.long_name = NULL_IF_CONFIG_SMALL("OSS (Open Sound System) playback"),
.priv_data_size = sizeof(AudioData),
/* XXX: we make the assumption that the soundcard accepts this format */
/* XXX: find better solution with "preinit" method, needed also in

View File

@ -45,9 +45,9 @@ DECLARE_ASM_CONST(16, const xmm_reg, pw_1) = {0x0001000100010001ULL, 0x000100010
#undef COMPILE_TEMPLATE_SSE
#endif
#if HAVE_MMX
#if HAVE_MMX2
#undef RENAME
#define RENAME(a) a ## _mmx
#define RENAME(a) a ## _mmx2
#include "yadif_template.c"
#endif
@ -58,9 +58,9 @@ av_cold void ff_yadif_init_x86(YADIFContext *yadif)
int cpu_flags = av_get_cpu_flags();
#if HAVE_INLINE_ASM
#if HAVE_MMX
if (cpu_flags & AV_CPU_FLAG_MMX)
yadif->filter_line = yadif_filter_line_mmx;
#if HAVE_MMX2
if (cpu_flags & AV_CPU_FLAG_MMX2)
yadif->filter_line = yadif_filter_line_mmx2;
#endif
#if HAVE_SSE
if (cpu_flags & AV_CPU_FLAG_SSE2)

View File

@ -84,7 +84,7 @@ static int adts_aac_read_header(AVFormatContext *s)
AVInputFormat ff_aac_demuxer = {
.name = "aac",
.long_name = NULL_IF_CONFIG_SMALL("raw ADTS AAC"),
.long_name = NULL_IF_CONFIG_SMALL("raw ADTS AAC (Advanced Audio Coding)"),
.read_probe = adts_aac_probe,
.read_header = adts_aac_read_header,
.read_packet = ff_raw_read_partial_packet,

View File

@ -165,7 +165,7 @@ static int adts_write_packet(AVFormatContext *s, AVPacket *pkt)
AVOutputFormat ff_adts_muxer = {
.name = "adts",
.long_name = NULL_IF_CONFIG_SMALL("ADTS AAC"),
.long_name = NULL_IF_CONFIG_SMALL("ADTS AAC (Advanced Audio Coding)"),
.mime_type = "audio/aac",
.extensions = "aac,adts",
.priv_data_size = sizeof(ADTSContext),

View File

@ -111,40 +111,47 @@ static int ape_tag_read_field(AVFormatContext *s)
return 0;
}
void ff_ape_parse_tag(AVFormatContext *s)
int64_t ff_ape_parse_tag(AVFormatContext *s)
{
AVIOContext *pb = s->pb;
int file_size = avio_size(pb);
uint32_t val, fields, tag_bytes;
uint8_t buf[8];
int64_t tag_start;
int i;
if (file_size < APE_TAG_FOOTER_BYTES)
return;
return 0;
avio_seek(pb, file_size - APE_TAG_FOOTER_BYTES, SEEK_SET);
avio_read(pb, buf, 8); /* APETAGEX */
if (strncmp(buf, APE_TAG_PREAMBLE, 8)) {
return;
return 0;
}
val = avio_rl32(pb); /* APE tag version */
if (val > APE_TAG_VERSION) {
av_log(s, AV_LOG_ERROR, "Unsupported tag version. (>=%d)\n", APE_TAG_VERSION);
return;
return 0;
}
tag_bytes = avio_rl32(pb); /* tag size */
if (tag_bytes - APE_TAG_FOOTER_BYTES > (1024 * 1024 * 16)) {
av_log(s, AV_LOG_ERROR, "Tag size is way too big\n");
return;
return 0;
}
tag_start = file_size - tag_bytes - APE_TAG_FOOTER_BYTES;
if (tag_start < 0) {
av_log(s, AV_LOG_ERROR, "Invalid tag size %u.\n", tag_bytes);
return 0;
}
fields = avio_rl32(pb); /* number of fields */
if (fields > 65536) {
av_log(s, AV_LOG_ERROR, "Too many tag fields (%d)\n", fields);
return;
return 0;
}
val = avio_rl32(pb); /* flags */
@ -157,4 +164,6 @@ void ff_ape_parse_tag(AVFormatContext *s)
for (i=0; i<fields; i++)
if (ape_tag_read_field(s) < 0) break;
return tag_start;
}

View File

@ -31,8 +31,10 @@
/**
* Read and parse an APE tag
*
* @return offset of the tag start in the file
*/
void ff_ape_parse_tag(AVFormatContext *s);
int64_t ff_ape_parse_tag(AVFormatContext *s);
/**
* Write an APEv2 tag

View File

@ -1410,7 +1410,7 @@ static int asf_read_seek(AVFormatContext *s, int stream_index, int64_t pts, int
AVInputFormat ff_asf_demuxer = {
.name = "asf",
.long_name = NULL_IF_CONFIG_SMALL("ASF format"),
.long_name = NULL_IF_CONFIG_SMALL("ASF (Advanced / Active Streaming Format)"),
.priv_data_size = sizeof(ASFContext),
.read_probe = asf_probe,
.read_header = asf_read_header,

View File

@ -901,7 +901,7 @@ static int asf_write_trailer(AVFormatContext *s)
#if CONFIG_ASF_MUXER
AVOutputFormat ff_asf_muxer = {
.name = "asf",
.long_name = NULL_IF_CONFIG_SMALL("ASF format"),
.long_name = NULL_IF_CONFIG_SMALL("ASF (Advanced / Active Streaming Format)"),
.mime_type = "video/x-ms-asf",
.extensions = "asf,wmv,wma",
.priv_data_size = sizeof(ASFContext),
@ -920,7 +920,7 @@ AVOutputFormat ff_asf_muxer = {
#if CONFIG_ASF_STREAM_MUXER
AVOutputFormat ff_asf_stream_muxer = {
.name = "asf_stream",
.long_name = NULL_IF_CONFIG_SMALL("ASF format"),
.long_name = NULL_IF_CONFIG_SMALL("ASF (Advanced / Active Streaming Format)"),
.mime_type = "video/x-ms-asf",
.extensions = "asf,wmv,wma",
.priv_data_size = sizeof(ASFContext),

View File

@ -205,7 +205,7 @@ static int read_seek2(AVFormatContext *s, int stream_index,
AVInputFormat ff_ass_demuxer = {
.name = "ass",
.long_name = NULL_IF_CONFIG_SMALL("Advanced SubStation Alpha subtitle"),
.long_name = NULL_IF_CONFIG_SMALL("SSA (SubStation Alpha) subtitle"),
.priv_data_size = sizeof(ASSContext),
.read_probe = probe,
.read_header = read_header,

View File

@ -79,7 +79,7 @@ static int write_trailer(AVFormatContext *s)
AVOutputFormat ff_ass_muxer = {
.name = "ass",
.long_name = NULL_IF_CONFIG_SMALL("Advanced SubStation Alpha subtitle"),
.long_name = NULL_IF_CONFIG_SMALL("SSA (SubStation Alpha) subtitle"),
.mime_type = "text/x-ssa",
.extensions = "ass,ssa",
.priv_data_size = sizeof(ASSContext),

View File

@ -195,7 +195,7 @@ static int au_read_packet(AVFormatContext *s,
#if CONFIG_AU_DEMUXER
AVInputFormat ff_au_demuxer = {
.name = "au",
.long_name = NULL_IF_CONFIG_SMALL("SUN AU format"),
.long_name = NULL_IF_CONFIG_SMALL("Sun AU"),
.read_probe = au_probe,
.read_header = au_read_header,
.read_packet = au_read_packet,
@ -207,7 +207,7 @@ AVInputFormat ff_au_demuxer = {
#if CONFIG_AU_MUXER
AVOutputFormat ff_au_muxer = {
.name = "au",
.long_name = NULL_IF_CONFIG_SMALL("SUN AU format"),
.long_name = NULL_IF_CONFIG_SMALL("Sun AU"),
.mime_type = "audio/basic",
.extensions = "au",
.audio_codec = CODEC_ID_PCM_S16BE,

View File

@ -1562,7 +1562,7 @@ static int avi_probe(AVProbeData *p)
AVInputFormat ff_avi_demuxer = {
.name = "avi",
.long_name = NULL_IF_CONFIG_SMALL("AVI format"),
.long_name = NULL_IF_CONFIG_SMALL("AVI (Audio Video Interleaved)"),
.priv_data_size = sizeof(AVIContext),
.read_probe = avi_probe,
.read_header = avi_read_header,

View File

@ -650,7 +650,7 @@ static int avi_write_trailer(AVFormatContext *s)
AVOutputFormat ff_avi_muxer = {
.name = "avi",
.long_name = NULL_IF_CONFIG_SMALL("AVI format"),
.long_name = NULL_IF_CONFIG_SMALL("AVI (Audio Video Interleaved)"),
.mime_type = "video/x-msvideo",
.extensions = "avi",
.priv_data_size = sizeof(AVIContext),

View File

@ -417,7 +417,7 @@ static int read_seek(AVFormatContext *s, int stream_index,
AVInputFormat ff_caf_demuxer = {
.name = "caf",
.long_name = NULL_IF_CONFIG_SMALL("Apple Core Audio Format"),
.long_name = NULL_IF_CONFIG_SMALL("Apple CAF (Core Audio Format)"),
.priv_data_size = sizeof(CaffContext),
.read_probe = probe,
.read_header = read_header,

View File

@ -65,4 +65,4 @@ static int cavsvideo_probe(AVProbeData *p)
return 0;
}
FF_DEF_RAWVIDEO_DEMUXER(cavsvideo, "raw Chinese AVS video", cavsvideo_probe, NULL, CODEC_ID_CAVS)
FF_DEF_RAWVIDEO_DEMUXER(cavsvideo, "raw Chinese AVS (Audio Video Standard)", cavsvideo_probe, NULL, CODEC_ID_CAVS)

View File

@ -591,7 +591,7 @@ static int dv_probe(AVProbeData *p)
#if CONFIG_DV_DEMUXER
AVInputFormat ff_dv_demuxer = {
.name = "dv",
.long_name = NULL_IF_CONFIG_SMALL("DV video"),
.long_name = NULL_IF_CONFIG_SMALL("DV (Digital Video)"),
.priv_data_size = sizeof(RawDVContext),
.read_probe = dv_probe,
.read_header = dv_read_header,

View File

@ -407,7 +407,7 @@ static int dv_write_trailer(struct AVFormatContext *s)
AVOutputFormat ff_dv_muxer = {
.name = "dv",
.long_name = NULL_IF_CONFIG_SMALL("DV video"),
.long_name = NULL_IF_CONFIG_SMALL("DV (Digital Video)"),
.extensions = "dv",
.priv_data_size = sizeof(DVMuxContext),
.audio_codec = CODEC_ID_PCM_S16LE,

View File

@ -889,7 +889,7 @@ static const AVClass class = {
AVInputFormat ff_flv_demuxer = {
.name = "flv",
.long_name = NULL_IF_CONFIG_SMALL("FLV format"),
.long_name = NULL_IF_CONFIG_SMALL("FLV (Flash Video)"),
.priv_data_size = sizeof(FLVContext),
.read_probe = flv_probe,
.read_header = flv_read_header,

View File

@ -566,7 +566,7 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
AVOutputFormat ff_flv_muxer = {
.name = "flv",
.long_name = NULL_IF_CONFIG_SMALL("FLV format"),
.long_name = NULL_IF_CONFIG_SMALL("FLV (Flash Video)"),
.mime_type = "video/x-flv",
.extensions = "flv",
.priv_data_size = sizeof(FLVContext),

View File

@ -569,7 +569,7 @@ static int64_t gxf_read_timestamp(AVFormatContext *s, int stream_index,
AVInputFormat ff_gxf_demuxer = {
.name = "gxf",
.long_name = NULL_IF_CONFIG_SMALL("GXF format"),
.long_name = NULL_IF_CONFIG_SMALL("GXF (General eXchange Format)"),
.priv_data_size = sizeof(struct gxf_stream_info),
.read_probe = gxf_probe,
.read_header = gxf_header,

View File

@ -986,7 +986,7 @@ static int gxf_interleave_packet(AVFormatContext *s, AVPacket *out, AVPacket *pk
AVOutputFormat ff_gxf_muxer = {
.name = "gxf",
.long_name = NULL_IF_CONFIG_SMALL("GXF format"),
.long_name = NULL_IF_CONFIG_SMALL("GXF (General eXchange Format)"),
.extensions = "gxf",
.priv_data_size = sizeof(GXFContext),
.audio_codec = CODEC_ID_PCM_S16LE,

View File

@ -388,7 +388,7 @@ static int iff_read_packet(AVFormatContext *s,
AVInputFormat ff_iff_demuxer = {
.name = "iff",
.long_name = NULL_IF_CONFIG_SMALL("Interchange File Format"),
.long_name = NULL_IF_CONFIG_SMALL("IFF (Interchange File Format)"),
.priv_data_size = sizeof(IffDemuxContext),
.read_probe = iff_probe,
.read_header = iff_read_header,

View File

@ -110,7 +110,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
AVInputFormat ff_iv8_demuxer = {
.name = "iv8",
.long_name = NULL_IF_CONFIG_SMALL("A format generated by IndigoVision 8000 video server"),
.long_name = NULL_IF_CONFIG_SMALL("IndigoVision 8000 video"),
.read_probe = probe,
.read_header = read_header,
.read_packet = read_packet,

View File

@ -3193,7 +3193,7 @@ static const AVClass class = {
AVInputFormat ff_mov_demuxer = {
.name = "mov,mp4,m4a,3gp,3g2,mj2",
.long_name = NULL_IF_CONFIG_SMALL("QuickTime/MPEG-4/Motion JPEG 2000 format"),
.long_name = NULL_IF_CONFIG_SMALL("QuickTime / MOV"),
.priv_data_size = sizeof(MOVContext),
.read_probe = mov_probe,
.read_header = mov_read_header,

View File

@ -3582,7 +3582,7 @@ static int mov_write_trailer(AVFormatContext *s)
MOV_CLASS(mov)
AVOutputFormat ff_mov_muxer = {
.name = "mov",
.long_name = NULL_IF_CONFIG_SMALL("MOV format"),
.long_name = NULL_IF_CONFIG_SMALL("QuickTime / MOV"),
.extensions = "mov",
.priv_data_size = sizeof(MOVMuxContext),
.audio_codec = CODEC_ID_AAC,
@ -3602,7 +3602,7 @@ AVOutputFormat ff_mov_muxer = {
MOV_CLASS(tgp)
AVOutputFormat ff_tgp_muxer = {
.name = "3gp",
.long_name = NULL_IF_CONFIG_SMALL("3GP format"),
.long_name = NULL_IF_CONFIG_SMALL("3GP (3GPP file format)"),
.extensions = "3gp",
.priv_data_size = sizeof(MOVMuxContext),
.audio_codec = CODEC_ID_AMR_NB,
@ -3619,7 +3619,7 @@ AVOutputFormat ff_tgp_muxer = {
MOV_CLASS(mp4)
AVOutputFormat ff_mp4_muxer = {
.name = "mp4",
.long_name = NULL_IF_CONFIG_SMALL("MP4 format"),
.long_name = NULL_IF_CONFIG_SMALL("MP4 (MPEG-4 Part 14)"),
.mime_type = "application/mp4",
.extensions = "mp4",
.priv_data_size = sizeof(MOVMuxContext),
@ -3638,7 +3638,7 @@ AVOutputFormat ff_mp4_muxer = {
MOV_CLASS(psp)
AVOutputFormat ff_psp_muxer = {
.name = "psp",
.long_name = NULL_IF_CONFIG_SMALL("PSP MP4 format"),
.long_name = NULL_IF_CONFIG_SMALL("PSP MP4 (MPEG-4 Part 14)"),
.extensions = "mp4,psp",
.priv_data_size = sizeof(MOVMuxContext),
.audio_codec = CODEC_ID_AAC,
@ -3656,7 +3656,7 @@ AVOutputFormat ff_psp_muxer = {
MOV_CLASS(tg2)
AVOutputFormat ff_tg2_muxer = {
.name = "3g2",
.long_name = NULL_IF_CONFIG_SMALL("3GP2 format"),
.long_name = NULL_IF_CONFIG_SMALL("3GP2 (3GPP2 file format)"),
.extensions = "3g2",
.priv_data_size = sizeof(MOVMuxContext),
.audio_codec = CODEC_ID_AMR_NB,
@ -3673,7 +3673,7 @@ AVOutputFormat ff_tg2_muxer = {
MOV_CLASS(ipod)
AVOutputFormat ff_ipod_muxer = {
.name = "ipod",
.long_name = NULL_IF_CONFIG_SMALL("iPod H.264 MP4 format"),
.long_name = NULL_IF_CONFIG_SMALL("iPod H.264 MP4 (MPEG-4 Part 14)"),
.mime_type = "application/mp4",
.extensions = "m4v,m4a",
.priv_data_size = sizeof(MOVMuxContext),

View File

@ -234,7 +234,7 @@ static int read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, in
AVInputFormat ff_mp3_demuxer = {
.name = "mp3",
.long_name = NULL_IF_CONFIG_SMALL("MPEG audio layer 2/3"),
.long_name = NULL_IF_CONFIG_SMALL("MP2/3 (MPEG audio layer 2/3)"),
.priv_data_size = sizeof(MP3Context),
.read_probe = mp3_read_probe,
.read_header = mp3_read_header,

View File

@ -373,7 +373,7 @@ static int mp2_write_trailer(struct AVFormatContext *s)
#if CONFIG_MP2_MUXER
AVOutputFormat ff_mp2_muxer = {
.name = "mp2",
.long_name = NULL_IF_CONFIG_SMALL("MPEG audio layer 2"),
.long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"),
.mime_type = "audio/x-mpeg",
.extensions = "mp2,m2a",
.audio_codec = CODEC_ID_MP2,
@ -507,7 +507,7 @@ static int mp3_write_trailer(AVFormatContext *s)
AVOutputFormat ff_mp3_muxer = {
.name = "mp3",
.long_name = NULL_IF_CONFIG_SMALL("MPEG audio layer 3"),
.long_name = NULL_IF_CONFIG_SMALL("MP3 (MPEG audio layer 3)"),
.mime_type = "audio/x-mpeg",
.extensions = "mp3",
.priv_data_size = sizeof(MP3Context),

View File

@ -59,17 +59,17 @@ static int mpc_read_header(AVFormatContext *s)
if(avio_rl24(s->pb) != MKTAG('M', 'P', '+', 0)){
av_log(s, AV_LOG_ERROR, "Not a Musepack file\n");
return -1;
return AVERROR_INVALIDDATA;
}
c->ver = avio_r8(s->pb);
if(c->ver != 0x07 && c->ver != 0x17){
av_log(s, AV_LOG_ERROR, "Can demux Musepack SV7, got version %02X\n", c->ver);
return -1;
return AVERROR_INVALIDDATA;
}
c->fcount = avio_rl32(s->pb);
if((int64_t)c->fcount * sizeof(MPCFrame) >= UINT_MAX){
av_log(s, AV_LOG_ERROR, "Too many frames, seeking is not possible\n");
return -1;
return AVERROR_INVALIDDATA;
}
if(c->fcount){
c->frames = av_malloc(c->fcount * sizeof(MPCFrame));
@ -122,7 +122,7 @@ static int mpc_read_packet(AVFormatContext *s, AVPacket *pkt)
int64_t pos;
if (c->curframe >= c->fcount && c->fcount)
return -1;
return AVERROR_EOF;
if(c->curframe != c->lastframe + 1){
avio_seek(s->pb, c->frames[c->curframe].pos, SEEK_SET);
@ -151,8 +151,8 @@ static int mpc_read_packet(AVFormatContext *s, AVPacket *pkt)
}
c->curbits = (curbits + size2) & 0x1F;
if (av_new_packet(pkt, size) < 0)
return AVERROR(EIO);
if ((ret = av_new_packet(pkt, size)) < 0)
return ret;
pkt->data[0] = curbits;
pkt->data[1] = (c->curframe > c->fcount) && c->fcount;
@ -166,7 +166,7 @@ static int mpc_read_packet(AVFormatContext *s, AVPacket *pkt)
avio_seek(s->pb, -4, SEEK_CUR);
if(ret < size){
av_free_packet(pkt);
return AVERROR(EIO);
return ret < 0 ? ret : AVERROR(EIO);
}
pkt->size = ret + 4;
@ -214,7 +214,7 @@ static int mpc_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
ret = av_read_frame(s, pkt);
if (ret < 0){
c->curframe = lastframe;
return -1;
return ret;
}
av_free_packet(pkt);
}

View File

@ -52,6 +52,8 @@ typedef struct {
int frame;
int64_t header_pos;
int64_t samples;
int64_t apetag_start;
} MPCContext;
static inline int64_t bs_get_v(uint8_t **bs)
@ -200,7 +202,7 @@ static int mpc8_read_header(AVFormatContext *s)
c->header_pos = avio_tell(pb);
if(avio_rl32(pb) != TAG_MPCK){
av_log(s, AV_LOG_ERROR, "Not a Musepack8 file\n");
return -1;
return AVERROR_INVALIDDATA;
}
while(!url_feof(pb)){
@ -212,14 +214,14 @@ static int mpc8_read_header(AVFormatContext *s)
}
if(tag != TAG_STREAMHDR){
av_log(s, AV_LOG_ERROR, "Stream header not found\n");
return -1;
return AVERROR_INVALIDDATA;
}
pos = avio_tell(pb);
avio_skip(pb, 4); //CRC
c->ver = avio_r8(pb);
if(c->ver != 8){
av_log(s, AV_LOG_ERROR, "Unknown stream version %d\n", c->ver);
return -1;
return AVERROR_PATCHWELCOME;
}
c->samples = ffio_read_varlen(pb);
ffio_read_varlen(pb); //silence samples at the beginning
@ -245,7 +247,7 @@ static int mpc8_read_header(AVFormatContext *s)
if (pb->seekable) {
int64_t pos = avio_tell(s->pb);
ff_ape_parse_tag(s);
c->apetag_start = ff_ape_parse_tag(s);
avio_seek(s->pb, pos, SEEK_SET);
}
@ -260,6 +262,11 @@ static int mpc8_read_packet(AVFormatContext *s, AVPacket *pkt)
while(!url_feof(s->pb)){
pos = avio_tell(s->pb);
/* don't return bogus packets with the ape tag data */
if (c->apetag_start && pos >= c->apetag_start)
return AVERROR_EOF;
mpc8_get_chunk_header(s->pb, &tag, &size);
if (size < 0)
return -1;

View File

@ -573,7 +573,7 @@ static int64_t mpegps_read_dts(AVFormatContext *s, int stream_index,
AVInputFormat ff_mpegps_demuxer = {
.name = "mpeg",
.long_name = NULL_IF_CONFIG_SMALL("MPEG-PS format"),
.long_name = NULL_IF_CONFIG_SMALL("MPEG-PS (MPEG-2 Program Stream)"),
.priv_data_size = sizeof(MpegDemuxContext),
.read_probe = mpegps_probe,
.read_header = mpegps_read_header,

View File

@ -1147,7 +1147,7 @@ static const AVClass flavor ## _class = {\
MPEGENC_CLASS(mpeg)
AVOutputFormat ff_mpeg1system_muxer = {
.name = "mpeg",
.long_name = NULL_IF_CONFIG_SMALL("MPEG-1 System format"),
.long_name = NULL_IF_CONFIG_SMALL("MPEG-1 Systems / MPEG program stream"),
.mime_type = "video/mpeg",
.extensions = "mpg,mpeg",
.priv_data_size = sizeof(MpegMuxContext),
@ -1163,7 +1163,7 @@ AVOutputFormat ff_mpeg1system_muxer = {
MPEGENC_CLASS(vcd)
AVOutputFormat ff_mpeg1vcd_muxer = {
.name = "vcd",
.long_name = NULL_IF_CONFIG_SMALL("MPEG-1 System format (VCD)"),
.long_name = NULL_IF_CONFIG_SMALL("MPEG-1 Systems / MPEG program stream (VCD)"),
.mime_type = "video/mpeg",
.priv_data_size = sizeof(MpegMuxContext),
.audio_codec = CODEC_ID_MP2,
@ -1196,7 +1196,7 @@ AVOutputFormat ff_mpeg2vob_muxer = {
MPEGENC_CLASS(svcd)
AVOutputFormat ff_mpeg2svcd_muxer = {
.name = "svcd",
.long_name = NULL_IF_CONFIG_SMALL("MPEG-2 PS format (VOB)"),
.long_name = NULL_IF_CONFIG_SMALL("MPEG-2 PS (SVCD)"),
.mime_type = "video/mpeg",
.extensions = "vob",
.priv_data_size = sizeof(MpegMuxContext),

View File

@ -2217,7 +2217,7 @@ void ff_mpegts_parse_close(MpegTSContext *ts)
AVInputFormat ff_mpegts_demuxer = {
.name = "mpegts",
.long_name = NULL_IF_CONFIG_SMALL("MPEG-2 transport stream format"),
.long_name = NULL_IF_CONFIG_SMALL("MPEG-TS (MPEG-2 Transport Stream)"),
.priv_data_size = sizeof(MpegTSContext),
.read_probe = mpegts_probe,
.read_header = mpegts_read_header,
@ -2229,7 +2229,7 @@ AVInputFormat ff_mpegts_demuxer = {
AVInputFormat ff_mpegtsraw_demuxer = {
.name = "mpegtsraw",
.long_name = NULL_IF_CONFIG_SMALL("MPEG-2 raw transport stream format"),
.long_name = NULL_IF_CONFIG_SMALL("raw MPEG-TS (MPEG-2 Transport Stream)"),
.priv_data_size = sizeof(MpegTSContext),
.read_header = mpegts_read_header,
.read_packet = mpegts_raw_read_packet,

View File

@ -1225,7 +1225,7 @@ static int mpegts_write_end(AVFormatContext *s)
AVOutputFormat ff_mpegts_muxer = {
.name = "mpegts",
.long_name = NULL_IF_CONFIG_SMALL("MPEG-2 transport stream format"),
.long_name = NULL_IF_CONFIG_SMALL("MPEG-TS (MPEG-2 Transport Stream)"),
.mime_type = "video/x-mpegts",
.extensions = "ts,m2t,m2ts,mts",
.priv_data_size = sizeof(MpegTSWrite),

View File

@ -2241,7 +2241,7 @@ static int mxf_read_seek(AVFormatContext *s, int stream_index, int64_t sample_ti
AVInputFormat ff_mxf_demuxer = {
.name = "mxf",
.long_name = NULL_IF_CONFIG_SMALL("Material eXchange Format"),
.long_name = NULL_IF_CONFIG_SMALL("MXF (Material eXchange Format)"),
.priv_data_size = sizeof(MXFContext),
.read_probe = mxf_probe,
.read_header = mxf_read_header,

View File

@ -2158,7 +2158,7 @@ static int mxf_interleave(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int
AVOutputFormat ff_mxf_muxer = {
.name = "mxf",
.long_name = NULL_IF_CONFIG_SMALL("Material eXchange Format"),
.long_name = NULL_IF_CONFIG_SMALL("MXF (Material eXchange Format)"),
.mime_type = "application/mxf",
.extensions = "mxf",
.priv_data_size = sizeof(MXFContext),
@ -2173,7 +2173,7 @@ AVOutputFormat ff_mxf_muxer = {
AVOutputFormat ff_mxf_d10_muxer = {
.name = "mxf_d10",
.long_name = NULL_IF_CONFIG_SMALL("Material eXchange Format, D-10 Mapping"),
.long_name = NULL_IF_CONFIG_SMALL("MXF (Material eXchange Format) D-10 Mapping"),
.mime_type = "application/mxf",
.priv_data_size = sizeof(MXFContext),
.audio_codec = CODEC_ID_PCM_S16LE,

View File

@ -60,7 +60,7 @@ AVOutputFormat ff_adx_muxer = {
#if CONFIG_CAVSVIDEO_MUXER
AVOutputFormat ff_cavsvideo_muxer = {
.name = "cavsvideo",
.long_name = NULL_IF_CONFIG_SMALL("raw Chinese AVS video"),
.long_name = NULL_IF_CONFIG_SMALL("raw Chinese AVS (Audio Video Standard) video"),
.extensions = "cavs",
.audio_codec = CODEC_ID_NONE,
.video_codec = CODEC_ID_CAVS,

View File

@ -1114,7 +1114,8 @@ static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt)
break;
case RTMP_PT_VIDEO:
case RTMP_PT_AUDIO:
/* Audio and Video packets are parsed in get_packet() */
case RTMP_PT_METADATA:
/* Audio, Video and Metadata packets are parsed in get_packet() */
break;
default:
av_log(s, AV_LOG_VERBOSE, "Unknown packet type received 0x%02X\n", pkt->type);

View File

@ -385,7 +385,7 @@ static const AVClass seg_class = {
AVOutputFormat ff_segment_muxer = {
.name = "segment",
.long_name = NULL_IF_CONFIG_SMALL("segment muxer"),
.long_name = NULL_IF_CONFIG_SMALL("segment"),
.priv_data_size = sizeof(SegmentContext),
.flags = AVFMT_GLOBALHEADER | AVFMT_NOFILE,
.write_header = seg_write_header,

View File

@ -276,7 +276,7 @@ static av_cold int swf_read_close(AVFormatContext *avctx)
AVInputFormat ff_swf_demuxer = {
.name = "swf",
.long_name = NULL_IF_CONFIG_SMALL("Flash format"),
.long_name = NULL_IF_CONFIG_SMALL("SWF (ShockWave Flash)"),
.priv_data_size = sizeof(SWFContext),
.read_probe = swf_probe,
.read_header = swf_read_header,

View File

@ -505,7 +505,7 @@ static int swf_write_trailer(AVFormatContext *s)
#if CONFIG_SWF_MUXER
AVOutputFormat ff_swf_muxer = {
.name = "swf",
.long_name = NULL_IF_CONFIG_SMALL("Flash format"),
.long_name = NULL_IF_CONFIG_SMALL("SWF (ShockWave Flash)"),
.mime_type = "application/x-shockwave-flash",
.extensions = "swf",
.priv_data_size = sizeof(SWFContext),
@ -520,7 +520,7 @@ AVOutputFormat ff_swf_muxer = {
#if CONFIG_AVM2_MUXER
AVOutputFormat ff_avm2_muxer = {
.name = "avm2",
.long_name = NULL_IF_CONFIG_SMALL("Flash 9 (AVM2) format"),
.long_name = NULL_IF_CONFIG_SMALL("SWF (ShockWave Flash) (AVM2)"),
.mime_type = "application/x-shockwave-flash",
.priv_data_size = sizeof(SWFContext),
.audio_codec = CODEC_ID_MP3,

View File

@ -160,7 +160,7 @@ static int tta_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
AVInputFormat ff_tta_demuxer = {
.name = "tta",
.long_name = NULL_IF_CONFIG_SMALL("True Audio"),
.long_name = NULL_IF_CONFIG_SMALL("TTA (True Audio)"),
.priv_data_size = sizeof(TTAContext),
.read_probe = tta_probe,
.read_header = tta_read_header,

View File

@ -215,7 +215,7 @@ static const AVClass wav_muxer_class = {
AVOutputFormat ff_wav_muxer = {
.name = "wav",
.long_name = NULL_IF_CONFIG_SMALL("WAV format"),
.long_name = NULL_IF_CONFIG_SMALL("WAV / WAVE (Waveform Audio)"),
.mime_type = "audio/x-wav",
.extensions = "wav",
.priv_data_size = sizeof(WAVContext),
@ -699,7 +699,7 @@ static const AVClass wav_demuxer_class = {
};
AVInputFormat ff_wav_demuxer = {
.name = "wav",
.long_name = NULL_IF_CONFIG_SMALL("WAV format"),
.long_name = NULL_IF_CONFIG_SMALL("WAV / WAVE (Waveform Audio)"),
.priv_data_size = sizeof(WAVContext),
.read_probe = wav_probe,
.read_header = wav_read_header,

View File

@ -64,6 +64,8 @@ typedef struct {
int block_parsed;
uint8_t extra[WV_EXTRA_SIZE];
int64_t pos;
int64_t apetag_start;
} WVContext;
static int wv_probe(AVProbeData *p)
@ -88,6 +90,11 @@ static int wv_read_block_header(AVFormatContext *ctx, AVIOContext *pb,
uint32_t chmask;
wc->pos = avio_tell(pb);
/* don't return bogus packets with the ape tag data */
if (wc->apetag_start && wc->pos >= wc->apetag_start)
return AVERROR_EOF;
if (!append) {
tag = avio_rl32(pb);
if (tag != MKTAG('w', 'v', 'p', 'k'))
@ -252,7 +259,7 @@ static int wv_read_header(AVFormatContext *s)
if (s->pb->seekable) {
int64_t cur = avio_tell(s->pb);
ff_ape_parse_tag(s);
wc->apetag_start = ff_ape_parse_tag(s);
if (!av_dict_get(s->metadata, "", NULL, AV_DICT_IGNORE_SUFFIX))
ff_id3v1_read(s);
avio_seek(s->pb, cur, SEEK_SET);