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
523da37f
Commit
523da37f
authored
Dec 09, 2011
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cljrenc: 2x2 ordered dither support.
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
74d9b213
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
cljr.c
libavcodec/cljr.c
+6
-0
No files found.
libavcodec/cljr.c
View file @
523da37f
...
...
@@ -137,6 +137,11 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf,
AVFrame
*
p
=
data
;
int
x
,
y
;
uint32_t
dither
=
avctx
->
frame_number
;
static
const
uint32_t
ordered_dither
[
2
][
2
]
=
{
{
0x10400000
,
0x104F0000
},
{
0xCB2A0000
,
0xCB250000
},
};
p
->
pict_type
=
AV_PICTURE_TYPE_I
;
p
->
key_frame
=
1
;
...
...
@@ -151,6 +156,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf,
switch
(
a
->
dither_type
)
{
case
0
:
dither
=
0x492A0000
;
break
;
case
1
:
dither
=
dither
*
1664525
+
1013904223
;
break
;
case
2
:
dither
=
ordered_dither
[
y
&
1
][
(
x
>>
2
)
&
1
];
break
;
}
put_bits
(
&
pb
,
5
,
(
luma
[
3
]
+
(
dither
>>
29
)
)
>>
3
);
put_bits
(
&
pb
,
5
,
(
luma
[
2
]
+
((
dither
>>
26
)
&
7
))
>>
3
);
...
...
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