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
b4dbd87c
Commit
b4dbd87c
authored
Feb 15, 2002
by
Juanjo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Minor changes on bitrate control
Originally committed as revision 300 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
d8cf5aea
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
6 deletions
+19
-6
motion_est.c
libavcodec/motion_est.c
+1
-1
mpegvideo.c
libavcodec/mpegvideo.c
+17
-5
mpegvideo.h
libavcodec/mpegvideo.h
+1
-0
No files found.
libavcodec/motion_est.c
View file @
b4dbd87c
...
...
@@ -458,7 +458,7 @@ int estimate_motion(MpegEncContext * s,
vard
=
vard
>>
8
;
sum
=
sum
>>
8
;
varc
=
(
varc
>>
8
)
-
(
sum
*
sum
);
s
->
mb_var
[
s
->
mb_width
*
mb_y
+
mb_x
]
=
varc
;
s
->
avg_mb_var
+=
varc
;
#if 0
...
...
libavcodec/mpegvideo.c
View file @
b4dbd87c
...
...
@@ -150,16 +150,21 @@ int MPV_common_init(MpegEncContext *s)
if
(
s
->
encoding
)
{
/* Allocate MB type table */
s
->
mb_type
=
malloc
(
s
->
mb_num
*
sizeof
(
char
));
s
->
mb_type
=
av_mallocz
(
s
->
mb_num
*
sizeof
(
char
));
if
(
s
->
mb_type
==
NULL
)
{
perror
(
"malloc"
);
goto
fail
;
}
s
->
mb_var
=
av_mallocz
(
s
->
mb_num
*
sizeof
(
INT16
));
if
(
s
->
mb_var
==
NULL
)
{
perror
(
"malloc"
);
goto
fail
;
}
/* Allocate MV table */
/* By now we just have one MV per MB */
s
->
mv_table
[
0
]
=
malloc
(
s
->
mb_num
*
sizeof
(
INT16
));
s
->
mv_table
[
1
]
=
malloc
(
s
->
mb_num
*
sizeof
(
INT16
));
s
->
mv_table
[
0
]
=
av_mallocz
(
s
->
mb_num
*
sizeof
(
INT16
));
s
->
mv_table
[
1
]
=
av_mallocz
(
s
->
mb_num
*
sizeof
(
INT16
));
if
(
s
->
mv_table
[
1
]
==
NULL
||
s
->
mv_table
[
0
]
==
NULL
)
{
perror
(
"malloc"
);
goto
fail
;
...
...
@@ -225,6 +230,8 @@ int MPV_common_init(MpegEncContext *s)
fail:
if
(
s
->
mb_type
)
free
(
s
->
mb_type
);
if
(
s
->
mb_var
)
free
(
s
->
mb_var
);
if
(
s
->
mv_table
[
0
])
free
(
s
->
mv_table
[
0
]);
if
(
s
->
mv_table
[
1
])
...
...
@@ -259,6 +266,8 @@ void MPV_common_end(MpegEncContext *s)
if
(
s
->
mb_type
)
free
(
s
->
mb_type
);
if
(
s
->
mb_var
)
free
(
s
->
mb_var
);
if
(
s
->
mv_table
[
0
])
free
(
s
->
mv_table
[
0
]);
if
(
s
->
mv_table
[
1
])
...
...
@@ -1079,7 +1088,10 @@ static void encode_picture(MpegEncContext *s, int picture_number)
sub_pixels_2
(
s
->
block
[
5
],
ptr
,
s
->
linesize
>>
1
,
dxy
);
}
emms_c
();
//if (s->avg_mb_var)
// printf("\nqscale=%2d dquant=%2d var=%4d avgvar=%4d", s->qscale,
// s->qscale*(s->mb_var[s->mb_width*mb_y+mb_x]/s->avg_mb_var),
// s->mb_var[s->mb_width*mb_y+mb_x], s->avg_mb_var);
/* DCT & quantize */
if
(
s
->
h263_msmpeg4
)
{
msmpeg4_dc_scale
(
s
);
...
...
libavcodec/mpegvideo.h
View file @
b4dbd87c
...
...
@@ -117,6 +117,7 @@ typedef struct MpegEncContext {
int
mb_x
,
mb_y
;
int
mb_incr
;
int
mb_intra
;
INT16
*
mb_var
;
/* Table for MB variances */
char
*
mb_type
;
/* Table for MB type */
/* matrix transmitted in the bitstream */
...
...
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