Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
6947b0c4
Commit
6947b0c4
authored
Mar 15, 2011
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'newdev/master'
Merged-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parents
27293b84
c76374c6
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
214 additions
and
79 deletions
+214
-79
protocols.texi
doc/protocols.texi
+16
-0
ffplay.c
ffplay.c
+1
-1
ac3dsp.c
libavcodec/ac3dsp.c
+37
-0
ac3dsp.h
libavcodec/ac3dsp.h
+22
-0
ac3enc.c
libavcodec/ac3enc.c
+12
-13
ac3enc_fixed.c
libavcodec/ac3enc_fixed.c
+21
-31
ac3enc_fixed.h
libavcodec/ac3enc_fixed.h
+2
-0
ac3enc_float.h
libavcodec/ac3enc_float.h
+2
-0
h264_mp4toannexb_bsf.c
libavcodec/h264_mp4toannexb_bsf.c
+4
-1
vp8.c
libavcodec/vp8.c
+1
-1
ac3dsp.asm
libavcodec/x86/ac3dsp.asm
+45
-0
ac3dsp_mmx.c
libavcodec/x86/ac3dsp_mmx.c
+12
-0
applehttp.c
libavformat/applehttp.c
+1
-1
applehttpproto.c
libavformat/applehttpproto.c
+2
-2
asfdec.c
libavformat/asfdec.c
+1
-1
avio.c
libavformat/avio.c
+1
-1
avio.h
libavformat/avio.h
+3
-3
aviobuf.c
libavformat/aviobuf.c
+4
-2
dsicin.c
libavformat/dsicin.c
+1
-1
mxg.c
libavformat/mxg.c
+1
-1
rtpproto.c
libavformat/rtpproto.c
+1
-1
rtsp.c
libavformat/rtsp.c
+1
-1
tcp.c
libavformat/tcp.c
+4
-2
udp.c
libavformat/udp.c
+1
-1
utils.c
libavformat/utils.c
+1
-1
wtv.c
libavformat/wtv.c
+1
-1
error.c
libavutil/error.c
+1
-0
error.h
libavutil/error.h
+2
-0
ac3_fixed
tests/ref/acodec/ac3_fixed
+1
-1
rm
tests/ref/lavf/rm
+1
-1
ac3_rm
tests/ref/seek/ac3_rm
+11
-11
No files found.
doc/protocols.texi
View file @
6947b0c4
...
...
@@ -19,6 +19,22 @@ supported protocols.
A description of the currently available protocols follows.
@section applehttp
Read Apple HTTP Live Streaming compliant segmented stream as
a uniform one. The M3U8 playlists describing the segments can be
remote HTTP resources or local files, accessed using the standard
file protocol.
HTTP is default, specific protocol can be declared using the "+"
specifier.
@example
applehttp://host/path/to/remote/resource.m3u8
applehttp+http://host/path/to/remote/resource.m3u8
applehttp+file://path/to/local/resource.m3u8
@end example
@section concat
Physical concatenation protocol.
...
...
ffplay.c
View file @
6947b0c4
...
...
@@ -2575,7 +2575,7 @@ static int decode_thread(void *arg)
if
(
ret
<
0
)
{
if
(
ret
==
AVERROR_EOF
||
url_feof
(
ic
->
pb
))
eof
=
1
;
if
(
url_ferror
(
ic
->
pb
)
)
if
(
ic
->
pb
->
error
)
break
;
SDL_Delay
(
100
);
/* wait for user event */
continue
;
...
...
libavcodec/ac3dsp.c
View file @
6947b0c4
...
...
@@ -50,10 +50,47 @@ static int ac3_max_msb_abs_int16_c(const int16_t *src, int len)
return
v
;
}
static
void
ac3_lshift_int16_c
(
int16_t
*
src
,
unsigned
int
len
,
unsigned
int
shift
)
{
uint32_t
*
src32
=
(
uint32_t
*
)
src
;
const
uint32_t
mask
=
~
(((
1
<<
shift
)
-
1
)
<<
16
);
int
i
;
len
>>=
1
;
for
(
i
=
0
;
i
<
len
;
i
+=
8
)
{
src32
[
i
]
=
(
src32
[
i
]
<<
shift
)
&
mask
;
src32
[
i
+
1
]
=
(
src32
[
i
+
1
]
<<
shift
)
&
mask
;
src32
[
i
+
2
]
=
(
src32
[
i
+
2
]
<<
shift
)
&
mask
;
src32
[
i
+
3
]
=
(
src32
[
i
+
3
]
<<
shift
)
&
mask
;
src32
[
i
+
4
]
=
(
src32
[
i
+
4
]
<<
shift
)
&
mask
;
src32
[
i
+
5
]
=
(
src32
[
i
+
5
]
<<
shift
)
&
mask
;
src32
[
i
+
6
]
=
(
src32
[
i
+
6
]
<<
shift
)
&
mask
;
src32
[
i
+
7
]
=
(
src32
[
i
+
7
]
<<
shift
)
&
mask
;
}
}
static
void
ac3_rshift_int32_c
(
int32_t
*
src
,
unsigned
int
len
,
unsigned
int
shift
)
{
do
{
*
src
++
>>=
shift
;
*
src
++
>>=
shift
;
*
src
++
>>=
shift
;
*
src
++
>>=
shift
;
*
src
++
>>=
shift
;
*
src
++
>>=
shift
;
*
src
++
>>=
shift
;
*
src
++
>>=
shift
;
len
-=
8
;
}
while
(
len
>
0
);
}
av_cold
void
ff_ac3dsp_init
(
AC3DSPContext
*
c
)
{
c
->
ac3_exponent_min
=
ac3_exponent_min_c
;
c
->
ac3_max_msb_abs_int16
=
ac3_max_msb_abs_int16_c
;
c
->
ac3_lshift_int16
=
ac3_lshift_int16_c
;
c
->
ac3_rshift_int32
=
ac3_rshift_int32_c
;
if
(
HAVE_MMX
)
ff_ac3dsp_init_x86
(
c
);
...
...
libavcodec/ac3dsp.h
View file @
6947b0c4
...
...
@@ -46,6 +46,28 @@ typedef struct AC3DSPContext {
* @return a value with the same MSB as max(abs(src[]))
*/
int
(
*
ac3_max_msb_abs_int16
)(
const
int16_t
*
src
,
int
len
);
/**
* Left-shift each value in an array of int16_t by a specified amount.
* @param src input array
* constraints: align 16
* @param len number of values in the array
* constraints: multiple of 32 greater than 0
* @param shift left shift amount
* constraints: range [0,15]
*/
void
(
*
ac3_lshift_int16
)(
int16_t
*
src
,
unsigned
int
len
,
unsigned
int
shift
);
/**
* Right-shift each value in an array of int32_t by a specified amount.
* @param src input array
* constraints: align 16
* @param len number of values in the array
* constraints: multiple of 16 greater than 0
* @param shift right shift amount
* constraints: range [0,31]
*/
void
(
*
ac3_rshift_int32
)(
int32_t
*
src
,
unsigned
int
len
,
unsigned
int
shift
);
}
AC3DSPContext
;
void
ff_ac3dsp_init
(
AC3DSPContext
*
c
);
...
...
libavcodec/ac3enc.c
View file @
6947b0c4
...
...
@@ -78,7 +78,7 @@ typedef struct AC3Block {
int16_t
**
band_psd
;
///< psd per critical band
int16_t
**
mask
;
///< masking curve
uint16_t
**
qmant
;
///< quantized mantissas
int8_t
exp_shift
[
AC3_MAX_CHANNELS
];
///< expon
ent shift values
uint8_t
coeff_shift
[
AC3_MAX_CHANNELS
];
///< fixed-point coeffici
ent shift values
uint8_t
new_rematrixing_strategy
;
///< send new rematrixing flags in this block
uint8_t
rematrixing_flags
[
4
];
///< rematrixing flags
}
AC3Block
;
...
...
@@ -269,7 +269,7 @@ static void apply_mdct(AC3EncodeContext *s)
apply_window
(
&
s
->
dsp
,
s
->
windowed_samples
,
input_samples
,
s
->
mdct
.
window
,
AC3_WINDOW_SIZE
);
block
->
exp
_shift
[
ch
]
=
normalize_samples
(
s
);
block
->
coeff
_shift
[
ch
]
=
normalize_samples
(
s
);
mdct512
(
&
s
->
mdct
,
block
->
mdct_coef
[
ch
],
s
->
windowed_samples
);
}
...
...
@@ -328,10 +328,10 @@ static void compute_rematrixing_strategy(AC3EncodeContext *s)
CoefType
rt
=
block
->
mdct_coef
[
1
][
i
];
CoefType
md
=
lt
+
rt
;
CoefType
sd
=
lt
-
rt
;
sum
[
0
]
+=
lt
*
lt
;
sum
[
1
]
+=
rt
*
rt
;
sum
[
2
]
+=
md
*
md
;
sum
[
3
]
+=
sd
*
sd
;
MAC_COEF
(
sum
[
0
],
lt
,
lt
)
;
MAC_COEF
(
sum
[
1
],
rt
,
rt
)
;
MAC_COEF
(
sum
[
2
],
md
,
md
)
;
MAC_COEF
(
sum
[
3
],
sd
,
sd
)
;
}
/* compare sums to determine if rematrixing will be used for this band */
...
...
@@ -416,14 +416,13 @@ static void extract_exponents(AC3EncodeContext *s)
AC3Block
*
block
=
&
s
->
blocks
[
blk
];
uint8_t
*
exp
=
block
->
exp
[
ch
];
int32_t
*
coef
=
block
->
fixed_coef
[
ch
];
int
exp_shift
=
block
->
exp_shift
[
ch
];
for
(
i
=
0
;
i
<
AC3_MAX_COEFS
;
i
++
)
{
int
e
;
int
v
=
abs
(
coef
[
i
]);
if
(
v
==
0
)
e
=
24
;
else
{
e
=
23
-
av_log2
(
v
)
+
exp_shift
;
e
=
23
-
av_log2
(
v
);
if
(
e
>=
24
)
{
e
=
24
;
coef
[
i
]
=
0
;
...
...
@@ -1139,7 +1138,7 @@ static inline int asym_quant(int c, int e, int qbits)
* Quantize a set of mantissas for a single channel in a single block.
*/
static
void
quantize_mantissas_blk_ch
(
AC3EncodeContext
*
s
,
int32_t
*
fixed_coef
,
int8_t
exp_shift
,
uint8_t
*
exp
,
uint8_t
*
exp
,
uint8_t
*
bap
,
uint16_t
*
qmant
,
int
n
)
{
int
i
;
...
...
@@ -1147,7 +1146,7 @@ static void quantize_mantissas_blk_ch(AC3EncodeContext *s, int32_t *fixed_coef,
for
(
i
=
0
;
i
<
n
;
i
++
)
{
int
v
;
int
c
=
fixed_coef
[
i
];
int
e
=
exp
[
i
]
-
exp_shift
;
int
e
=
exp
[
i
];
int
b
=
bap
[
i
];
switch
(
b
)
{
case
0
:
...
...
@@ -1243,7 +1242,7 @@ static void quantize_mantissas(AC3EncodeContext *s)
s
->
qmant1_ptr
=
s
->
qmant2_ptr
=
s
->
qmant4_ptr
=
NULL
;
for
(
ch
=
0
;
ch
<
s
->
channels
;
ch
++
)
{
quantize_mantissas_blk_ch
(
s
,
block
->
fixed_coef
[
ch
],
block
->
exp_shift
[
ch
],
quantize_mantissas_blk_ch
(
s
,
block
->
fixed_coef
[
ch
],
block
->
exp
[
ch
],
block
->
bap
[
ch
],
block
->
qmant
[
ch
],
s
->
nb_coefs
[
ch
]);
}
...
...
@@ -1507,10 +1506,10 @@ static int ac3_encode_frame(AVCodecContext *avctx, unsigned char *frame,
apply_mdct
(
s
);
compute_rematrixing_strategy
(
s
);
scale_coefficients
(
s
);
compute_rematrixing_strategy
(
s
);
apply_rematrixing
(
s
);
process_exponents
(
s
);
...
...
libavcodec/ac3enc_fixed.c
View file @
6947b0c4
...
...
@@ -131,10 +131,10 @@ mdct_alloc_fail:
/** Complex multiply */
#define CMUL(pre, pim, are, aim, bre, bim
)
\
#define CMUL(pre, pim, are, aim, bre, bim
, rshift)
\
{ \
pre = (MUL16(are, bre) - MUL16(aim, bim)) >>
15;
\
pim = (MUL16(are, bim) + MUL16(bre, aim)) >>
15;
\
pre = (MUL16(are, bre) - MUL16(aim, bim)) >>
rshift;
\
pim = (MUL16(are, bim) + MUL16(bre, aim)) >>
rshift;
\
}
...
...
@@ -195,7 +195,7 @@ static void fft(AC3MDCTContext *mdct, IComplex *z, int ln)
p
++
;
q
++
;
for
(
l
=
nblocks
;
l
<
np2
;
l
+=
nblocks
)
{
CMUL
(
tmp_re
,
tmp_im
,
mdct
->
costab
[
l
],
-
mdct
->
sintab
[
l
],
q
->
re
,
q
->
im
);
CMUL
(
tmp_re
,
tmp_im
,
mdct
->
costab
[
l
],
-
mdct
->
sintab
[
l
],
q
->
re
,
q
->
im
,
15
);
BF
(
p
->
re
,
p
->
im
,
q
->
re
,
q
->
im
,
p
->
re
,
p
->
im
,
tmp_re
,
tmp_im
);
p
++
;
...
...
@@ -234,7 +234,7 @@ static void mdct512(AC3MDCTContext *mdct, int32_t *out, int16_t *in)
for
(
i
=
0
;
i
<
n4
;
i
++
)
{
re
=
((
int
)
rot
[
2
*
i
]
-
(
int
)
rot
[
n
-
1
-
2
*
i
])
>>
1
;
im
=
-
((
int
)
rot
[
n2
+
2
*
i
]
-
(
int
)
rot
[
n2
-
1
-
2
*
i
])
>>
1
;
CMUL
(
x
[
i
].
re
,
x
[
i
].
im
,
re
,
im
,
-
mdct
->
xcos1
[
i
],
mdct
->
xsin1
[
i
]);
CMUL
(
x
[
i
].
re
,
x
[
i
].
im
,
re
,
im
,
-
mdct
->
xcos1
[
i
],
mdct
->
xsin1
[
i
]
,
15
);
}
fft
(
mdct
,
x
,
mdct
->
nbits
-
2
);
...
...
@@ -243,7 +243,7 @@ static void mdct512(AC3MDCTContext *mdct, int32_t *out, int16_t *in)
for
(
i
=
0
;
i
<
n4
;
i
++
)
{
re
=
x
[
i
].
re
;
im
=
x
[
i
].
im
;
CMUL
(
out
[
n2
-
1
-
2
*
i
],
out
[
2
*
i
],
re
,
im
,
mdct
->
xsin1
[
i
],
mdct
->
xcos1
[
i
]);
CMUL
(
out
[
n2
-
1
-
2
*
i
],
out
[
2
*
i
],
re
,
im
,
mdct
->
xsin1
[
i
],
mdct
->
xcos1
[
i
]
,
0
);
}
}
...
...
@@ -277,46 +277,36 @@ static int log2_tab(AC3EncodeContext *s, int16_t *src, int len)
}
/**
* Left-shift each value in an array by a specified amount.
* @param tab input array
* @param n number of values in the array
* @param lshift left shift amount
*/
static
void
lshift_tab
(
int16_t
*
tab
,
int
n
,
unsigned
int
lshift
)
{
int
i
;
if
(
lshift
>
0
)
{
for
(
i
=
0
;
i
<
n
;
i
++
)
tab
[
i
]
<<=
lshift
;
}
}
/**
* Normalize the input samples to use the maximum available precision.
* This assumes signed 16-bit input samples. Exponents are reduced by 9 to
* match the 24-bit internal precision for MDCT coefficients.
* This assumes signed 16-bit input samples.
*
* @return exponent shift
*/
static
int
normalize_samples
(
AC3EncodeContext
*
s
)
{
int
v
=
14
-
log2_tab
(
s
,
s
->
windowed_samples
,
AC3_WINDOW_SIZE
);
lshift_tab
(
s
->
windowed_samples
,
AC3_WINDOW_SIZE
,
v
);
return
v
-
9
;
if
(
v
>
0
)
s
->
ac3dsp
.
ac3_lshift_int16
(
s
->
windowed_samples
,
AC3_WINDOW_SIZE
,
v
);
/* +6 to right-shift from 31-bit to 25-bit */
return
v
+
6
;
}
/**
* Scale MDCT coefficients
from float to
fixed-point.
* Scale MDCT coefficients
to 25-bit signed
fixed-point.
*/
static
void
scale_coefficients
(
AC3EncodeContext
*
s
)
{
/* scaling/conversion is obviously not needed for the fixed-point encoder
since the coefficients are already fixed-point. */
return
;
int
blk
,
ch
;
for
(
blk
=
0
;
blk
<
AC3_MAX_BLOCKS
;
blk
++
)
{
AC3Block
*
block
=
&
s
->
blocks
[
blk
];
for
(
ch
=
0
;
ch
<
s
->
channels
;
ch
++
)
{
s
->
ac3dsp
.
ac3_rshift_int32
(
block
->
mdct_coef
[
ch
],
AC3_MAX_COEFS
,
block
->
coeff_shift
[
ch
]);
}
}
}
...
...
libavcodec/ac3enc_fixed.h
View file @
6947b0c4
...
...
@@ -36,6 +36,8 @@ typedef int16_t SampleType;
typedef
int32_t
CoefType
;
typedef
int64_t
CoefSumType
;
#define MAC_COEF(d,a,b) MAC64(d,a,b)
/**
* Compex number.
...
...
libavcodec/ac3enc_float.h
View file @
6947b0c4
...
...
@@ -36,6 +36,8 @@ typedef float SampleType;
typedef
float
CoefType
;
typedef
float
CoefSumType
;
#define MAC_COEF(d,a,b) ((d)+=(a)*(b))
typedef
struct
AC3MDCTContext
{
const
float
*
window
;
///< MDCT window function
...
...
libavcodec/h264_mp4toannexb_bsf.c
View file @
6947b0c4
...
...
@@ -116,8 +116,11 @@ static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc,
memcpy
(
out
+
total_size
-
unit_size
,
extradata
+
2
,
unit_size
);
extradata
+=
2
+
unit_size
;
if
(
!
unit_nb
&&
!
sps_done
++
)
if
(
!
unit_nb
&&
!
sps_done
++
)
{
unit_nb
=
*
extradata
++
;
/* number of pps unit(s) */
if
(
unit_nb
)
pps_seen
=
1
;
}
}
if
(
out
)
...
...
libavcodec/vp8.c
View file @
6947b0c4
...
...
@@ -695,7 +695,7 @@ skip_eob:
static
av_always_inline
int
decode_block_coeffs
(
VP56RangeCoder
*
c
,
DCTELEM
block
[
16
],
uint8_t
probs
[
8
][
3
][
NUM_DCT_TOKENS
-
1
],
uint8_t
probs
[
16
][
3
][
NUM_DCT_TOKENS
-
1
],
int
i
,
int
zero_nhood
,
int16_t
qmul
[
2
])
{
uint8_t
*
token_prob
=
probs
[
i
][
zero_nhood
];
...
...
libavcodec/x86/ac3dsp.asm
View file @
6947b0c4
...
...
@@ -133,3 +133,48 @@ INIT_XMM
AC3_MAX_MSB_ABS_INT16
sse2
,
min_max
%define
ABS2
ABS2_SSSE3
AC3_MAX_MSB_ABS_INT16
ssse3
,
or_abs
;-----------------------------------------------------------------------------
; macro used for ff_ac3_lshift_int16() and ff_ac3_rshift_int32()
;-----------------------------------------------------------------------------
%macro
AC3_SHIFT
4
; l/r, 16/32, shift instruction, instruction set
cglobal
ac3_
%1
shift_int
%2
_
%4
,
3
,
3
,
5
,
src
,
len
,
shift
movd
m0
,
shiftd
.
loop
:
mova
m1
,
[
srcq
]
mova
m2
,
[
srcq
+
mmsize
]
mova
m3
,
[
srcq
+
mmsize
*
2
]
mova
m4
,
[
srcq
+
mmsize
*
3
]
%3
m1
,
m0
%3
m2
,
m0
%3
m3
,
m0
%3
m4
,
m0
mova
[
srcq
]
,
m1
mova
[
srcq
+
mmsize
]
,
m2
mova
[
srcq
+
mmsize
*
2
]
,
m3
mova
[
srcq
+
mmsize
*
3
]
,
m4
add
srcq
,
mmsize
*
4
sub
lend
,
mmsize
*
32
/
%2
ja
.
loop
.
end
:
REP_RET
%endmacro
;-----------------------------------------------------------------------------
; void ff_ac3_lshift_int16(int16_t *src, unsigned int len, unsigned int shift)
;-----------------------------------------------------------------------------
INIT_MMX
AC3_SHIFT
l
,
16
,
psllw
,
mmx
INIT_XMM
AC3_SHIFT
l
,
16
,
psllw
,
sse2
;-----------------------------------------------------------------------------
; void ff_ac3_rshift_int32(int32_t *src, unsigned int len, unsigned int shift)
;-----------------------------------------------------------------------------
INIT_MMX
AC3_SHIFT
r
,
32
,
psrad
,
mmx
INIT_XMM
AC3_SHIFT
r
,
32
,
psrad
,
sse2
libavcodec/x86/ac3dsp_mmx.c
View file @
6947b0c4
...
...
@@ -32,6 +32,12 @@ extern int ff_ac3_max_msb_abs_int16_mmxext(const int16_t *src, int len);
extern
int
ff_ac3_max_msb_abs_int16_sse2
(
const
int16_t
*
src
,
int
len
);
extern
int
ff_ac3_max_msb_abs_int16_ssse3
(
const
int16_t
*
src
,
int
len
);
extern
void
ff_ac3_lshift_int16_mmx
(
int16_t
*
src
,
unsigned
int
len
,
unsigned
int
shift
);
extern
void
ff_ac3_lshift_int16_sse2
(
int16_t
*
src
,
unsigned
int
len
,
unsigned
int
shift
);
extern
void
ff_ac3_rshift_int32_mmx
(
int32_t
*
src
,
unsigned
int
len
,
unsigned
int
shift
);
extern
void
ff_ac3_rshift_int32_sse2
(
int32_t
*
src
,
unsigned
int
len
,
unsigned
int
shift
);
av_cold
void
ff_ac3dsp_init_x86
(
AC3DSPContext
*
c
)
{
int
mm_flags
=
av_get_cpu_flags
();
...
...
@@ -40,6 +46,8 @@ av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c)
if
(
mm_flags
&
AV_CPU_FLAG_MMX
)
{
c
->
ac3_exponent_min
=
ff_ac3_exponent_min_mmx
;
c
->
ac3_max_msb_abs_int16
=
ff_ac3_max_msb_abs_int16_mmx
;
c
->
ac3_lshift_int16
=
ff_ac3_lshift_int16_mmx
;
c
->
ac3_rshift_int32
=
ff_ac3_rshift_int32_mmx
;
}
if
(
mm_flags
&
AV_CPU_FLAG_MMX2
&&
HAVE_MMX2
)
{
c
->
ac3_exponent_min
=
ff_ac3_exponent_min_mmxext
;
...
...
@@ -48,6 +56,10 @@ av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c)
if
(
mm_flags
&
AV_CPU_FLAG_SSE2
&&
HAVE_SSE
)
{
c
->
ac3_exponent_min
=
ff_ac3_exponent_min_sse2
;
c
->
ac3_max_msb_abs_int16
=
ff_ac3_max_msb_abs_int16_sse2
;
if
(
!
(
mm_flags
&
AV_CPU_FLAG_SSE2SLOW
))
{
c
->
ac3_lshift_int16
=
ff_ac3_lshift_int16_sse2
;
c
->
ac3_rshift_int32
=
ff_ac3_rshift_int32_sse2
;
}
}
if
(
mm_flags
&
AV_CPU_FLAG_SSSE3
&&
HAVE_SSSE3
)
{
c
->
ac3_max_msb_abs_int16
=
ff_ac3_max_msb_abs_int16_ssse3
;
...
...
libavformat/applehttp.c
View file @
6947b0c4
...
...
@@ -528,7 +528,7 @@ reload:
return
AVERROR_EOF
;
while
(
av_gettime
()
-
c
->
last_load_time
<
c
->
target_duration
*
1000000
)
{
if
(
url_interrupt_cb
())
return
AVERROR
(
EINTR
)
;
return
AVERROR
_EXIT
;
usleep
(
100
*
1000
);
}
/* Enough time has elapsed since the last reload */
...
...
libavformat/applehttpproto.c
View file @
6947b0c4
...
...
@@ -318,7 +318,7 @@ retry:
return
AVERROR_EOF
;
while
(
av_gettime
()
-
s
->
last_load_time
<
s
->
target_duration
*
1000000
)
{
if
(
url_interrupt_cb
())
return
AVERROR
(
EINTR
)
;
return
AVERROR
_EXIT
;
usleep
(
100
*
1000
);
}
goto
retry
;
...
...
@@ -328,7 +328,7 @@ retry:
ret
=
url_open
(
&
s
->
seg_hd
,
url
,
URL_RDONLY
);
if
(
ret
<
0
)
{
if
(
url_interrupt_cb
())
return
AVERROR
(
EINTR
)
;
return
AVERROR
_EXIT
;
av_log
(
NULL
,
AV_LOG_WARNING
,
"Unable to open %s
\n
"
,
url
);
s
->
cur_seq_no
++
;
goto
retry
;
...
...
libavformat/asfdec.c
View file @
6947b0c4
...
...
@@ -742,7 +742,7 @@ static int ff_asf_get_packet(AVFormatContext *s, AVIOContext *pb)
* imply complete -EAGAIN handling support at random positions in
* the stream.
*/
if
(
url_ferror
(
pb
)
==
AVERROR
(
EAGAIN
))
if
(
pb
->
error
==
AVERROR
(
EAGAIN
))
return
AVERROR
(
EAGAIN
);
if
(
!
url_feof
(
pb
))
av_log
(
s
,
AV_LOG_ERROR
,
"ff asf bad header %x at:%"
PRId64
"
\n
"
,
c
,
avio_tell
(
pb
));
...
...
libavformat/avio.c
View file @
6947b0c4
...
...
@@ -238,7 +238,7 @@ static inline int retry_transfer_wrapper(URLContext *h, unsigned char *buf, int
fast_retries
=
FFMAX
(
fast_retries
,
2
);
len
+=
ret
;
if
(
url_interrupt_cb
())
return
AVERROR
(
EINTR
)
;
return
AVERROR
_EXIT
;
}
return
len
;
}
...
...
libavformat/avio.h
View file @
6947b0c4
...
...
@@ -237,7 +237,7 @@ void url_get_filename(URLContext *h, char *buf, int buf_size);
/**
* The callback is called in blocking functions to test regulary if
* asynchronous interruption is needed. AVERROR
(EINTR)
is returned
* asynchronous interruption is needed. AVERROR
_EXIT
is returned
* in this case by the interrupted function. 'NULL' means no interrupt
* callback is given.
*/
...
...
@@ -432,6 +432,8 @@ attribute_deprecated int url_fgetc(AVIOContext *s);
/**
* @}
*/
attribute_deprecated
int
url_ferror
(
AVIOContext
*
s
);
#endif
AVIOContext
*
avio_alloc_context
(
...
...
@@ -500,8 +502,6 @@ int64_t avio_size(AVIOContext *s);
*/
int
url_feof
(
AVIOContext
*
s
);
int
url_ferror
(
AVIOContext
*
s
);
int
av_url_read_fpause
(
AVIOContext
*
h
,
int
pause
);
int64_t
av_url_read_fseek
(
AVIOContext
*
h
,
int
stream_index
,
int64_t
timestamp
,
int
flags
);
...
...
libavformat/aviobuf.c
View file @
6947b0c4
...
...
@@ -281,12 +281,14 @@ int url_feof(AVIOContext *s)
return
s
->
eof_reached
;
}
#if FF_API_OLD_AVIO
int
url_ferror
(
AVIOContext
*
s
)
{
if
(
!
s
)
return
0
;
return
s
->
error
;
}
#endif
void
avio_wl32
(
AVIOContext
*
s
,
unsigned
int
val
)
{
...
...
@@ -606,7 +608,7 @@ int avio_read(AVIOContext *s, unsigned char *buf, int size)
}
}
if
(
size1
==
size
)
{
if
(
url_ferror
(
s
))
return
url_ferror
(
s
)
;
if
(
s
->
error
)
return
s
->
error
;
if
(
url_feof
(
s
))
return
AVERROR_EOF
;
}
return
size1
-
size
;
...
...
@@ -629,7 +631,7 @@ int ffio_read_partial(AVIOContext *s, unsigned char *buf, int size)
memcpy
(
buf
,
s
->
buf_ptr
,
len
);
s
->
buf_ptr
+=
len
;
if
(
!
len
)
{
if
(
url_ferror
(
s
))
return
url_ferror
(
s
)
;
if
(
s
->
error
)
return
s
->
error
;
if
(
url_feof
(
s
))
return
AVERROR_EOF
;
}
return
len
;
...
...
libavformat/dsicin.c
View file @
6947b0c4
...
...
@@ -147,7 +147,7 @@ static int cin_read_frame_header(CinDemuxContext *cin, AVIOContext *pb) {
hdr
->
video_frame_size
=
avio_rl32
(
pb
);
hdr
->
audio_frame_size
=
avio_rl32
(
pb
);
if
(
url_feof
(
pb
)
||
url_ferror
(
pb
)
)
if
(
url_feof
(
pb
)
||
pb
->
error
)
return
AVERROR
(
EIO
);
if
(
avio_rl32
(
pb
)
!=
0xAA55AA55
)
...
...
libavformat/mxg.c
View file @
6947b0c4
...
...
@@ -132,7 +132,7 @@ static int mxg_read_packet(AVFormatContext *s, AVPacket *pkt)
uint8_t
*
startmarker_ptr
,
*
end
,
*
search_end
,
marker
;
MXGContext
*
mxg
=
s
->
priv_data
;
while
(
!
url_feof
(
s
->
pb
)
&&
!
url_ferror
(
s
->
pb
)
){
while
(
!
url_feof
(
s
->
pb
)
&&
!
s
->
pb
->
error
){
if
(
mxg
->
cache_size
<=
OVERREAD_SIZE
)
{
/* update internal buffer */
ret
=
mxg_update_cache
(
s
,
DEFAULT_PACKET_SIZE
+
OVERREAD_SIZE
);
...
...
libavformat/rtpproto.c
View file @
6947b0c4
...
...
@@ -241,7 +241,7 @@ static int rtp_read(URLContext *h, uint8_t *buf, int size)
#else
for
(;;)
{
if
(
url_interrupt_cb
())
return
AVERROR
(
EINTR
)
;
return
AVERROR
_EXIT
;
/* build fdset to listen to RTP and RTCP packets */
n
=
poll
(
p
,
2
,
100
);
if
(
n
>
0
)
{
...
...
libavformat/rtsp.c
View file @
6947b0c4
...
...
@@ -1565,7 +1565,7 @@ static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
for
(;;)
{
if
(
url_interrupt_cb
())
return
AVERROR
(
EINTR
)
;
return
AVERROR
_EXIT
;
if
(
wait_end
&&
wait_end
-
av_gettime
()
<
0
)
return
AVERROR
(
EAGAIN
);
max_p
=
0
;
...
...
libavformat/tcp.c
View file @
6947b0c4
...
...
@@ -73,8 +73,10 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
if
(
ret
<
0
)
{
struct
pollfd
p
=
{
fd
,
POLLOUT
,
0
};
if
(
ff_neterrno
()
==
AVERROR
(
EINTR
))
{
if
(
url_interrupt_cb
())
if
(
url_interrupt_cb
())
{
ret
=
AVERROR_EXIT
;
goto
fail1
;
}
goto
redo
;
}
if
(
ff_neterrno
()
!=
AVERROR
(
EINPROGRESS
)
&&
...
...
@@ -84,7 +86,7 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
/* wait until we are connected or until abort */
for
(;;)
{
if
(
url_interrupt_cb
())
{
ret
=
AVERROR
(
EINTR
)
;
ret
=
AVERROR
_EXIT
;
goto
fail1
;
}
ret
=
poll
(
&
p
,
1
,
100
);
...
...
libavformat/udp.c
View file @
6947b0c4
...
...
@@ -452,7 +452,7 @@ static int udp_read(URLContext *h, uint8_t *buf, int size)
for
(;;)
{
if
(
url_interrupt_cb
())
return
AVERROR
(
EINTR
)
;
return
AVERROR
_EXIT
;
ret
=
poll
(
&
p
,
1
,
100
);
if
(
ret
<
0
)
{
if
(
ff_neterrno
()
==
AVERROR
(
EINTR
))
...
...
libavformat/utils.c
View file @
6947b0c4
...
...
@@ -2267,7 +2267,7 @@ int av_find_stream_info(AVFormatContext *ic)
read_size
=
0
;
for
(;;)
{
if
(
url_interrupt_cb
()){
ret
=
AVERROR
(
EINTR
)
;
ret
=
AVERROR
_EXIT
;
av_log
(
ic
,
AV_LOG_DEBUG
,
"interrupted
\n
"
);
break
;
}
...
...
libavformat/wtv.c
View file @
6947b0c4
...
...
@@ -77,7 +77,7 @@ static int wtvfile_read_packet(void *opaque, uint8_t *buf, int buf_size)
AVIOContext
*
pb
=
wf
->
pb_filesystem
;
int
nread
=
0
;
if
(
wf
->
error
||
url_ferror
(
pb
)
)
if
(
wf
->
error
||
pb
->
error
)
return
-
1
;
if
(
wf
->
position
>=
wf
->
length
||
url_feof
(
pb
))
return
0
;
...
...
libavutil/error.c
View file @
6947b0c4
...
...
@@ -37,6 +37,7 @@ int av_strerror(int errnum, char *errbuf, size_t errbuf_size)
case
AVERROR_FILTER_NOT_FOUND
:
errstr
=
"Filter not found"
;
break
;
case
AVERROR_BSF_NOT_FOUND
:
errstr
=
"Bitstream filter not found"
;
break
;
case
AVERROR_STREAM_NOT_FOUND
:
errstr
=
"Stream not found"
;
break
;
case
AVERROR_EXIT
:
errstr
=
"Immediate exit requested"
;
break
;
}
if
(
errstr
)
{
...
...
libavutil/error.h
View file @
6947b0c4
...
...
@@ -66,6 +66,8 @@
#define AVERROR_BSF_NOT_FOUND (-MKTAG(0xF8,'B','S','F')) ///< Bitstream filter not found
#define AVERROR_STREAM_NOT_FOUND (-MKTAG(0xF8,'S','T','R')) ///< Stream not found
#define AVERROR_EXIT (-MKTAG('E','X','I','T')) ///< Immediate exit was requested; the called function should not be restarted
/**
* Put a description of the AVERROR code errnum in errbuf.
* In case of failure the global variable errno is set to indicate the
...
...
tests/ref/acodec/ac3_fixed
View file @
6947b0c4
07bd593823ebd721b3a32ef298bdfc20
*./tests/data/acodec/ac3.rm
b3a8f0a8809a58b2ece90744f06fff96
*./tests/data/acodec/ac3.rm
98751 ./tests/data/acodec/ac3.rm
tests/ref/lavf/rm
View file @
6947b0c4
d149fc272dfd21fb8908ee21d7b1651b
*./tests/data/lavf/lavf.rm
7da378131db880bcf2e58305d54418ec
*./tests/data/lavf/lavf.rm
346706 ./tests/data/lavf/lavf.rm
tests/ref/seek/ac3_rm
View file @
6947b0c4
...
...
@@ -4,28 +4,29 @@ ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556
ret: 0 st:-1 flags:1 ts: 1.894167
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556
ret: 0 st: 0 flags:0 ts: 0.788000
ret: 0 st: 0 flags:1 dts:
4160806.587000 pts:4160806.587000 pos: 3883 size: 1
16
ret: 0 st: 0 flags:1 dts:
12581.487000 pts:12581.487000 pos: 5822 size: 9
16
ret: 0 st: 0 flags:1 ts:-0.317000
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556
ret: 0 st:-1 flags:0 ts: 2.576668
ret: 0 st: 0 flags:1 dts:
4160806.587000 pts:4160806.587000 pos: 3883 size: 116
ret: 0 st: 0 flags:1 dts:
524.800000 pts:524.800000 pos: 6155 size: 244
ret:-1 st:-1 flags:1 ts: 1.470835
ret: 0 st: 0 flags:0 ts: 0.365000
ret: 0 st: 0 flags:1 dts:
4160806.587000 pts:4160806.587000 pos: 3883 size: 1
16
ret: 0 st: 0 flags:1 dts:
12581.487000 pts:12581.487000 pos: 5822 size: 9
16
ret: 0 st: 0 flags:1 ts:-0.741000
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556
ret:-1 st:-1 flags:0 ts: 2.153336
ret:-1 st:-1 flags:1 ts: 1.047503
ret: 0 st:-1 flags:1 ts: 1.047503
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556
ret: 0 st: 0 flags:0 ts:-0.058000
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556
ret:-1 st: 0 flags:1 ts: 2.836000
ret: 0 st: 0 flags:1 ts: 2.836000
ret: 0 st: 0 flags:1 dts: 2.681000 pts: 2.681000 pos: 44105 size: 558
ret:-1 st:-1 flags:0 ts: 1.730004
ret: 0 st:-1 flags:1 ts: 0.624171
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556
ret: 0 st: 0 flags:0 ts:-0.482000
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556
ret: 0 st: 0 flags:1 ts: 2.413000
ret: 0 st: 0 flags:1 dts: 2.229000 pts: 2.229000 pos: 36705 size: 556
ret:-1 st: 0 flags:1 ts: 2.413000
ret:-1 st:-1 flags:0 ts: 1.306672
ret: 0 st:-1 flags:1 ts: 0.200839
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556
...
...
@@ -33,13 +34,12 @@ ret: 0 st: 0 flags:0 ts:-0.905000
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556
ret:-1 st: 0 flags:1 ts: 1.989000
ret: 0 st:-1 flags:0 ts: 0.883340
ret: 0 st: 0 flags:1 dts:
4160806.587000 pts:4160806.587000 pos: 3883 size: 1
16
ret: 0 st: 0 flags:1 dts:
12581.487000 pts:12581.487000 pos: 5822 size: 9
16
ret: 0 st:-1 flags:1 ts:-0.222493
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556
ret: 0 st: 0 flags:0 ts: 2.672000
ret: 0 st: 0 flags:1 dts:6354.691000 pts:6354.691000 pos: 10783 size: 304
ret:-1 st: 0 flags:0 ts: 2.672000
ret:-1 st: 0 flags:1 ts: 1.566000
ret: 0 st:-1 flags:0 ts: 0.460008
ret: 0 st: 0 flags:1 dts:
4160806.587000 pts:4160806.587000 pos: 3883 size: 1
16
ret: 0 st: 0 flags:1 dts:
12581.487000 pts:12581.487000 pos: 5822 size: 9
16
ret: 0 st:-1 flags:1 ts:-0.645825
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment