Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
84a08066
Commit
84a08066
authored
Dec 07, 2012
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
svq1: unmacroify macros used only once.
parent
95baf701
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
28 deletions
+24
-28
svq1dec.c
libavcodec/svq1dec.c
+24
-28
No files found.
libavcodec/svq1dec.c
View file @
84a08066
...
...
@@ -142,32 +142,6 @@ static const uint8_t string_table[256] = {
n2 &= n3 & 0x00FF00FF; \
}
#define SVQ1_DO_CODEBOOK_INTRA() \
for (y = 0; y < height; y++) { \
for (x = 0; x < width / 4; x++, codebook++) { \
n1 = n4; \
n2 = n4; \
SVQ1_ADD_CODEBOOK() \
/* store result */
\
dst[x] = n1 << 8 | n2; \
} \
dst += pitch / 4; \
}
#define SVQ1_DO_CODEBOOK_NONINTRA() \
for (y = 0; y < height; y++) { \
for (x = 0; x < width / 4; x++, codebook++) { \
n3 = dst[x]; \
/* add mean value to vector */
\
n1 = n4 + ((n3 & 0xFF00FF00) >> 8); \
n2 = n4 + (n3 & 0x00FF00FF); \
SVQ1_ADD_CODEBOOK() \
/* store result */
\
dst[x] = n1 << 8 | n2; \
} \
dst += pitch / 4; \
}
#define SVQ1_CALC_CODEBOOK_ENTRIES(cbook) \
codebook = (const uint32_t *)cbook[level]; \
if (stages > 0) \
...
...
@@ -228,7 +202,17 @@ static int svq1_decode_block_intra(GetBitContext *bitbuf, uint8_t *pixels,
memset
(
&
dst
[
y
*
(
pitch
/
4
)],
mean
,
width
);
}
else
{
SVQ1_CALC_CODEBOOK_ENTRIES
(
ff_svq1_intra_codebooks
);
SVQ1_DO_CODEBOOK_INTRA
()
for
(
y
=
0
;
y
<
height
;
y
++
)
{
for
(
x
=
0
;
x
<
width
/
4
;
x
++
,
codebook
++
)
{
n1
=
n4
;
n2
=
n4
;
SVQ1_ADD_CODEBOOK
()
/* store result */
dst
[
x
]
=
n1
<<
8
|
n2
;
}
dst
+=
pitch
/
4
;
}
}
}
...
...
@@ -276,7 +260,19 @@ static int svq1_decode_block_non_intra(GetBitContext *bitbuf, uint8_t *pixels,
mean
=
get_vlc2
(
bitbuf
,
svq1_inter_mean
.
table
,
9
,
3
)
-
256
;
SVQ1_CALC_CODEBOOK_ENTRIES
(
ff_svq1_inter_codebooks
);
SVQ1_DO_CODEBOOK_NONINTRA
()
for
(
y
=
0
;
y
<
height
;
y
++
)
{
for
(
x
=
0
;
x
<
width
/
4
;
x
++
,
codebook
++
)
{
n3
=
dst
[
x
];
/* add mean value to vector */
n1
=
n4
+
((
n3
&
0xFF00FF00
)
>>
8
);
n2
=
n4
+
(
n3
&
0x00FF00FF
);
SVQ1_ADD_CODEBOOK
()
/* store result */
dst
[
x
]
=
n1
<<
8
|
n2
;
}
dst
+=
pitch
/
4
;
}
}
return
0
;
}
...
...
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