History

avcodec/mpegutils: Move definitions to better places

FRAME_SKIPPED -> h263dec.h CANDIDATE_MB_TYPE_* -> mpegvideoenc.h INPLACE_OFFSET -> mpegvideoenc.h enum OutputFormat -> mpegvideo.h

Andreas Rheinhardt committed 3 years ago

Commit 66923161 parent 908a73d12 files · +36 −44Browse files

Unified · Split

12 files
  1. libavcodec/h263dec.c +0 −1
  2. libavcodec/h263dec.h +5 −0
  3. libavcodec/intelh263dec.c +0 −2
  4. libavcodec/mpeg4videoenc.c +0 −1
  5. libavcodec/mpegpicture.c +1 −1
  6. libavcodec/mpegutils.h +0 −34
  7. libavcodec/mpegvideo.h +9 −3
  8. libavcodec/mpegvideoenc.h +19 −0
  9. libavcodec/nvdec_mpeg12.c +1 −0
  10. libavcodec/ratecontrol.c +0 −1
  11. libavcodec/rv10.c +0 −1
  12. libavcodec/vc1dec.c +1 −0
libavcodec/h263dec.c+0−1
@@ -42,7 +42,6 @@ · 41 unmodified lines
4242 #include "mpeg4video.h"
4343 #include "mpeg4videodec.h"
4444 #include "mpeg4videodefs.h"
45−#include "mpegutils.h"
4645 #include "mpegvideo.h"
4746 #include "mpegvideodec.h"
4847 #include "msmpeg4dec.h"
libavcodec/h263dec.h+5−0
@@ -23,6 +23,11 @@ · 22 unmodified lines
2323 #include "mpegvideo.h"
2424 #include "vlc.h"
2525
26+/**
27+ * Return value for header parsers if frame is not coded.
28+ * */
29+#define FRAME_SKIPPED 100
30+
2631 // The defines below define the number of bits that are read at once for
2732 // reading vlc values. Changing these may improve speed and data cache needs
2833 // be aware though that decreasing them may need the number of stages that is
libavcodec/intelh263dec.c+0−2
@@ -19,12 +19,10 @@ · 18 unmodified lines
1919 */
2020
2121 #include "codec_internal.h"
22−#include "mpegutils.h"
2322 #include "mpegvideo.h"
2423 #include "mpegvideodec.h"
2524 #include "h263data.h"
2625 #include "h263dec.h"
27−#include "mpegvideodata.h"
2826
2927 /* don't understand why they choose a different header ! */
3028 int ff_intel_h263_decode_picture_header(MpegEncContext *s)
libavcodec/mpeg4videoenc.c+0−1
@@ -26,7 +26,6 @@ · 25 unmodified lines
2626 #include "libavutil/opt.h"
2727 #include "libavutil/thread.h"
2828 #include "codec_internal.h"
29−#include "mpegutils.h"
3029 #include "mpegvideo.h"
3130 #include "h263.h"
3231 #include "h263enc.h"
libavcodec/mpegpicture.c+1−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
2929 #include "avcodec.h"
3030 #include "motion_est.h"
3131 #include "mpegpicture.h"
32−#include "mpegutils.h"
32+#include "mpegvideo.h"
3333 #include "refstruct.h"
3434 #include "threadframe.h"
3535
libavcodec/mpegutils.h+0−34
@@ -27,11 +27,6 @@ · 26 unmodified lines
2727
2828 #include "avcodec.h"
2929
30−/**
31− * Return value for header parsers if frame is not coded.
32− * */
33−#define FRAME_SKIPPED 100
34−
3530 /* picture type */
3631 #define PICT_TOP_FIELD 1
3732 #define PICT_BOTTOM_FIELD 2
@@ -93,35 +88,6 @@ · 55 unmodified lines
9388
9489 #define HAS_CBP(a) ((a) & MB_TYPE_CBP)
9590
96−/* MB types for encoding */
97−#define CANDIDATE_MB_TYPE_INTRA (1 << 0)
98−#define CANDIDATE_MB_TYPE_INTER (1 << 1)
99−#define CANDIDATE_MB_TYPE_INTER4V (1 << 2)
100−#define CANDIDATE_MB_TYPE_SKIPPED (1 << 3)
101−
102−#define CANDIDATE_MB_TYPE_DIRECT (1 << 4)
103−#define CANDIDATE_MB_TYPE_FORWARD (1 << 5)
104−#define CANDIDATE_MB_TYPE_BACKWARD (1 << 6)
105−#define CANDIDATE_MB_TYPE_BIDIR (1 << 7)
106−
107−#define CANDIDATE_MB_TYPE_INTER_I (1 << 8)
108−#define CANDIDATE_MB_TYPE_FORWARD_I (1 << 9)
109−#define CANDIDATE_MB_TYPE_BACKWARD_I (1 << 10)
110−#define CANDIDATE_MB_TYPE_BIDIR_I (1 << 11)
111−
112−#define CANDIDATE_MB_TYPE_DIRECT0 (1 << 12)
113−
114−#define INPLACE_OFFSET 16
115−
116−enum OutputFormat {
117− FMT_MPEG1,
118− FMT_H261,
119− FMT_H263,
120− FMT_MJPEG,
121− FMT_SPEEDHQ,
122−};
123−
124−
12591 /**
12692 * Draw a horizontal band if supported.
12793 *
libavcodec/mpegvideo.h+9−3
@@ -28,7 +28,6 @@ · 27 unmodified lines
2828 #ifndef AVCODEC_MPEGVIDEO_H
2929 #define AVCODEC_MPEGVIDEO_H
3030
31−#include "avcodec.h"
3231 #include "blockdsp.h"
3332 #include "error_resilience.h"
3433 #include "fdctdsp.h"
@@ -44,7 +43,6 @@ · 9 unmodified lines
4443 #include "pixblockdsp.h"
4544 #include "put_bits.h"
4645 #include "ratecontrol.h"
47−#include "mpegutils.h"
4846 #include "qpeldsp.h"
4947 #include "videodsp.h"
5048
@@ -61,6 +59,14 @@ typedef struct ScanTable { · 10 unmodified lines
6159 uint8_t raster_end[64];
6260 } ScanTable;
6361
62+enum OutputFormat {
63+ FMT_MPEG1,
64+ FMT_H261,
65+ FMT_H263,
66+ FMT_MJPEG,
67+ FMT_SPEEDHQ,
68+};
69+
6470 /**
6571 * MpegEncContext.
6672 */
@@ -283,7 +289,7 @@ typedef struct MpegEncContext { · 216 unmodified lines
283289 int mb_x, mb_y;
284290 int mb_skip_run;
285291 int mb_intra;
286− uint16_t *mb_type; ///< Table for candidate MB types for encoding (defines in mpegutils.h)
292+ uint16_t *mb_type; ///< Table for candidate MB types for encoding (defines in mpegvideoenc.h)
287293
288294 int block_index[6]; ///< index to current MB in block based arrays with edges
289295 int block_wrap[6];
libavcodec/mpegvideoenc.h+19−0
@@ -34,6 +34,25 @@ · 33 unmodified lines
3434 #include "mpegvideo.h"
3535
3636 #define UNI_AC_ENC_INDEX(run,level) ((run)*128 + (level))
37+#define INPLACE_OFFSET 16
38+
39+/* MB types for encoding */
40+#define CANDIDATE_MB_TYPE_INTRA (1 << 0)
41+#define CANDIDATE_MB_TYPE_INTER (1 << 1)
42+#define CANDIDATE_MB_TYPE_INTER4V (1 << 2)
43+#define CANDIDATE_MB_TYPE_SKIPPED (1 << 3)
44+
45+#define CANDIDATE_MB_TYPE_DIRECT (1 << 4)
46+#define CANDIDATE_MB_TYPE_FORWARD (1 << 5)
47+#define CANDIDATE_MB_TYPE_BACKWARD (1 << 6)
48+#define CANDIDATE_MB_TYPE_BIDIR (1 << 7)
49+
50+#define CANDIDATE_MB_TYPE_INTER_I (1 << 8)
51+#define CANDIDATE_MB_TYPE_FORWARD_I (1 << 9)
52+#define CANDIDATE_MB_TYPE_BACKWARD_I (1 << 10)
53+#define CANDIDATE_MB_TYPE_BIDIR_I (1 << 11)
54+
55+#define CANDIDATE_MB_TYPE_DIRECT0 (1 << 12)
3756
3857 /* mpegvideo_enc common options */
3958 #define FF_MPV_FLAG_SKIP_RD 0x0001
libavcodec/nvdec_mpeg12.c+1−0
@@ -25,6 +25,7 @@ · 24 unmodified lines
2525 #include "avcodec.h"
2626 #include "hwaccel_internal.h"
2727 #include "internal.h"
28+#include "mpegutils.h"
2829 #include "mpegvideo.h"
2930 #include "nvdec.h"
3031 #include "decode.h"
libavcodec/ratecontrol.c+0−1
@@ -32,7 +32,6 @@ · 31 unmodified lines
3232
3333 #include "avcodec.h"
3434 #include "ratecontrol.h"
35−#include "mpegutils.h"
3635 #include "mpegvideoenc.h"
3736 #include "libavutil/eval.h"
3837
libavcodec/rv10.c+0−1
@@ -38,7 +38,6 @@ · 37 unmodified lines
3838 #include "h263data.h"
3939 #include "h263dec.h"
4040 #include "mpeg_er.h"
41−#include "mpegutils.h"
4241 #include "mpegvideo.h"
4342 #include "mpegvideodec.h"
4443 #include "mpeg4video.h"
libavcodec/vc1dec.c+1−0
@@ -36,6 +36,7 @@ · 35 unmodified lines
3636 #include "hwaccel_internal.h"
3737 #include "hwconfig.h"
3838 #include "mpeg_er.h"
39+#include "mpegutils.h"
3940 #include "mpegvideo.h"
4041 #include "mpegvideodec.h"
4142 #include "msmpeg4_vc1_data.h"

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