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
f236aa47
Commit
f236aa47
authored
Sep 14, 2008
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wording/spelling
Originally committed as revision 15333 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
8fd64adf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
30 deletions
+29
-30
swscale.txt
doc/swscale.txt
+29
-30
No files found.
doc/swscale.txt
View file @
f236aa47
...
@@ -26,7 +26,7 @@ Current (simplified) Architecture:
...
@@ -26,7 +26,7 @@ Current (simplified) Architecture:
Swscale has 2 scaler paths. Each side must be capable of handling
Swscale has 2 scaler paths. Each side must be capable of handling
slices, that is, consecutive non-overlapping rectangles of dimension
slices, that is, consecutive non-overlapping rectangles of dimension
(0,slice_top) - (picture_width, slice_bottom)
(0,slice_top) - (picture_width, slice_bottom)
.
special converter
special converter
These generally are unscaled converters of common
These generally are unscaled converters of common
...
@@ -37,64 +37,63 @@ Main path
...
@@ -37,64 +37,63 @@ Main path
The main path is used when no special converter can be used. The code
The main path is used when no special converter can be used. The code
is designed as a destination line pull architecture. That is, for each
is designed as a destination line pull architecture. That is, for each
output line the vertical scaler pulls lines from a ring buffer. When
output line the vertical scaler pulls lines from a ring buffer. When
the ring buffer does not contain the wanted line then it is pulled from
the ring buffer does not contain the wanted line
,
then it is pulled from
the input slice through the input converter and horizontal scaler
, and
the input slice through the input converter and horizontal scaler
.
t
he result is also stored in the ring buffer to serve future vertical
T
he result is also stored in the ring buffer to serve future vertical
scaler requests.
scaler requests.
When no more output can be generated because lines from a future slice
When no more output can be generated because lines from a future slice
would be needed, then all remaining lines in the current slice are
would be needed, then all remaining lines in the current slice are
converted, horizontally scaled and put in the ring buffer.
converted, horizontally scaled and put in the ring buffer.
[
t
his is done for luma and chroma, each with possibly different numbers
[
T
his is done for luma and chroma, each with possibly different numbers
of lines per picture]
of lines per picture
.
]
Input to YUV Converter
Input to YUV Converter
When the input to the main path is not planar 8
bit per component yuv
or
When the input to the main path is not planar 8
bits per component YUV
or
8
bit gray then it is converted to planar 8
bit YUV. 2 sets of converters
8
-bit gray then it is converted to planar 8-
bit YUV. 2 sets of converters
exist for this currently
, one performing
horizontal downscaling by 2
exist for this currently
: One performs
horizontal downscaling by 2
before the conversion
and the other leaving
the full chroma resolution
before the conversion
, the other leaves
the full chroma resolution
but
being
slightly slower. The scaler will try to preserve full chroma
but
is
slightly slower. The scaler will try to preserve full chroma
here when the output uses it. It is possible to force full chroma with
here when the output uses it. It is possible to force full chroma with
SWS_FULL_CHR_H_INP though even for cases where the scaler thinks it is
SWS_FULL_CHR_H_INP even for cases where the scaler thinks it is useless.
useless.
Horizontal scaler
Horizontal scaler
There are several horizontal scalers. A special case worth mentioning is
There are several horizontal scalers. A special case worth mentioning is
the fast bilinear scaler that is made of runtime
generated MMX2 code
the fast bilinear scaler that is made of runtime
-
generated MMX2 code
using specially tuned pshufw instructions.
using specially tuned pshufw instructions.
The remaining scalers are specially
tuned for various filter lengths.
The remaining scalers are specially
-
tuned for various filter lengths.
They scale 8
bit unsigned planar data to 16
bit signed planar data.
They scale 8
-bit unsigned planar data to 16-
bit signed planar data.
Future >8
bit
per component inputs will need to add a new scaler here
Future >8
bits
per component inputs will need to add a new scaler here
that preserves the input precision.
that preserves the input precision.
Vertical scaler and output converter
Vertical scaler and output converter
There is a large number of combined vertical scalers
+output converters
There is a large number of combined vertical scalers
+ output converters.
Some are:
Some are:
* unscaled output converters
* unscaled output converters
* unscaled output converters that average 2 chroma lines
* unscaled output converters that average 2 chroma lines
* bilinear converters (C, MMX and accurate MMX)
* bilinear converters (C, MMX and accurate MMX)
* arbitrary filter length converters (C, MMX and accurate MMX)
* arbitrary filter length converters (C, MMX and accurate MMX)
And
And
* Plain C 8bit 4:2:2 YUV -> RGB converters using LUTs
* Plain C 8
-
bit 4:2:2 YUV -> RGB converters using LUTs
* Plain C 17bit 4:4:4 YUV -> RGB converters using multiplies
* Plain C 17
-
bit 4:4:4 YUV -> RGB converters using multiplies
* MMX 11bit 4:2:2 YUV -> RGB converters
* MMX 11
-
bit 4:2:2 YUV -> RGB converters
* Plain C 16
bit Y -> 16
bit gray
* Plain C 16
-bit Y -> 16-
bit gray
...
...
RGB with less than 8
bit
per component uses dither to improve the
RGB with less than 8
bits
per component uses dither to improve the
subjective quality and low
frequency accuracy.
subjective quality and low
-
frequency accuracy.
Filter coefficients:
Filter coefficients:
--------------------
--------------------
There are several different scalers (bilinear, bicubic, lanczos, area,
sinc, ...)
There are several different scalers (bilinear, bicubic, lanczos, area,
Their coefficients are calculated in initFilter().
sinc, ...).
Their coefficients are calculated in initFilter().
Horizontal filter coeff
s have a 1.0 point at 1<<14, vertical ones at 1<<12.
Horizontal filter coeff
icients have a 1.0 point at 1 << 14, vertical ones at
The 1.0 points have been chosen to maximize precision while leaving a
1 << 12. The 1.0 points have been chosen to maximize precision while leaving
little headroom for convolutional filters like sharpening filters and
a
little headroom for convolutional filters like sharpening filters and
minimizing SIMD instructions needed to apply them.
minimizing SIMD instructions needed to apply them.
It would be trivial to use a different 1.0 point if some specific scaler
It would be trivial to use a different 1.0 point if some specific scaler
would benefit from it.
would benefit from it.
Also as already hinted at, initFilter() accepts an optional convolutional
Also
,
as already hinted at, initFilter() accepts an optional convolutional
filter as input that can be used for contrast, saturation, blur, sharpening
filter as input that can be used for contrast, saturation, blur, sharpening
shift, chroma vs. luma shift, ...
shift, chroma vs. luma shift, ...
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