Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
85990140
Commit
85990140
authored
Dec 03, 2015
by
Alexandra Hájková
Committed by
Janne Grunau
Dec 23, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dca: Add math helpers.
They will be used by the integer core decoder.
parent
489e6add
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
dcamath.h
libavcodec/dcamath.h
+42
-0
No files found.
libavcodec/dcamath.h
0 → 100644
View file @
85990140
/*
* This file is part of Libav.
*
* Libav is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* Libav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/common.h"
// clip a signed integer into the (-2^23), (2^23-1) range
static
inline
int
dca_clip23
(
int
a
)
{
return
av_clip_intp2
(
a
,
23
);
}
static
inline
int32_t
dca_norm
(
int64_t
a
,
int
bits
)
{
if
(
bits
>
0
)
return
(
int32_t
)((
a
+
(
INT64_C
(
1
)
<<
(
bits
-
1
)))
>>
bits
);
else
return
(
int32_t
)
a
;
}
static
inline
int64_t
dca_round
(
int64_t
a
,
int
bits
)
{
if
(
bits
>
0
)
return
(
a
+
(
INT64_C
(
1
)
<<
(
bits
-
1
)))
&
~
((
INT64_C
(
1
)
<<
bits
)
-
1
);
else
return
a
;
}
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