| OLD | NEW |
| 1 The official guide to swscale for confused developers. | 1 The official guide to swscale for confused developers. |
| 2 ======================================================== | 2 ======================================================== |
| 3 | 3 |
| 4 Current (simplified) Architecture: | 4 Current (simplified) Architecture: |
| 5 --------------------------------- | 5 --------------------------------- |
| 6 Input | 6 Input |
| 7 v | 7 v |
| 8 _______OR_________ | 8 _______OR_________ |
| 9 / \ | 9 / \ |
| 10 / \ | 10 / \ |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 v v | 23 v v |
| 24 output | 24 output |
| 25 | 25 |
| 26 | 26 |
| 27 Swscale has 2 scaler paths. Each side must be capable of handling | 27 Swscale has 2 scaler paths. Each side must be capable of handling |
| 28 slices, that is, consecutive non-overlapping rectangles of dimension | 28 slices, that is, consecutive non-overlapping rectangles of dimension |
| 29 (0,slice_top) - (picture_width, slice_bottom). | 29 (0,slice_top) - (picture_width, slice_bottom). |
| 30 | 30 |
| 31 special converter | 31 special converter |
| 32 These generally are unscaled converters of common | 32 These generally are unscaled converters of common |
| 33 formats, like YUV 4:2:0/4:2:2 -> RGB15/16/24/32. Though it could also | 33 formats, like YUV 4:2:0/4:2:2 -> RGB12/15/16/24/32. Though it could also |
| 34 in principle contain scalers optimized for specific common cases. | 34 in principle contain scalers optimized for specific common cases. |
| 35 | 35 |
| 36 Main path | 36 Main path |
| 37 The main path is used when no special converter can be used. The code | 37 The main path is used when no special converter can be used. The code |
| 38 is designed as a destination line pull architecture. That is, for each | 38 is designed as a destination line pull architecture. That is, for each |
| 39 output line the vertical scaler pulls lines from a ring buffer. When | 39 output line the vertical scaler pulls lines from a ring buffer. When |
| 40 the ring buffer does not contain the wanted line, then it is pulled from | 40 the ring buffer does not contain the wanted line, then it is pulled from |
| 41 the input slice through the input converter and horizontal scaler. | 41 the input slice through the input converter and horizontal scaler. |
| 42 The result is also stored in the ring buffer to serve future vertical | 42 The result is also stored in the ring buffer to serve future vertical |
| 43 scaler requests. | 43 scaler requests. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 Horizontal filter coefficients have a 1.0 point at 1 << 14, vertical ones at | 90 Horizontal filter coefficients have a 1.0 point at 1 << 14, vertical ones at |
| 91 1 << 12. The 1.0 points have been chosen to maximize precision while leaving | 91 1 << 12. The 1.0 points have been chosen to maximize precision while leaving |
| 92 a little headroom for convolutional filters like sharpening filters and | 92 a little headroom for convolutional filters like sharpening filters and |
| 93 minimizing SIMD instructions needed to apply them. | 93 minimizing SIMD instructions needed to apply them. |
| 94 It would be trivial to use a different 1.0 point if some specific scaler | 94 It would be trivial to use a different 1.0 point if some specific scaler |
| 95 would benefit from it. | 95 would benefit from it. |
| 96 Also, as already hinted at, initFilter() accepts an optional convolutional | 96 Also, as already hinted at, initFilter() accepts an optional convolutional |
| 97 filter as input that can be used for contrast, saturation, blur, sharpening | 97 filter as input that can be used for contrast, saturation, blur, sharpening |
| 98 shift, chroma vs. luma shift, ... | 98 shift, chroma vs. luma shift, ... |
| 99 | 99 |
| OLD | NEW |