Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
1a860388
Commit
1a860388
authored
Jan 30, 2004
by
Rocky Bernstein
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Doc calculation typo.
parent
5dab5a0d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
modules/codec/ogt/pixmap.c
modules/codec/ogt/pixmap.c
+11
-9
No files found.
modules/codec/ogt/pixmap.c
View file @
1a860388
...
...
@@ -2,7 +2,7 @@
* Common pixel/chroma manipulation routines.
*****************************************************************************
* Copyright (C) 2003, 2004 VideoLAN
* $Id: pixmap.c,v 1.
1 2004/01/30 13:17:12
rocky Exp $
* $Id: pixmap.c,v 1.
2 2004/01/30 13:23:08
rocky Exp $
*
* Author: Rocky Bernstein
*
...
...
@@ -149,14 +149,16 @@ find_cmap_rgb8_nearest(const vout_thread_t *p_vout, const ogt_yuvt_t *p_yuv,
/* Interval range calculations to show that we don't overflow the
word sizes below. pixels component values start out 8
bits. When we subtract two components we get 9 bits, then
square to 10 bits. Next we scale by 6 we get 16 bits. XXX_COEF
all fit into 5 bits, so when we multiply we should have 21 bits
maximum. So computations can be done using 32-bit
precision. However before storing back distance components we
scale back down by 12 bits making the precision 9 bits.
The squared distance is the sum of three of the 9-bit numbers
described above. This then uses 21-bits and also fits in a
square to 10 bits. Next we scale by 6 to give 16
bits. XXX_COEF all fit into 5 bits, so when we multiply we
should have 21 bits maximum. So computations can be done using
32-bit precision. However before storing back distance
components we scale back down by 12 bits making the precision 9
bits. (This checks out since it is basically the range of the
square of the initial 8-bit value.)
The squared distance is the sum of three of the 9-bit components
described above. This then uses 27-bits and also fits in a
32-bit word.
*/
...
...
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