Go to the documentation of this file.
35 ptrdiff_t mask_stride,
37 ptrdiff_t srcy_stride,
40 ptrdiff_t srcuv_stride,
45 for (
i = 0, j = 0, k = 0;
i <
w; j += (
i & 1),
i++, k += 3) {
46 if (!use_mask ||
mask[
i] == maskcolor) {
48 dst[k] = dst[k + 1] = dst[k + 2] = 0x80;
51 int u = srcu[j] - 128;
52 int v = srcv[j] - 128;
62 srcu += srcuv_stride * (
r & 1);
63 srcv += srcuv_stride * (
r & 1);
68 const uint8_t *srcy, ptrdiff_t srcy_stride,
69 const uint8_t *srcu,
const uint8_t *srcv,
70 ptrdiff_t srcuv_stride,
int w,
int h)
75 srcu, srcv, srcuv_stride,
80 int maskcolor,
const uint8_t *
mask,
81 ptrdiff_t mask_stride,
82 const uint8_t *srcy, ptrdiff_t srcy_stride,
83 const uint8_t *srcu,
const uint8_t *srcv,
84 ptrdiff_t srcuv_stride,
int w,
int h)
87 maskcolor,
mask, mask_stride,
89 srcu, srcv, srcuv_stride,
94 int maskcolor,
const uint8_t *
mask,
95 ptrdiff_t mask_stride,
int w,
int h)
98 maskcolor,
mask, mask_stride,
106 uint8_t *
src1, *src2, *dst1, *dst2, *p,
a,
b;
117 memcpy(plane + plane_stride * j,
118 plane + plane_stride * (j >> 1),
121 while ((j -= 2) > 0) {
122 dst1 = plane + plane_stride * (j + 1);
123 dst2 = plane + plane_stride * j;
124 src1 = plane + plane_stride * ((j + 1) >> 1);
125 src2 = plane + plane_stride * ( j >> 1);
127 for (
i = (
w - 1) >> 1;
i >= 0;
i--) {
130 dst1[
i] = (3 *
a +
b + 2) >> 2;
131 dst2[
i] = (
a + 3 *
b + 2) >> 2;
135 for (j =
h - 1; j >= 0; j--) {
136 p = plane + plane_stride * j;
141 while ((
i -= 2) > 0) {
144 p[
i] = (3 *
a +
b + 1) >> 2;
145 p[
i + 1] = (
a + 3 *
b + 1) >> 2;
#define u(width, name, range_min, range_max)
void(* upsample_plane)(uint8_t *plane, ptrdiff_t plane_stride, int w, int h)
av_cold void ff_mss2dsp_init(MSS2DSPContext *dsp)
static const uint16_t mask[17]
void(* mss2_gray_fill_masked)(uint8_t *dst, ptrdiff_t dst_stride, int maskcolor, const uint8_t *mask, ptrdiff_t mask_stride, int w, int h)
void(* mss2_blit_wmv9_masked)(uint8_t *dst, ptrdiff_t dst_stride, int maskcolor, const uint8_t *mask, ptrdiff_t mask_stride, const uint8_t *srcy, ptrdiff_t srcy_stride, const uint8_t *srcu, const uint8_t *srcv, ptrdiff_t srcuv_stride, int w, int h)
void(* mss2_blit_wmv9)(uint8_t *dst, ptrdiff_t dst_stride, const uint8_t *srcy, ptrdiff_t srcy_stride, const uint8_t *srcu, const uint8_t *srcv, ptrdiff_t srcuv_stride, int w, int h)
static void upsample_plane_c(uint8_t *plane, ptrdiff_t plane_stride, int w, int h)
The official guide to swscale for confused that consecutive non overlapping rectangles of slice_bottom special converter These generally are unscaled converters of common like for each output line the vertical scaler pulls lines from a ring buffer When the ring buffer does not contain the wanted then it is pulled from the input slice through the input converter and horizontal scaler The result is also stored in the ring buffer to serve future vertical scaler requests When no more output can be generated because lines from a future slice would be then all remaining lines in the current slice are horizontally scaled and put in the ring buffer[This is done for luma and chroma, each with possibly different numbers of lines per picture.] Input to YUV Converter When the input to the main path is not planar bits per component YUV or bit gray
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
static void mss2_blit_wmv9_c(uint8_t *dst, ptrdiff_t dst_stride, const uint8_t *srcy, ptrdiff_t srcy_stride, const uint8_t *srcu, const uint8_t *srcv, ptrdiff_t srcuv_stride, int w, int h)
#define i(width, name, range_min, range_max)
static av_always_inline void mss2_blit_wmv9_template(uint8_t *dst, ptrdiff_t dst_stride, int gray, int use_mask, int maskcolor, const uint8_t *mask, ptrdiff_t mask_stride, const uint8_t *srcy, ptrdiff_t srcy_stride, const uint8_t *srcu, const uint8_t *srcv, ptrdiff_t srcuv_stride, int w, int h)
static void mss2_gray_fill_masked_c(uint8_t *dst, ptrdiff_t dst_stride, int maskcolor, const uint8_t *mask, ptrdiff_t mask_stride, int w, int h)
static void mss2_blit_wmv9_masked_c(uint8_t *dst, ptrdiff_t dst_stride, int maskcolor, const uint8_t *mask, ptrdiff_t mask_stride, const uint8_t *srcy, ptrdiff_t srcy_stride, const uint8_t *srcu, const uint8_t *srcv, ptrdiff_t srcuv_stride, int w, int h)