aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/h263enc.h
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-06-06 03:36:48 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-06-20 18:58:38 +0200
commit646ace34cd1562cc699e0b99f9e26c63f318e224 (patch)
tree1cf32bef4024396b70ce5ae1029a96cb62e59bdb /libavcodec/h263enc.h
parentd40b46f47c0945b9bc10f10b95294bae02f2c2ae (diff)
downloadffmpeg-646ace34cd1562cc699e0b99f9e26c63f318e224.tar.gz
avcodec/h263enc: Remove no-output code
The no-output mode (guarded by AV_CODEC_FLAG2_NO_OUTPUT) does not provide a noteworthy speedup; in fact, it even turned out to be slower than the code with the no-output code removed (ordinary encode: 153259721 decicycles, noout encode: 153259721; encode with this patch applied: 152451581 decicycles; timings are for encode_frame callbacks when encoding a 1080p sample to MPEG-4). (Furthermore, this code was broken for most of its existence (since 9207dc3b0db368bb9cf5eb295cbc1129c2975e31) and no one noticed, so the no-output mode is probably not used at all.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/h263enc.h')
-rw-r--r--libavcodec/h263enc.h29
1 files changed, 2 insertions, 27 deletions
diff --git a/libavcodec/h263enc.h b/libavcodec/h263enc.h
index 6e07440b30..784500ca7a 100644
--- a/libavcodec/h263enc.h
+++ b/libavcodec/h263enc.h
@@ -37,36 +37,11 @@ void ff_clean_h263_qscales(MpegEncContext *s);
void ff_h263_encode_motion(PutBitContext *pb, int val, int f_code);
void ff_h263_update_mb(MpegEncContext *s);
-static inline int h263_get_motion_length(int val, int f_code)
-{
- int bit_size, code, sign;
-
- if (val == 0) {
- return 1; /* ff_mvtab[0][1] */
- } else {
- bit_size = f_code - 1;
- /* modulo encoding */
- val = sign_extend(val, 6 + bit_size);
- sign = val >> 31;
- val = (val ^ sign) - sign; /* val = FFABS(val) */
- val--;
- code = (val >> bit_size) + 1;
-
- return ff_mvtab[code][1] + 1 + bit_size;
- }
-}
-
static inline void ff_h263_encode_motion_vector(MpegEncContext * s,
int x, int y, int f_code)
{
- if (s->avctx->flags2 & AV_CODEC_FLAG2_NO_OUTPUT) {
- skip_put_bits(&s->pb,
- h263_get_motion_length(x, f_code) +
- h263_get_motion_length(y, f_code));
- } else {
- ff_h263_encode_motion(&s->pb, x, f_code);
- ff_h263_encode_motion(&s->pb, y, f_code);
- }
+ ff_h263_encode_motion(&s->pb, x, f_code);
+ ff_h263_encode_motion(&s->pb, y, f_code);
}
static inline int get_p_cbp(MpegEncContext * s,