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
ba0e6999
Commit
ba0e6999
authored
Jul 18, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sws/input: switch to av_assert
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
56ae5926
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
11 deletions
+12
-11
input.c
libswscale/input.c
+12
-11
No files found.
libswscale/input.c
View file @
ba0e6999
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
#include "libavutil/intreadwrite.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mathematics.h"
#include "libavutil/mathematics.h"
#include "libavutil/pixdesc.h"
#include "libavutil/pixdesc.h"
#include "libavutil/avassert.h"
#include "config.h"
#include "config.h"
#include "rgb2rgb.h"
#include "rgb2rgb.h"
#include "swscale.h"
#include "swscale.h"
...
@@ -71,7 +72,7 @@ rgb64ToUV_c_template(uint16_t *dstU, uint16_t *dstV,
...
@@ -71,7 +72,7 @@ rgb64ToUV_c_template(uint16_t *dstU, uint16_t *dstV,
int
width
,
enum
PixelFormat
origin
)
int
width
,
enum
PixelFormat
origin
)
{
{
int
i
;
int
i
;
a
ssert
(
src1
==
src2
);
a
v_assert1
(
src1
==
src2
);
for
(
i
=
0
;
i
<
width
;
i
++
)
{
for
(
i
=
0
;
i
<
width
;
i
++
)
{
int
r_b
=
input_pixel
(
&
src1
[
i
*
4
+
0
]);
int
r_b
=
input_pixel
(
&
src1
[
i
*
4
+
0
]);
int
g
=
input_pixel
(
&
src1
[
i
*
4
+
1
]);
int
g
=
input_pixel
(
&
src1
[
i
*
4
+
1
]);
...
@@ -88,7 +89,7 @@ rgb64ToUV_half_c_template(uint16_t *dstU, uint16_t *dstV,
...
@@ -88,7 +89,7 @@ rgb64ToUV_half_c_template(uint16_t *dstU, uint16_t *dstV,
int
width
,
enum
PixelFormat
origin
)
int
width
,
enum
PixelFormat
origin
)
{
{
int
i
;
int
i
;
a
ssert
(
src1
==
src2
);
a
v_assert1
(
src1
==
src2
);
for
(
i
=
0
;
i
<
width
;
i
++
)
{
for
(
i
=
0
;
i
<
width
;
i
++
)
{
int
r_b
=
(
input_pixel
(
&
src1
[
8
*
i
+
0
])
+
input_pixel
(
&
src1
[
8
*
i
+
4
])
+
1
)
>>
1
;
int
r_b
=
(
input_pixel
(
&
src1
[
8
*
i
+
0
])
+
input_pixel
(
&
src1
[
8
*
i
+
4
])
+
1
)
>>
1
;
int
g
=
(
input_pixel
(
&
src1
[
8
*
i
+
1
])
+
input_pixel
(
&
src1
[
8
*
i
+
5
])
+
1
)
>>
1
;
int
g
=
(
input_pixel
(
&
src1
[
8
*
i
+
1
])
+
input_pixel
(
&
src1
[
8
*
i
+
5
])
+
1
)
>>
1
;
...
@@ -153,7 +154,7 @@ static av_always_inline void rgb48ToUV_c_template(uint16_t *dstU,
...
@@ -153,7 +154,7 @@ static av_always_inline void rgb48ToUV_c_template(uint16_t *dstU,
enum
PixelFormat
origin
)
enum
PixelFormat
origin
)
{
{
int
i
;
int
i
;
a
ssert
(
src1
==
src2
);
a
v_assert1
(
src1
==
src2
);
for
(
i
=
0
;
i
<
width
;
i
++
)
{
for
(
i
=
0
;
i
<
width
;
i
++
)
{
int
r_b
=
input_pixel
(
&
src1
[
i
*
3
+
0
]);
int
r_b
=
input_pixel
(
&
src1
[
i
*
3
+
0
]);
int
g
=
input_pixel
(
&
src1
[
i
*
3
+
1
]);
int
g
=
input_pixel
(
&
src1
[
i
*
3
+
1
]);
...
@@ -172,7 +173,7 @@ static av_always_inline void rgb48ToUV_half_c_template(uint16_t *dstU,
...
@@ -172,7 +173,7 @@ static av_always_inline void rgb48ToUV_half_c_template(uint16_t *dstU,
enum
PixelFormat
origin
)
enum
PixelFormat
origin
)
{
{
int
i
;
int
i
;
a
ssert
(
src1
==
src2
);
a
v_assert1
(
src1
==
src2
);
for
(
i
=
0
;
i
<
width
;
i
++
)
{
for
(
i
=
0
;
i
<
width
;
i
++
)
{
int
r_b
=
(
input_pixel
(
&
src1
[
6
*
i
+
0
])
+
int
r_b
=
(
input_pixel
(
&
src1
[
6
*
i
+
0
])
+
input_pixel
(
&
src1
[
6
*
i
+
3
])
+
1
)
>>
1
;
input_pixel
(
&
src1
[
6
*
i
+
3
])
+
1
)
>>
1
;
...
@@ -449,7 +450,7 @@ static void palToUV_c(uint16_t *dstU, int16_t *dstV,
...
@@ -449,7 +450,7 @@ static void palToUV_c(uint16_t *dstU, int16_t *dstV,
int
width
,
uint32_t
*
pal
)
int
width
,
uint32_t
*
pal
)
{
{
int
i
;
int
i
;
a
ssert
(
src1
==
src2
);
a
v_assert1
(
src1
==
src2
);
for
(
i
=
0
;
i
<
width
;
i
++
)
{
for
(
i
=
0
;
i
<
width
;
i
++
)
{
int
p
=
pal
[
src1
[
i
]];
int
p
=
pal
[
src1
[
i
]];
...
@@ -506,7 +507,7 @@ static void yuy2ToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, con
...
@@ -506,7 +507,7 @@ static void yuy2ToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, con
dstU
[
i
]
=
src1
[
4
*
i
+
1
];
dstU
[
i
]
=
src1
[
4
*
i
+
1
];
dstV
[
i
]
=
src1
[
4
*
i
+
3
];
dstV
[
i
]
=
src1
[
4
*
i
+
3
];
}
}
a
ssert
(
src1
==
src2
);
a
v_assert1
(
src1
==
src2
);
}
}
static
void
bswap16Y_c
(
uint8_t
*
_dst
,
const
uint8_t
*
_src
,
const
uint8_t
*
unused1
,
const
uint8_t
*
unused2
,
int
width
,
static
void
bswap16Y_c
(
uint8_t
*
_dst
,
const
uint8_t
*
_src
,
const
uint8_t
*
unused1
,
const
uint8_t
*
unused2
,
int
width
,
...
@@ -550,7 +551,7 @@ static void uyvyToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, con
...
@@ -550,7 +551,7 @@ static void uyvyToUV_c(uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, con
dstU
[
i
]
=
src1
[
4
*
i
+
0
];
dstU
[
i
]
=
src1
[
4
*
i
+
0
];
dstV
[
i
]
=
src1
[
4
*
i
+
2
];
dstV
[
i
]
=
src1
[
4
*
i
+
2
];
}
}
a
ssert
(
src1
==
src2
);
a
v_assert1
(
src1
==
src2
);
}
}
static
av_always_inline
void
nvXXtoUV_c
(
uint8_t
*
dst1
,
uint8_t
*
dst2
,
static
av_always_inline
void
nvXXtoUV_c
(
uint8_t
*
dst1
,
uint8_t
*
dst2
,
...
@@ -604,7 +605,7 @@ static void bgr24ToUV_c(int16_t *dstU, int16_t *dstV, const uint8_t *unused0, co
...
@@ -604,7 +605,7 @@ static void bgr24ToUV_c(int16_t *dstU, int16_t *dstV, const uint8_t *unused0, co
dstU
[
i
]
=
(
RU
*
r
+
GU
*
g
+
BU
*
b
+
(
256
<<
(
RGB2YUV_SHIFT
-
1
))
+
(
1
<<
(
RGB2YUV_SHIFT
-
7
)))
>>
(
RGB2YUV_SHIFT
-
6
);
dstU
[
i
]
=
(
RU
*
r
+
GU
*
g
+
BU
*
b
+
(
256
<<
(
RGB2YUV_SHIFT
-
1
))
+
(
1
<<
(
RGB2YUV_SHIFT
-
7
)))
>>
(
RGB2YUV_SHIFT
-
6
);
dstV
[
i
]
=
(
RV
*
r
+
GV
*
g
+
BV
*
b
+
(
256
<<
(
RGB2YUV_SHIFT
-
1
))
+
(
1
<<
(
RGB2YUV_SHIFT
-
7
)))
>>
(
RGB2YUV_SHIFT
-
6
);
dstV
[
i
]
=
(
RV
*
r
+
GV
*
g
+
BV
*
b
+
(
256
<<
(
RGB2YUV_SHIFT
-
1
))
+
(
1
<<
(
RGB2YUV_SHIFT
-
7
)))
>>
(
RGB2YUV_SHIFT
-
6
);
}
}
a
ssert
(
src1
==
src2
);
a
v_assert1
(
src1
==
src2
);
}
}
static
void
bgr24ToUV_half_c
(
int16_t
*
dstU
,
int16_t
*
dstV
,
const
uint8_t
*
unused0
,
const
uint8_t
*
src1
,
static
void
bgr24ToUV_half_c
(
int16_t
*
dstU
,
int16_t
*
dstV
,
const
uint8_t
*
unused0
,
const
uint8_t
*
src1
,
...
@@ -619,7 +620,7 @@ static void bgr24ToUV_half_c(int16_t *dstU, int16_t *dstV, const uint8_t *unused
...
@@ -619,7 +620,7 @@ static void bgr24ToUV_half_c(int16_t *dstU, int16_t *dstV, const uint8_t *unused
dstU
[
i
]
=
(
RU
*
r
+
GU
*
g
+
BU
*
b
+
(
256
<<
RGB2YUV_SHIFT
)
+
(
1
<<
(
RGB2YUV_SHIFT
-
6
)))
>>
(
RGB2YUV_SHIFT
-
5
);
dstU
[
i
]
=
(
RU
*
r
+
GU
*
g
+
BU
*
b
+
(
256
<<
RGB2YUV_SHIFT
)
+
(
1
<<
(
RGB2YUV_SHIFT
-
6
)))
>>
(
RGB2YUV_SHIFT
-
5
);
dstV
[
i
]
=
(
RV
*
r
+
GV
*
g
+
BV
*
b
+
(
256
<<
RGB2YUV_SHIFT
)
+
(
1
<<
(
RGB2YUV_SHIFT
-
6
)))
>>
(
RGB2YUV_SHIFT
-
5
);
dstV
[
i
]
=
(
RV
*
r
+
GV
*
g
+
BV
*
b
+
(
256
<<
RGB2YUV_SHIFT
)
+
(
1
<<
(
RGB2YUV_SHIFT
-
6
)))
>>
(
RGB2YUV_SHIFT
-
5
);
}
}
a
ssert
(
src1
==
src2
);
a
v_assert1
(
src1
==
src2
);
}
}
static
void
rgb24ToY_c
(
int16_t
*
dst
,
const
uint8_t
*
src
,
const
uint8_t
*
unused1
,
const
uint8_t
*
unused2
,
int
width
,
static
void
rgb24ToY_c
(
int16_t
*
dst
,
const
uint8_t
*
src
,
const
uint8_t
*
unused1
,
const
uint8_t
*
unused2
,
int
width
,
...
@@ -639,7 +640,7 @@ static void rgb24ToUV_c(int16_t *dstU, int16_t *dstV, const uint8_t *unused0, co
...
@@ -639,7 +640,7 @@ static void rgb24ToUV_c(int16_t *dstU, int16_t *dstV, const uint8_t *unused0, co
const
uint8_t
*
src2
,
int
width
,
uint32_t
*
unused
)
const
uint8_t
*
src2
,
int
width
,
uint32_t
*
unused
)
{
{
int
i
;
int
i
;
a
ssert
(
src1
==
src2
);
a
v_assert1
(
src1
==
src2
);
for
(
i
=
0
;
i
<
width
;
i
++
)
{
for
(
i
=
0
;
i
<
width
;
i
++
)
{
int
r
=
src1
[
3
*
i
+
0
];
int
r
=
src1
[
3
*
i
+
0
];
int
g
=
src1
[
3
*
i
+
1
];
int
g
=
src1
[
3
*
i
+
1
];
...
@@ -654,7 +655,7 @@ static void rgb24ToUV_half_c(int16_t *dstU, int16_t *dstV, const uint8_t *unused
...
@@ -654,7 +655,7 @@ static void rgb24ToUV_half_c(int16_t *dstU, int16_t *dstV, const uint8_t *unused
const
uint8_t
*
src2
,
int
width
,
uint32_t
*
unused
)
const
uint8_t
*
src2
,
int
width
,
uint32_t
*
unused
)
{
{
int
i
;
int
i
;
a
ssert
(
src1
==
src2
);
a
v_assert1
(
src1
==
src2
);
for
(
i
=
0
;
i
<
width
;
i
++
)
{
for
(
i
=
0
;
i
<
width
;
i
++
)
{
int
r
=
src1
[
6
*
i
+
0
]
+
src1
[
6
*
i
+
3
];
int
r
=
src1
[
6
*
i
+
0
]
+
src1
[
6
*
i
+
3
];
int
g
=
src1
[
6
*
i
+
1
]
+
src1
[
6
*
i
+
4
];
int
g
=
src1
[
6
*
i
+
1
]
+
src1
[
6
*
i
+
4
];
...
...
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