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
aa872af5
Commit
aa872af5
authored
Jan 30, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ac3enc: update to AVCodec.encode2()
Update FATE references due to encoder delay.
parent
ad95307f
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
41 additions
and
22 deletions
+41
-22
ac3enc.c
libavcodec/ac3enc.c
+9
-0
ac3enc.h
libavcodec/ac3enc.h
+4
-4
ac3enc_fixed.c
libavcodec/ac3enc_fixed.c
+2
-1
ac3enc_float.c
libavcodec/ac3enc_float.c
+2
-1
ac3enc_template.c
libavcodec/ac3enc_template.c
+13
-5
eac3enc.c
libavcodec/eac3enc.c
+1
-1
rm
tests/ref/lavf/rm
+1
-1
lavf_rm
tests/ref/seek/lavf_rm
+9
-9
No files found.
libavcodec/ac3enc.c
View file @
aa872af5
...
...
@@ -2053,7 +2053,9 @@ av_cold int ff_ac3_encode_close(AVCodecContext *avctx)
s
->
mdct_end
(
s
);
#if FF_API_OLD_ENCODE_AUDIO
av_freep
(
&
avctx
->
coded_frame
);
#endif
return
0
;
}
...
...
@@ -2437,6 +2439,7 @@ av_cold int ff_ac3_encode_init(AVCodecContext *avctx)
return
ret
;
avctx
->
frame_size
=
AC3_BLOCK_SIZE
*
s
->
num_blocks
;
avctx
->
delay
=
AC3_BLOCK_SIZE
;
s
->
bitstream_mode
=
avctx
->
audio_service_type
;
if
(
s
->
bitstream_mode
==
AV_AUDIO_SERVICE_TYPE_KARAOKE
)
...
...
@@ -2482,7 +2485,13 @@ av_cold int ff_ac3_encode_init(AVCodecContext *avctx)
if
(
ret
)
goto
init_fail
;
#if FF_API_OLD_ENCODE_AUDIO
avctx
->
coded_frame
=
avcodec_alloc_frame
();
if
(
!
avctx
->
coded_frame
)
{
ret
=
AVERROR
(
ENOMEM
);
goto
init_fail
;
}
#endif
ff_dsputil_init
(
&
s
->
dsp
,
avctx
);
ff_ac3dsp_init
(
&
s
->
ac3dsp
,
avctx
->
flags
&
CODEC_FLAG_BITEXACT
);
...
...
libavcodec/ac3enc.h
View file @
aa872af5
...
...
@@ -297,9 +297,9 @@ int ff_ac3_float_mdct_init(AC3EncodeContext *s);
int
ff_ac3_fixed_allocate_sample_buffers
(
AC3EncodeContext
*
s
);
int
ff_ac3_float_allocate_sample_buffers
(
AC3EncodeContext
*
s
);
int
ff_ac3_fixed_encode_frame
(
AVCodecContext
*
avctx
,
unsigned
char
*
frame
,
int
buf_size
,
void
*
data
);
int
ff_ac3_float_encode_frame
(
AVCodecContext
*
avctx
,
unsigned
char
*
frame
,
int
buf_size
,
void
*
data
);
int
ff_ac3_fixed_encode_frame
(
AVCodecContext
*
avctx
,
AVPacket
*
avpkt
,
const
AVFrame
*
frame
,
int
*
got_packet_ptr
);
int
ff_ac3_float_encode_frame
(
AVCodecContext
*
avctx
,
AVPacket
*
avpkt
,
const
AVFrame
*
frame
,
int
*
got_packet_ptr
);
#endif
/* AVCODEC_AC3ENC_H */
libavcodec/ac3enc_fixed.c
View file @
aa872af5
...
...
@@ -28,6 +28,7 @@
#define CONFIG_FFT_FLOAT 0
#undef CONFIG_AC3ENC_FLOAT
#include "internal.h"
#include "ac3enc.h"
#include "eac3enc.h"
...
...
@@ -145,7 +146,7 @@ AVCodec ff_ac3_fixed_encoder = {
.
id
=
CODEC_ID_AC3
,
.
priv_data_size
=
sizeof
(
AC3EncodeContext
),
.
init
=
ac3_fixed_encode_init
,
.
encode
=
ff_ac3_fixed_encode_frame
,
.
encode
2
=
ff_ac3_fixed_encode_frame
,
.
close
=
ff_ac3_encode_close
,
.
sample_fmts
=
(
const
enum
AVSampleFormat
[]){
AV_SAMPLE_FMT_S16
,
AV_SAMPLE_FMT_NONE
},
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"ATSC A/52A (AC-3)"
),
...
...
libavcodec/ac3enc_float.c
View file @
aa872af5
...
...
@@ -27,6 +27,7 @@
*/
#define CONFIG_AC3ENC_FLOAT 1
#include "internal.h"
#include "ac3enc.h"
#include "eac3enc.h"
#include "kbdwin.h"
...
...
@@ -143,7 +144,7 @@ AVCodec ff_ac3_encoder = {
.
id
=
CODEC_ID_AC3
,
.
priv_data_size
=
sizeof
(
AC3EncodeContext
),
.
init
=
ff_ac3_encode_init
,
.
encode
=
ff_ac3_float_encode_frame
,
.
encode
2
=
ff_ac3_float_encode_frame
,
.
close
=
ff_ac3_encode_close
,
.
sample_fmts
=
(
const
enum
AVSampleFormat
[]){
AV_SAMPLE_FMT_FLT
,
AV_SAMPLE_FMT_NONE
},
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"ATSC A/52A (AC-3)"
),
...
...
libavcodec/ac3enc_template.c
View file @
aa872af5
...
...
@@ -391,11 +391,11 @@ static void compute_rematrixing_strategy(AC3EncodeContext *s)
}
int
AC3_NAME
(
encode_frame
)(
AVCodecContext
*
avctx
,
unsigned
char
*
frame
,
int
buf_size
,
void
*
data
)
int
AC3_NAME
(
encode_frame
)(
AVCodecContext
*
avctx
,
AVPacket
*
avpkt
,
const
AVFrame
*
frame
,
int
*
got_packet_ptr
)
{
AC3EncodeContext
*
s
=
avctx
->
priv_data
;
const
SampleType
*
samples
=
data
;
const
SampleType
*
samples
=
(
const
SampleType
*
)
frame
->
data
[
0
]
;
int
ret
;
if
(
s
->
options
.
allow_per_frame_metadata
)
{
...
...
@@ -442,7 +442,15 @@ int AC3_NAME(encode_frame)(AVCodecContext *avctx, unsigned char *frame,
ff_ac3_quantize_mantissas
(
s
);
ff_ac3_output_frame
(
s
,
frame
);
if
((
ret
=
ff_alloc_packet
(
avpkt
,
s
->
frame_size
)))
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Error getting output packet
\n
"
);
return
ret
;
}
ff_ac3_output_frame
(
s
,
avpkt
->
data
);
return
s
->
frame_size
;
if
(
frame
->
pts
!=
AV_NOPTS_VALUE
)
avpkt
->
pts
=
frame
->
pts
-
ff_samples_to_time_base
(
avctx
,
avctx
->
delay
);
*
got_packet_ptr
=
1
;
return
0
;
}
libavcodec/eac3enc.c
View file @
aa872af5
...
...
@@ -252,7 +252,7 @@ AVCodec ff_eac3_encoder = {
.
id
=
CODEC_ID_EAC3
,
.
priv_data_size
=
sizeof
(
AC3EncodeContext
),
.
init
=
ff_ac3_encode_init
,
.
encode
=
ff_ac3_float_encode_frame
,
.
encode
2
=
ff_ac3_float_encode_frame
,
.
close
=
ff_ac3_encode_close
,
.
sample_fmts
=
(
const
enum
AVSampleFormat
[]){
AV_SAMPLE_FMT_FLT
,
AV_SAMPLE_FMT_NONE
},
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"ATSC A/52 E-AC-3"
),
...
...
tests/ref/lavf/rm
View file @
aa872af5
f3ce1f1850655ae43f6184ae436acb70
*./tests/data/lavf/lavf.rm
c002d460bc77043ced69fd00f4ae7968
*./tests/data/lavf/lavf.rm
346414 ./tests/data/lavf/lavf.rm
tests/ref/seek/lavf_rm
View file @
aa872af5
ret: 0 st:
0 flags:1 dts: 0.000000 pts: 0.000000 pos: 398 size: 31082
ret: 0 st:
1 flags:1 dts: 0.000000 pts: 0.000000 pos: 387 size: 278
ret: 0 st:-1 flags:0 ts:-1.000000
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:
39
8 size: 31082
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:
68
8 size: 31082
ret: 0 st:-1 flags:1 ts: 1.894167
ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 314982 size: 31143
ret: 0 st: 0 flags:0 ts: 0.788000
ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 314982 size: 31143
ret: 0 st: 0 flags:1 ts:-0.317000
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:
39
8 size: 31082
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:
68
8 size: 31082
ret: 0 st: 1 flags:0 ts: 2.577000
ret: 0 st: 1 flags:1 dts: 0.975000 pts: 0.975000 pos: 346128 size: 278
ret: 0 st: 1 flags:1 ts: 1.471000
...
...
@@ -14,13 +14,13 @@ ret: 0 st: 1 flags:1 dts: 0.975000 pts: 0.975000 pos: 346128 size: 278
ret: 0 st:-1 flags:0 ts: 0.365002
ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 158515 size: 31134
ret: 0 st:-1 flags:1 ts:-0.740831
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:
39
8 size: 31082
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:
68
8 size: 31082
ret: 0 st: 0 flags:0 ts: 2.153000
ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 314982 size: 31143
ret: 0 st: 0 flags:1 ts: 1.048000
ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 314982 size: 31143
ret: 0 st: 1 flags:0 ts:-0.058000
ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos:
31483
size: 278
ret: 0 st: 1 flags:1 dts: 0.000000 pts: 0.000000 pos:
387
size: 278
ret: 0 st: 1 flags:1 ts: 2.836000
ret: 0 st: 1 flags:1 dts: 0.975000 pts: 0.975000 pos: 346128 size: 278
ret: 0 st:-1 flags:0 ts: 1.730004
...
...
@@ -28,7 +28,7 @@ ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 314982 size: 31143
ret: 0 st:-1 flags:1 ts: 0.624171
ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 158515 size: 31134
ret: 0 st: 0 flags:0 ts:-0.482000
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:
39
8 size: 31082
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:
68
8 size: 31082
ret: 0 st: 0 flags:1 ts: 2.413000
ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 314982 size: 31143
ret: 0 st: 1 flags:0 ts: 1.307000
...
...
@@ -36,13 +36,13 @@ ret: 0 st: 1 flags:1 dts: 0.975000 pts: 0.975000 pos: 346128 size: 278
ret: 0 st: 1 flags:1 ts: 0.201000
ret: 0 st: 1 flags:1 dts: 0.174000 pts: 0.174000 pos: 78969 size: 278
ret: 0 st:-1 flags:0 ts:-0.904994
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:
39
8 size: 31082
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:
68
8 size: 31082
ret: 0 st:-1 flags:1 ts: 1.989173
ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 314982 size: 31143
ret: 0 st: 0 flags:0 ts: 0.883000
ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 314982 size: 31143
ret: 0 st: 0 flags:1 ts:-0.222000
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:
39
8 size: 31082
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:
68
8 size: 31082
ret: 0 st: 1 flags:0 ts: 2.672000
ret: 0 st: 1 flags:1 dts: 0.975000 pts: 0.975000 pos: 346128 size: 278
ret: 0 st: 1 flags:1 ts: 1.566000
...
...
@@ -50,4 +50,4 @@ ret: 0 st: 1 flags:1 dts: 0.975000 pts: 0.975000 pos: 346128 size: 278
ret: 0 st:-1 flags:0 ts: 0.460008
ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 158515 size: 31134
ret: 0 st:-1 flags:1 ts:-0.645825
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:
39
8 size: 31082
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:
68
8 size: 31082
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