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
fd8def92
Commit
fd8def92
authored
Jun 16, 2012
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/super2xsai: fix fate test on bigendian
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
c78cf00b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
8 deletions
+25
-8
vf_super2xsai.c
libavfilter/vf_super2xsai.c
+21
-8
pixfmts_super2xsai
tests/ref/lavfi/pixfmts_super2xsai
+4
-0
No files found.
libavfilter/vf_super2xsai.c
View file @
fd8def92
...
...
@@ -40,6 +40,7 @@ typedef struct {
uint32_t
q_lo_pixel_mask
;
int
bpp
;
///< bytes per pixel, pixel stride for each (packed) pixel
int
is_be
;
}
Super2xSaIContext
;
#define GET_RESULT(A, B, C, D) ((A != C || A != D) - (B != C || B != D))
...
...
@@ -72,7 +73,7 @@ static void super2xsai(AVFilterContext *ctx,
#define READ_COLOR4(dst, src_line, off) dst = *((const uint32_t *)src_line + off)
#define READ_COLOR3(dst, src_line, off) dst = AV_RL24 (src_line + 3*off)
#define READ_COLOR2(dst, src_line, off) dst =
*((const uint16_t *)src_line +
off)
#define READ_COLOR2(dst, src_line, off) dst =
sai->is_be ? AV_RB16(src_line + 2 * off) : AV_RL16(src_line + 2 *
off)
for
(
y
=
0
;
y
<
height
;
y
++
)
{
uint8_t
*
dst_line
[
2
];
...
...
@@ -175,8 +176,13 @@ static void super2xsai(AVFilterContext *ctx,
AV_WL24
(
dst_line
[
1
]
+
x
*
6
+
3
,
product2b
);
break
;
default:
// bpp = 2
AV_WN32A
(
dst_line
[
0
]
+
x
*
4
,
product1a
|
(
product1b
<<
16
));
AV_WN32A
(
dst_line
[
1
]
+
x
*
4
,
product2a
|
(
product2b
<<
16
));
if
(
sai
->
is_be
)
{
AV_WB32
(
dst_line
[
0
]
+
x
*
4
,
product1a
|
(
product1b
<<
16
));
AV_WB32
(
dst_line
[
1
]
+
x
*
4
,
product2a
|
(
product2b
<<
16
));
}
else
{
AV_WL32
(
dst_line
[
0
]
+
x
*
4
,
product1a
|
(
product1b
<<
16
));
AV_WL32
(
dst_line
[
1
]
+
x
*
4
,
product2a
|
(
product2b
<<
16
));
}
}
/* Move color matrix forward */
...
...
@@ -227,7 +233,8 @@ static int query_formats(AVFilterContext *ctx)
static
const
enum
PixelFormat
pix_fmts
[]
=
{
PIX_FMT_RGBA
,
PIX_FMT_BGRA
,
PIX_FMT_ARGB
,
PIX_FMT_ABGR
,
PIX_FMT_RGB24
,
PIX_FMT_BGR24
,
PIX_FMT_RGB565
,
PIX_FMT_BGR565
,
PIX_FMT_RGB555
,
PIX_FMT_BGR555
,
PIX_FMT_RGB565BE
,
PIX_FMT_BGR565BE
,
PIX_FMT_RGB555BE
,
PIX_FMT_BGR555BE
,
PIX_FMT_RGB565LE
,
PIX_FMT_BGR565LE
,
PIX_FMT_RGB555LE
,
PIX_FMT_BGR555LE
,
PIX_FMT_NONE
};
...
...
@@ -251,8 +258,11 @@ static int config_input(AVFilterLink *inlink)
sai
->
bpp
=
3
;
break
;
case
PIX_FMT_RGB565
:
case
PIX_FMT_BGR565
:
case
PIX_FMT_RGB565BE
:
case
PIX_FMT_BGR565BE
:
sai
->
is_be
=
1
;
case
PIX_FMT_RGB565LE
:
case
PIX_FMT_BGR565LE
:
sai
->
hi_pixel_mask
=
0xF7DEF7DE
;
sai
->
lo_pixel_mask
=
0x08210821
;
sai
->
q_hi_pixel_mask
=
0xE79CE79C
;
...
...
@@ -260,8 +270,11 @@ static int config_input(AVFilterLink *inlink)
sai
->
bpp
=
2
;
break
;
case
PIX_FMT_BGR555
:
case
PIX_FMT_RGB555
:
case
PIX_FMT_BGR555BE
:
case
PIX_FMT_RGB555BE
:
sai
->
is_be
=
1
;
case
PIX_FMT_BGR555LE
:
case
PIX_FMT_RGB555LE
:
sai
->
hi_pixel_mask
=
0x7BDE7BDE
;
sai
->
lo_pixel_mask
=
0x04210421
;
sai
->
q_hi_pixel_mask
=
0x739C739C
;
...
...
tests/ref/lavfi/pixfmts_super2xsai
View file @
fd8def92
abgr 7df21399eedd7094a5c345035c220ebe
argb 6de1f5a66d6517951243bb2a751180d2
bgr24 6ff4af0eb9ab72eb723ed12469d559bc
bgr555be 6a0979a52f5f48de2269eb0c123446c9
bgr555le 38c2e84751c3ad108a55bf77ab8afbf5
bgr565be b4921dbc73bfd61ede103f39664d839f
bgr565le 2efbb9c15f22d5c704a00d11a241c1da
bgra ab589a165007d5b0dbacb26df4bbe5e0
rgb24 c4ed6e5ad7eb4e66ea18deef3584231f
rgb555be c24d62606900fd1a6088883c7022252a
rgb555le 3b313e94f2bf70c8972af69b6dc331c9
rgb565be e45766a1f18b74cf9094933f704bfe53
rgb565le de2cf048dcd48c0a39dfcc9b6eac36fe
rgba e97cd6a0393fc354e95088065e668eb2
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