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
1984f635
Commit
1984f635
authored
Mar 22, 2003
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user setable quantizer bias
Originally committed as revision 1701 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
65f7062d
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
15 deletions
+38
-15
avcodec.h
libavcodec/avcodec.h
+18
-3
h263.c
libavcodec/h263.c
+0
-8
mjpeg.c
libavcodec/mjpeg.c
+0
-1
mpeg12.c
libavcodec/mpeg12.c
+0
-2
mpegvideo.c
libavcodec/mpegvideo.c
+16
-0
mpegvideo.h
libavcodec/mpegvideo.h
+1
-1
utils.c
libavcodec/utils.c
+3
-0
No files found.
libavcodec/avcodec.h
View file @
1984f635
...
...
@@ -15,8 +15,8 @@ extern "C" {
#define LIBAVCODEC_VERSION_INT 0x000406
#define LIBAVCODEC_VERSION "0.4.6"
#define LIBAVCODEC_BUILD 466
2
#define LIBAVCODEC_BUILD_STR "466
2
"
#define LIBAVCODEC_BUILD 466
3
#define LIBAVCODEC_BUILD_STR "466
3
"
#define LIBAVCODEC_IDENT "FFmpeg" LIBAVCODEC_VERSION "b" LIBAVCODEC_BUILD_STR
...
...
@@ -1038,8 +1038,23 @@ typedef struct AVCodecContext {
* - decoding: set by lavc.
* @todo move this after frame_rate
*/
int
frame_rate_base
;
int
frame_rate_base
;
/**
* intra quantizer bias.
* - encoding: set by user.
* - decoding: unused
*/
int
intra_quant_bias
;
#define FF_DEFAULT_QUANT_BIAS 999999
/**
* inter quantizer bias.
* - encoding: set by user.
* - decoding: unused
*/
int
inter_quant_bias
;
}
AVCodecContext
;
...
...
libavcodec/h263.c
View file @
1984f635
...
...
@@ -1484,14 +1484,6 @@ void h263_encode_init(MpegEncContext *s)
s
->
y_dc_scale_table
=
s
->
c_dc_scale_table
=
ff_mpeg1_dc_scale_table
;
}
if
(
s
->
mpeg_quant
){
s
->
intra_quant_bias
=
3
<<
(
QUANT_BIAS_SHIFT
-
3
);
//(a + x*3/8)/x
s
->
inter_quant_bias
=
0
;
}
else
{
s
->
intra_quant_bias
=
0
;
s
->
inter_quant_bias
=-
(
1
<<
(
QUANT_BIAS_SHIFT
-
2
));
//(a - x/4)/x
}
}
/**
...
...
libavcodec/mjpeg.c
View file @
1984f635
...
...
@@ -251,7 +251,6 @@ int mjpeg_init(MpegEncContext *s)
s
->
min_qcoeff
=-
1023
;
s
->
max_qcoeff
=
1023
;
s
->
intra_quant_bias
=
1
<<
(
QUANT_BIAS_SHIFT
-
1
);
//(a + x/2)/x
/* build all the huffman tables */
build_huffman_codes
(
m
->
huff_size_dc_luminance
,
...
...
libavcodec/mpeg12.c
View file @
1984f635
...
...
@@ -702,8 +702,6 @@ void ff_mpeg1_encode_init(MpegEncContext *s)
s
->
fcode_tab
=
fcode_tab
;
s
->
min_qcoeff
=-
255
;
s
->
max_qcoeff
=
255
;
s
->
intra_quant_bias
=
3
<<
(
QUANT_BIAS_SHIFT
-
3
);
//(a + x*3/8)/x
s
->
inter_quant_bias
=
0
;
s
->
intra_ac_vlc_length
=
s
->
inter_ac_vlc_length
=
uni_mpeg1_ac_vlc_len
;
}
...
...
libavcodec/mpegvideo.c
View file @
1984f635
...
...
@@ -551,6 +551,22 @@ int MPV_encode_init(AVCodecContext *avctx)
s
->
progressive_sequence
=
!
(
avctx
->
flags
&
CODEC_FLAG_INTERLACED_DCT
);
if
(
s
->
codec_id
==
CODEC_ID_MJPEG
){
s
->
intra_quant_bias
=
1
<<
(
QUANT_BIAS_SHIFT
-
1
);
//(a + x/2)/x
s
->
inter_quant_bias
=
0
;
}
else
if
(
s
->
mpeg_quant
||
s
->
codec_id
==
CODEC_ID_MPEG1VIDEO
){
s
->
intra_quant_bias
=
3
<<
(
QUANT_BIAS_SHIFT
-
3
);
//(a + x*3/8)/x
s
->
inter_quant_bias
=
0
;
}
else
{
s
->
intra_quant_bias
=
0
;
s
->
inter_quant_bias
=-
(
1
<<
(
QUANT_BIAS_SHIFT
-
2
));
//(a - x/4)/x
}
if
(
avctx
->
intra_quant_bias
!=
FF_DEFAULT_QUANT_BIAS
)
s
->
intra_quant_bias
=
avctx
->
intra_quant_bias
;
if
(
avctx
->
inter_quant_bias
!=
FF_DEFAULT_QUANT_BIAS
)
s
->
inter_quant_bias
=
avctx
->
inter_quant_bias
;
switch
(
avctx
->
codec
->
id
)
{
case
CODEC_ID_MPEG1VIDEO
:
s
->
out_format
=
FMT_MPEG1
;
...
...
libavcodec/mpegvideo.h
View file @
1984f635
...
...
@@ -360,7 +360,7 @@ typedef struct MpegEncContext {
uint16_t
chroma_intra_matrix
[
64
];
uint16_t
inter_matrix
[
64
];
uint16_t
chroma_inter_matrix
[
64
];
#define QUANT_BIAS_SHIFT
4
#define QUANT_BIAS_SHIFT
8
int
intra_quant_bias
;
///< bias for the quantizer
int
inter_quant_bias
;
///< bias for the quantizer
int
min_qcoeff
;
///< minimum encodable coefficient
...
...
libavcodec/utils.c
View file @
1984f635
...
...
@@ -244,6 +244,9 @@ void avcodec_get_context_defaults(AVCodecContext *s){
s
->
release_buffer
=
avcodec_default_release_buffer
;
s
->
get_format
=
avcodec_default_get_format
;
s
->
me_subpel_quality
=
8
;
s
->
intra_quant_bias
=
FF_DEFAULT_QUANT_BIAS
;
s
->
inter_quant_bias
=
FF_DEFAULT_QUANT_BIAS
;
}
/**
...
...
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