summaryrefslogtreecommitdiffstats
path: root/media/ffvpx/libavcodec/mpegvideo.h
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-11-03 09:06:25 +0100
committerwolfbeast <mcwerewolf@gmail.com>2018-11-03 09:06:25 +0100
commit1626b5d7041ea9c3db92200f91542da46e49dde6 (patch)
treee99c393052ef818645027da57774672990e29514 /media/ffvpx/libavcodec/mpegvideo.h
parent314fb761d144b160d3aeb72840c89e31c4f21a4a (diff)
parent1d55939c7ca0e80555a24b240ff68d5bdbb48b4a (diff)
downloadUXP-1626b5d7041ea9c3db92200f91542da46e49dde6.tar
UXP-1626b5d7041ea9c3db92200f91542da46e49dde6.tar.gz
UXP-1626b5d7041ea9c3db92200f91542da46e49dde6.tar.lz
UXP-1626b5d7041ea9c3db92200f91542da46e49dde6.tar.xz
UXP-1626b5d7041ea9c3db92200f91542da46e49dde6.zip
Merge branch 'master' into Basilisk-releasev2018.11.04
Diffstat (limited to 'media/ffvpx/libavcodec/mpegvideo.h')
-rw-r--r--media/ffvpx/libavcodec/mpegvideo.h40
1 files changed, 29 insertions, 11 deletions
diff --git a/media/ffvpx/libavcodec/mpegvideo.h b/media/ffvpx/libavcodec/mpegvideo.h
index e9eb633d1..541909cbb 100644
--- a/media/ffvpx/libavcodec/mpegvideo.h
+++ b/media/ffvpx/libavcodec/mpegvideo.h
@@ -45,6 +45,7 @@
#include "mpegpicture.h"
#include "mpegvideodsp.h"
#include "mpegvideoencdsp.h"
+#include "mpegvideodata.h"
#include "pixblockdsp.h"
#include "put_bits.h"
#include "ratecontrol.h"
@@ -71,6 +72,8 @@
#define SLICE_MAX_START_CODE 0x000001af
#define EXT_START_CODE 0x000001b5
#define USER_START_CODE 0x000001b2
+#define SLICE_START_CODE 0x000001b7
+
/**
* MpegEncContext.
@@ -252,9 +255,6 @@ typedef struct MpegEncContext {
int16_t (*b_field_mv_table[2][2][2])[2];///< MV table (4MV per MB) interlaced B-frame encoding
uint8_t (*p_field_select_table[2]);
uint8_t (*b_field_select_table[2][2]);
-#if FF_API_MOTION_EST
- int me_method; ///< ME algorithm
-#endif
int motion_est; ///< ME algorithm
int me_penalty_compensation;
int me_pre; ///< prepass for motion estimation
@@ -381,6 +381,8 @@ typedef struct MpegEncContext {
int custom_pcf;
/* MPEG-4 specific */
+ int studio_profile;
+ int dct_precision;
///< number of bits to represent the fractional part of time (encoder only)
int time_increment_bits;
int last_time_base;
@@ -467,6 +469,13 @@ typedef struct MpegEncContext {
int intra_vlc_format;
int alternate_scan;
int seq_disp_ext;
+ int video_format;
+#define VIDEO_FORMAT_COMPONENT 0
+#define VIDEO_FORMAT_PAL 1
+#define VIDEO_FORMAT_NTSC 2
+#define VIDEO_FORMAT_SECAM 3
+#define VIDEO_FORMAT_MAC 4
+#define VIDEO_FORMAT_UNSPECIFIED 5
int repeat_first_field;
int chroma_420_type;
int chroma_format;
@@ -497,7 +506,10 @@ typedef struct MpegEncContext {
int16_t (*block)[64]; ///< points to one of the following blocks
int16_t (*blocks)[12][64]; // for HQ mode we need to keep the best block
- int (*decode_mb)(struct MpegEncContext *s, int16_t block[6][64]); // used by some codecs to avoid a switch()
+ int (*decode_mb)(struct MpegEncContext *s, int16_t block[12][64]); // used by some codecs to avoid a switch()
+
+ int32_t (*block32)[12][64];
+
#define SLICE_OK 0
#define SLICE_ERROR -1
#define SLICE_END -2 ///<end marker found
@@ -699,10 +711,6 @@ void ff_mpeg_draw_horiz_band(MpegEncContext *s, int y, int h);
void ff_mpeg_flush(AVCodecContext *avctx);
void ff_print_debug_info(MpegEncContext *s, Picture *p, AVFrame *pict);
-void ff_print_debug_info2(AVCodecContext *avctx, AVFrame *pict, uint8_t *mbskip_table,
- uint32_t *mbtype_table, int8_t *qscale_table, int16_t (*motion_val[2])[2],
- int *low_delay,
- int mb_width, int mb_height, int mb_stride, int quarter_sample);
int ff_mpv_export_qp_table(MpegEncContext *s, AVFrame *f, Picture *p, int qp_type);
@@ -729,7 +737,8 @@ void ff_mpv_motion(MpegEncContext *s,
qpel_mc_func (*qpix_op)[16]);
static inline void ff_update_block_index(MpegEncContext *s){
- const int block_size= 8 >> s->avctx->lowres;
+ const int bytes_per_pixel = 1 + (s->avctx->bits_per_raw_sample > 8);
+ const int block_size= (8*bytes_per_pixel) >> s->avctx->lowres;
s->block_index[0]+=2;
s->block_index[1]+=2;
@@ -738,8 +747,8 @@ static inline void ff_update_block_index(MpegEncContext *s){
s->block_index[4]++;
s->block_index[5]++;
s->dest[0]+= 2*block_size;
- s->dest[1]+= block_size;
- s->dest[2]+= block_size;
+ s->dest[1]+= (2 >> s->chroma_x_shift) * block_size;
+ s->dest[2]+= (2 >> s->chroma_x_shift) * block_size;
}
static inline int get_bits_diff(MpegEncContext *s){
@@ -751,4 +760,13 @@ static inline int get_bits_diff(MpegEncContext *s){
return bits - last;
}
+static inline int mpeg_get_qscale(MpegEncContext *s)
+{
+ int qscale = get_bits(&s->gb, 5);
+ if (s->q_scale_type)
+ return ff_mpeg2_non_linear_qscale[qscale];
+ else
+ return qscale << 1;
+}
+
#endif /* AVCODEC_MPEGVIDEO_H */