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
af8793ae
Commit
af8793ae
authored
Feb 18, 2002
by
Zdenek Kabelac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* simplified indexing
Originally committed as revision 306 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
8257bf05
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
29 deletions
+31
-29
h263.c
libavcodec/h263.c
+31
-29
No files found.
libavcodec/h263.c
View file @
af8793ae
...
...
@@ -276,16 +276,15 @@ void h263_encode_mb(MpegEncContext * s,
static
inline
int
mid_pred
(
int
a
,
int
b
,
int
c
)
{
int
vmin
,
vmax
;
vmin
=
a
;
vm
ax
=
vm
in
=
a
;
if
(
b
<
vmin
)
vmin
=
b
;
else
vmax
=
b
;
if
(
c
<
vmin
)
vmin
=
c
;
vmax
=
a
;
if
(
b
>
vmax
)
vmax
=
b
;
if
(
c
>
vmax
)
else
if
(
c
>
vmax
)
vmax
=
c
;
return
a
+
b
+
c
-
vmin
-
vmax
;
...
...
@@ -294,38 +293,39 @@ static inline int mid_pred(int a, int b, int c)
INT16
*
h263_pred_motion
(
MpegEncContext
*
s
,
int
block
,
int
*
px
,
int
*
py
)
{
int
x
,
y
,
wrap
;
int
x
y
,
y
,
wrap
;
INT16
*
A
,
*
B
,
*
C
,
*
mot_val
;
x
=
2
*
s
->
mb_x
+
1
+
(
block
&
1
);
y
=
2
*
s
->
mb_y
+
1
+
((
block
>>
1
)
&
1
);
wrap
=
2
*
s
->
mb_width
+
2
;
y
=
xy
=
2
*
s
->
mb_y
+
1
+
((
block
>>
1
)
&
1
);
// y
xy
*=
wrap
;
// y * wrap
xy
+=
2
*
s
->
mb_x
+
1
+
(
block
&
1
);
// x + y * wrap
mot_val
=
s
->
motion_val
[
(
x
)
+
(
y
)
*
wrap
];
mot_val
=
s
->
motion_val
[
xy
];
/* special case for first line */
if
(
y
==
1
||
s
->
first_slice_line
||
s
->
first_gob_line
)
{
A
=
s
->
motion_val
[
(
x
-
1
)
+
(
y
)
*
wrap
];
A
=
s
->
motion_val
[
xy
-
1
];
*
px
=
A
[
0
];
*
py
=
A
[
1
];
}
else
{
switch
(
block
)
{
default:
case
0
:
A
=
s
->
motion_val
[
(
x
-
1
)
+
(
y
)
*
wrap
];
B
=
s
->
motion_val
[
(
x
)
+
(
y
-
1
)
*
wrap
];
C
=
s
->
motion_val
[
(
x
+
2
)
+
(
y
-
1
)
*
wrap
];
A
=
s
->
motion_val
[
xy
-
1
];
B
=
s
->
motion_val
[
xy
-
wrap
];
C
=
s
->
motion_val
[
xy
+
2
-
wrap
];
break
;
case
1
:
case
2
:
A
=
s
->
motion_val
[
(
x
-
1
)
+
(
y
)
*
wrap
];
B
=
s
->
motion_val
[
(
x
)
+
(
y
-
1
)
*
wrap
];
C
=
s
->
motion_val
[
(
x
+
1
)
+
(
y
-
1
)
*
wrap
];
A
=
s
->
motion_val
[
xy
-
1
];
B
=
s
->
motion_val
[
xy
-
wrap
];
C
=
s
->
motion_val
[
xy
+
1
-
wrap
];
break
;
case
3
:
A
=
s
->
motion_val
[
(
x
-
1
)
+
(
y
)
*
wrap
];
B
=
s
->
motion_val
[
(
x
-
1
)
+
(
y
-
1
)
*
wrap
];
C
=
s
->
motion_val
[
(
x
)
+
(
y
-
1
)
*
wrap
];
A
=
s
->
motion_val
[
xy
-
1
];
B
=
s
->
motion_val
[
xy
-
1
-
wrap
];
C
=
s
->
motion_val
[
xy
-
wrap
];
break
;
}
*
px
=
mid_pred
(
A
[
0
],
B
[
0
],
C
[
0
]);
...
...
@@ -538,20 +538,22 @@ void h263_dc_scale(MpegEncContext * s)
static
int
mpeg4_pred_dc
(
MpegEncContext
*
s
,
int
n
,
UINT16
**
dc_val_ptr
,
int
*
dir_ptr
)
{
int
a
,
b
,
c
,
x
,
y
,
wrap
,
pred
,
scale
;
int
a
,
b
,
c
,
xy
,
wrap
,
pred
,
scale
;
UINT16
*
dc_val
;
/* find prediction */
if
(
n
<
4
)
{
x
=
2
*
s
->
mb_x
+
1
+
(
n
&
1
);
y
=
2
*
s
->
mb_y
+
1
+
((
n
&
2
)
>>
1
);
wrap
=
s
->
mb_width
*
2
+
2
;
xy
=
2
*
s
->
mb_y
+
1
+
((
n
&
2
)
>>
1
);
xy
*=
wrap
;
xy
+=
2
*
s
->
mb_x
+
1
+
(
n
&
1
);
dc_val
=
s
->
dc_val
[
0
];
scale
=
s
->
y_dc_scale
;
}
else
{
x
=
s
->
mb_x
+
1
;
y
=
s
->
mb_y
+
1
;
wrap
=
s
->
mb_width
+
2
;
xy
=
s
->
mb_y
+
1
;
xy
*=
wrap
;
xy
+=
s
->
mb_x
+
1
;
dc_val
=
s
->
dc_val
[
n
-
4
+
1
];
scale
=
s
->
c_dc_scale
;
}
...
...
@@ -559,9 +561,9 @@ static int mpeg4_pred_dc(MpegEncContext * s, int n, UINT16 **dc_val_ptr, int *di
/* B C
* A X
*/
a
=
dc_val
[
(
x
-
1
)
+
(
y
)
*
wrap
];
b
=
dc_val
[
(
x
-
1
)
+
(
y
-
1
)
*
wrap
];
c
=
dc_val
[
(
x
)
+
(
y
-
1
)
*
wrap
];
a
=
dc_val
[
xy
-
1
];
b
=
dc_val
[
xy
-
1
-
wrap
];
c
=
dc_val
[
xy
-
wrap
];
if
(
abs
(
a
-
b
)
<
abs
(
b
-
c
))
{
pred
=
c
;
...
...
@@ -574,7 +576,7 @@ static int mpeg4_pred_dc(MpegEncContext * s, int n, UINT16 **dc_val_ptr, int *di
pred
=
(
pred
+
(
scale
>>
1
))
/
scale
;
/* prepare address for prediction update */
*
dc_val_ptr
=
&
dc_val
[
(
x
)
+
(
y
)
*
wrap
];
*
dc_val_ptr
=
&
dc_val
[
xy
];
return
pred
;
}
...
...
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