History

avcodec/flvenc: Move ff_flv2_encode_ac_esc() to ituh263enc.c

This is the only place where it is used.

Andreas Rheinhardt committed 1 year ago

Commit 514e5ea1 parent 61d34c23 files · +23 −27Browse files

Unified · Split

3 files
  1. libavcodec/flvenc.c +0 −22
  2. libavcodec/flvenc.h +0 −4
  3. libavcodec/ituh263enc.c +23 −1
libavcodec/flvenc.c+0−22
@@ -67,28 +67,6 @@ int ff_flv_encode_picture_header(MPVMainEncContext *const m) · 66 unmodified lines
6767 return 0;
6868 }
6969
70−void ff_flv2_encode_ac_esc(PutBitContext *pb, int slevel, int level,
71− int run, int last)
72−{
73− unsigned code;
74− int bits;
75− if (level < 64) { // 7-bit level
76− bits = 1 + 1 + 6 + 7;
77− code = (0 << (1 + 6 + 7)) |
78− (last << (6 + 7)) |
79− (run << 7) |
80− (slevel & 0x7f);
81− } else {
82− /* 11-bit level */
83− bits = 1 + 1 + 6 + 11;
84− code = (1 << (1 + 6 + 11)) |
85− (last << (6 + 11)) |
86− (run << 11) |
87− (slevel & 0x7ff);
88− }
89− put_bits(pb, bits, code);
90−}
91−
9270 const FFCodec ff_flv_encoder = {
9371 .p.name = "flv",
9472 CODEC_LONG_NAME("FLV / Sorenson Spark / Sorenson H.263 (Flash Video)"),
libavcodec/flvenc.h+0−4
@@ -21,12 +21,8 @@ · 20 unmodified lines
2121 #ifndef AVCODEC_FLVENC_H
2222 #define AVCODEC_FLVENC_H
2323
24−#include "put_bits.h"
25−
2624 typedef struct MPVMainEncContext MPVMainEncContext;
2725
2826 int ff_flv_encode_picture_header(MPVMainEncContext *const m);
29−void ff_flv2_encode_ac_esc(PutBitContext *pb, int slevel, int level, int run,
30− int last);
3127
3228 #endif /* AVCODEC_FLV_H */
libavcodec/ituh263enc.c+23−1
@@ -417,6 +417,28 @@ void ff_clean_h263_qscales(MPVEncContext *const s) · 416 unmodified lines
417417
418418 static const int dquant_code[5]= {1,0,9,2,3};
419419
420+static void flv2_encode_ac_esc(PutBitContext *pb, int slevel, int level,
421+ int run, int last)
422+{
423+ unsigned code;
424+ int bits;
425+ if (level < 64) { // 7-bit level
426+ bits = 1 + 1 + 6 + 7;
427+ code = (0 << (1 + 6 + 7)) |
428+ (last << (6 + 7)) |
429+ (run << 7) |
430+ (slevel & 0x7f);
431+ } else {
432+ /* 11-bit level */
433+ bits = 1 + 1 + 6 + 11;
434+ code = (1 << (1 + 6 + 11)) |
435+ (last << (6 + 11)) |
436+ (run << 11) |
437+ (slevel & 0x7ff);
438+ }
439+ put_bits(pb, bits, code);
440+}
441+
420442 /**
421443 * Encode an 8x8 block.
422444 * @param block the 8x8 block
@@ -522,7 +544,7 @@ static void h263_encode_block(MPVEncContext *const s, int16_t block[], int n) · 99 unmodified lines
522544 put_sbits(&s->pb, 6, slevel>>5);
523545 }
524546 } else {
525− ff_flv2_encode_ac_esc(&s->pb, slevel, level, run, last);
547+ flv2_encode_ac_esc(&s->pb, slevel, level, run, last);
526548 }
527549 } else {
528550 put_bits(&s->pb, 1, sign);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t