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
2d9a101a
Commit
2d9a101a
authored
Mar 04, 2011
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ac3enc: add some assertions
parent
7100d63c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
ac3enc.c
libavcodec/ac3enc.c
+6
-0
No files found.
libavcodec/ac3enc.c
View file @
2d9a101a
...
@@ -428,6 +428,7 @@ static void extract_exponents(AC3EncodeContext *s)
...
@@ -428,6 +428,7 @@ static void extract_exponents(AC3EncodeContext *s)
e
=
24
;
e
=
24
;
coef
[
i
]
=
0
;
coef
[
i
]
=
0
;
}
}
av_assert2
(
e
>=
0
);
}
}
exp
[
i
]
=
e
;
exp
[
i
]
=
e
;
}
}
...
@@ -650,16 +651,19 @@ static void group_exponents(AC3EncodeContext *s)
...
@@ -650,16 +651,19 @@ static void group_exponents(AC3EncodeContext *s)
exp1
=
p
[
0
];
exp1
=
p
[
0
];
p
+=
group_size
;
p
+=
group_size
;
delta0
=
exp1
-
exp0
+
2
;
delta0
=
exp1
-
exp0
+
2
;
av_assert2
(
delta0
>=
0
&&
delta0
<=
4
);
exp0
=
exp1
;
exp0
=
exp1
;
exp1
=
p
[
0
];
exp1
=
p
[
0
];
p
+=
group_size
;
p
+=
group_size
;
delta1
=
exp1
-
exp0
+
2
;
delta1
=
exp1
-
exp0
+
2
;
av_assert2
(
delta1
>=
0
&&
delta1
<=
4
);
exp0
=
exp1
;
exp0
=
exp1
;
exp1
=
p
[
0
];
exp1
=
p
[
0
];
p
+=
group_size
;
p
+=
group_size
;
delta2
=
exp1
-
exp0
+
2
;
delta2
=
exp1
-
exp0
+
2
;
av_assert2
(
delta2
>=
0
&&
delta2
<=
4
);
block
->
grouped_exp
[
ch
][
i
]
=
((
delta0
*
5
+
delta1
)
*
5
)
+
delta2
;
block
->
grouped_exp
[
ch
][
i
]
=
((
delta0
*
5
+
delta1
)
*
5
)
+
delta2
;
}
}
...
@@ -947,6 +951,7 @@ static int cbr_bit_allocation(AC3EncodeContext *s)
...
@@ -947,6 +951,7 @@ static int cbr_bit_allocation(AC3EncodeContext *s)
int
snr_offset
,
snr_incr
;
int
snr_offset
,
snr_incr
;
bits_left
=
8
*
s
->
frame_size
-
(
s
->
frame_bits
+
s
->
exponent_bits
);
bits_left
=
8
*
s
->
frame_size
-
(
s
->
frame_bits
+
s
->
exponent_bits
);
av_assert2
(
bits_left
>=
0
);
snr_offset
=
s
->
coarse_snr_offset
<<
4
;
snr_offset
=
s
->
coarse_snr_offset
<<
4
;
...
@@ -1438,6 +1443,7 @@ static void output_frame_end(AC3EncodeContext *s)
...
@@ -1438,6 +1443,7 @@ static void output_frame_end(AC3EncodeContext *s)
frame_size_58
=
((
s
->
frame_size
>>
2
)
+
(
s
->
frame_size
>>
4
))
<<
1
;
frame_size_58
=
((
s
->
frame_size
>>
2
)
+
(
s
->
frame_size
>>
4
))
<<
1
;
/* pad the remainder of the frame with zeros */
/* pad the remainder of the frame with zeros */
av_assert2
(
s
->
frame_size
*
8
-
put_bits_count
(
&
s
->
pb
)
>=
18
);
flush_put_bits
(
&
s
->
pb
);
flush_put_bits
(
&
s
->
pb
);
frame
=
s
->
pb
.
buf
;
frame
=
s
->
pb
.
buf
;
pad_bytes
=
s
->
frame_size
-
(
put_bits_ptr
(
&
s
->
pb
)
-
frame
)
-
2
;
pad_bytes
=
s
->
frame_size
-
(
put_bits_ptr
(
&
s
->
pb
)
-
frame
)
-
2
;
...
...
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