* [FFmpeg-devel] [PATCH] avcodec/mpegvideo, svq3: Remove unused next_p_frame_damaged
@ 2022-01-10 10:47 Andreas Rheinhardt
2022-01-10 17:51 ` [FFmpeg-devel] [PATCH 2/6] avcodec/svq3: Remove dead topright_samples_available variable, code Andreas Rheinhardt
` (8 more replies)
0 siblings, 9 replies; 11+ messages in thread
From: Andreas Rheinhardt @ 2022-01-10 10:47 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Always zero since 4d2858deac5213eaddfdc06f98379b6325d7b953.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/h263dec.c | 7 -------
libavcodec/mpegvideo.h | 1 -
libavcodec/mpegvideo_dec.c | 1 -
libavcodec/svq3.c | 8 --------
libavcodec/vc1dec.c | 7 -------
5 files changed, 24 deletions(-)
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index 11e80cb9e9..9cc2665cac 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -603,13 +603,6 @@ retry:
avctx->skip_frame >= AVDISCARD_ALL)
return get_consumed_bytes(s, buf_size);
- if (s->next_p_frame_damaged) {
- if (s->pict_type == AV_PICTURE_TYPE_B)
- return get_consumed_bytes(s, buf_size);
- else
- s->next_p_frame_damaged = 0;
- }
-
if ((!s->no_rounding) || s->pict_type == AV_PICTURE_TYPE_B) {
s->me.qpel_put = s->qdsp.put_qpel_pixels_tab;
s->me.qpel_avg = s->qdsp.avg_qpel_pixels_tab;
diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
index 1c14f5b0f0..448fe2cedc 100644
--- a/libavcodec/mpegvideo.h
+++ b/libavcodec/mpegvideo.h
@@ -342,7 +342,6 @@ typedef struct MpegEncContext {
int resync_mb_y; ///< y position of last resync marker
GetBitContext last_resync_gb; ///< used to search for the next resync marker
int mb_num_left; ///< number of MBs left in this video packet (for partitioned Slices only)
- int next_p_frame_damaged; ///< set if the next p frame is damaged, to avoid showing trashed B-frames
#if FF_API_FLAG_TRUNCATED
ParseContext parse_context;
diff --git a/libavcodec/mpegvideo_dec.c b/libavcodec/mpegvideo_dec.c
index 8b625d2835..1e238bd1e1 100644
--- a/libavcodec/mpegvideo_dec.c
+++ b/libavcodec/mpegvideo_dec.c
@@ -132,7 +132,6 @@ do {\
s->next_picture_ptr = REBASE_PICTURE(s1->next_picture_ptr, s, s1);
// Error/bug resilience
- s->next_p_frame_damaged = s1->next_p_frame_damaged;
s->workaround_bugs = s1->workaround_bugs;
s->padding_bug_score = s1->padding_bug_score;
diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
index e329578af0..6f3ade8ace 100644
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@ -98,7 +98,6 @@ typedef struct SVQ3Context {
int has_watermark;
uint32_t watermark_key;
int adaptive_quant;
- int next_p_frame_damaged;
int h_edge_pos;
int v_edge_pos;
int last_frame_output;
@@ -1470,13 +1469,6 @@ static int svq3_decode_frame(AVCodecContext *avctx, void *data,
avctx->skip_frame >= AVDISCARD_ALL)
return 0;
- if (s->next_p_frame_damaged) {
- if (s->pict_type == AV_PICTURE_TYPE_B)
- return 0;
- else
- s->next_p_frame_damaged = 0;
- }
-
if (s->pict_type == AV_PICTURE_TYPE_B) {
s->frame_num_offset = s->slice_num - s->prev_frame_num;
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 267d72d15b..7ed5133cfa 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -872,13 +872,6 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
goto end;
}
- if (s->next_p_frame_damaged) {
- if (s->pict_type == AV_PICTURE_TYPE_B)
- goto end;
- else
- s->next_p_frame_damaged = 0;
- }
-
if ((ret = ff_mpv_frame_start(s, avctx)) < 0) {
goto err;
}
--
2.32.0
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 11+ messages in thread
* [FFmpeg-devel] [PATCH 2/6] avcodec/svq3: Remove dead topright_samples_available variable, code
2022-01-10 10:47 [FFmpeg-devel] [PATCH] avcodec/mpegvideo, svq3: Remove unused next_p_frame_damaged Andreas Rheinhardt
@ 2022-01-10 17:51 ` Andreas Rheinhardt
2022-01-10 17:51 ` [FFmpeg-devel] [PATCH 3/6] avcodec/h264_slice: Inline H264 codec id Andreas Rheinhardt
` (7 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: Andreas Rheinhardt @ 2022-01-10 17:51 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Topright samples are always available.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/svq3.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
index 6f3ade8ace..a3f434ff8d 100644
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@ -128,7 +128,6 @@ typedef struct SVQ3Context {
int8_t (*intra4x4_pred_mode);
unsigned int top_samples_available;
- unsigned int topright_samples_available;
unsigned int left_samples_available;
uint8_t *edge_emu_buffer;
@@ -638,15 +637,10 @@ static av_always_inline void hl_decode_mb_predict_luma(SVQ3Context *s,
const int dir = s->intra4x4_pred_mode_cache[scan8[i]];
uint8_t *topright;
- int nnz, tr;
+ int nnz;
if (dir == DIAG_DOWN_LEFT_PRED || dir == VERT_LEFT_PRED) {
- const int topright_avail = (s->topright_samples_available << i) & 0x8000;
av_assert2(s->mb_y || linesize <= block_offset[i]);
- if (!topright_avail) {
- tr = ptr[3 - linesize] * 0x01010101u;
- topright = (uint8_t *)&tr;
- } else
- topright = ptr + 4 - linesize;
+ topright = ptr + 4 - linesize;
} else
topright = NULL;
@@ -721,7 +715,6 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type)
s->top_samples_available = (s->mb_y == 0) ? 0x33FF : 0xFFFF;
s->left_samples_available = (s->mb_x == 0) ? 0x5F5F : 0xFFFF;
- s->topright_samples_available = 0xFFFF;
if (mb_type == 0) { /* SKIP */
if (s->pict_type == AV_PICTURE_TYPE_P ||
--
2.32.0
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 11+ messages in thread
* [FFmpeg-devel] [PATCH 3/6] avcodec/h264_slice: Inline H264 codec id
2022-01-10 10:47 [FFmpeg-devel] [PATCH] avcodec/mpegvideo, svq3: Remove unused next_p_frame_damaged Andreas Rheinhardt
2022-01-10 17:51 ` [FFmpeg-devel] [PATCH 2/6] avcodec/svq3: Remove dead topright_samples_available variable, code Andreas Rheinhardt
@ 2022-01-10 17:51 ` Andreas Rheinhardt
2022-01-10 17:51 ` [FFmpeg-devel] [PATCH 4/6] avcodec/h264pred: Don't compile > 8 bit versions of VP7/8 functions Andreas Rheinhardt
` (6 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: Andreas Rheinhardt @ 2022-01-10 17:51 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
This code is only reached by the H.264 decoder.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/h264_slice.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index f9c300bc2b..4833282191 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -998,7 +998,7 @@ static int h264_slice_header_init(H264Context *h)
sps->chroma_format_idc);
ff_h264chroma_init(&h->h264chroma, sps->bit_depth_chroma);
ff_h264qpel_init(&h->h264qpel, sps->bit_depth_luma);
- ff_h264_pred_init(&h->hpc, h->avctx->codec_id, sps->bit_depth_luma,
+ ff_h264_pred_init(&h->hpc, AV_CODEC_ID_H264, sps->bit_depth_luma,
sps->chroma_format_idc);
ff_videodsp_init(&h->vdsp, sps->bit_depth_luma);
--
2.32.0
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 11+ messages in thread
* [FFmpeg-devel] [PATCH 4/6] avcodec/h264pred: Don't compile > 8 bit versions of VP7/8 functions
2022-01-10 10:47 [FFmpeg-devel] [PATCH] avcodec/mpegvideo, svq3: Remove unused next_p_frame_damaged Andreas Rheinhardt
2022-01-10 17:51 ` [FFmpeg-devel] [PATCH 2/6] avcodec/svq3: Remove dead topright_samples_available variable, code Andreas Rheinhardt
2022-01-10 17:51 ` [FFmpeg-devel] [PATCH 3/6] avcodec/h264_slice: Inline H264 codec id Andreas Rheinhardt
@ 2022-01-10 17:51 ` Andreas Rheinhardt
2022-01-10 17:51 ` [FFmpeg-devel] [PATCH 5/6] avcodec/h264pred: Remove dead > 8 pixels checks for 8bit codecs Andreas Rheinhardt
` (5 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: Andreas Rheinhardt @ 2022-01-10 17:51 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
VP7 and VP8 are eight bit only.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/h264pred.c | 36 ++++++++++++++++++++++++++++------
libavcodec/h264pred_template.c | 34 ++++++--------------------------
2 files changed, 36 insertions(+), 34 deletions(-)
diff --git a/libavcodec/h264pred.c b/libavcodec/h264pred.c
index bd0d4a3d06..731cf48ea6 100644
--- a/libavcodec/h264pred.c
+++ b/libavcodec/h264pred.c
@@ -53,6 +53,30 @@
#include "h264pred_template.c"
#undef BIT_DEPTH
+static void pred4x4_127_dc_c(uint8_t *src, const uint8_t *topright,
+ ptrdiff_t _stride)
+{
+ int stride = _stride;
+ const uint32_t a = 0x7F7F7F7FU;
+
+ AV_WN32A(src + 0 * stride, a);
+ AV_WN32A(src + 1 * stride, a);
+ AV_WN32A(src + 2 * stride, a);
+ AV_WN32A(src + 3 * stride, a);
+}
+
+static void pred4x4_129_dc_c(uint8_t *src, const uint8_t *topright,
+ ptrdiff_t _stride)
+{
+ int stride = _stride;
+ const uint32_t a = 0x81818181U;
+
+ AV_WN32A(src + 0 * stride, a);
+ AV_WN32A(src + 1 * stride, a);
+ AV_WN32A(src + 2 * stride, a);
+ AV_WN32A(src + 3 * stride, a);
+}
+
static void pred4x4_vertical_vp8_c(uint8_t *src, const uint8_t *topright,
ptrdiff_t stride)
{
@@ -447,8 +471,8 @@ av_cold void ff_h264_pred_init(H264PredContext *h, int codec_id,
h->pred4x4[TOP_DC_PRED ]= FUNCC(pred4x4_top_dc , depth);\
} else {\
h->pred4x4[TM_VP8_PRED ]= FUNCD(pred4x4_tm_vp8);\
- h->pred4x4[DC_127_PRED ]= FUNCC(pred4x4_127_dc , depth);\
- h->pred4x4[DC_129_PRED ]= FUNCC(pred4x4_129_dc , depth);\
+ h->pred4x4[DC_127_PRED ]= FUNCD(pred4x4_127_dc);\
+ h->pred4x4[DC_129_PRED ]= FUNCD(pred4x4_129_dc);\
h->pred4x4[VERT_VP8_PRED ]= FUNCC(pred4x4_vertical , depth);\
h->pred4x4[HOR_VP8_PRED ]= FUNCC(pred4x4_horizontal , depth);\
}\
@@ -524,8 +548,8 @@ av_cold void ff_h264_pred_init(H264PredContext *h, int codec_id,
h->pred8x8[LEFT_DC_PRED8x8]= FUNCD(pred8x8_left_dc_rv40);\
h->pred8x8[TOP_DC_PRED8x8 ]= FUNCD(pred8x8_top_dc_rv40);\
if (codec_id == AV_CODEC_ID_VP7 || codec_id == AV_CODEC_ID_VP8) {\
- h->pred8x8[DC_127_PRED8x8]= FUNCC(pred8x8_127_dc , depth);\
- h->pred8x8[DC_129_PRED8x8]= FUNCC(pred8x8_129_dc , depth);\
+ h->pred8x8[DC_127_PRED8x8]= FUNCC(pred8x8_127_dc, 8);\
+ h->pred8x8[DC_129_PRED8x8]= FUNCC(pred8x8_129_dc, 8);\
}\
}\
if (chroma_format_idc <= 1) {\
@@ -547,8 +571,8 @@ av_cold void ff_h264_pred_init(H264PredContext *h, int codec_id,
case AV_CODEC_ID_VP7:\
case AV_CODEC_ID_VP8:\
h->pred16x16[PLANE_PRED8x8 ]= FUNCD(pred16x16_tm_vp8);\
- h->pred16x16[DC_127_PRED8x8]= FUNCC(pred16x16_127_dc , depth);\
- h->pred16x16[DC_129_PRED8x8]= FUNCC(pred16x16_129_dc , depth);\
+ h->pred16x16[DC_127_PRED8x8]= FUNCC(pred16x16_127_dc, 8);\
+ h->pred16x16[DC_129_PRED8x8]= FUNCC(pred16x16_129_dc, 8);\
break;\
default:\
h->pred16x16[PLANE_PRED8x8 ]= FUNCC(pred16x16_plane , depth);\
diff --git a/libavcodec/h264pred_template.c b/libavcodec/h264pred_template.c
index 2b30fff70f..b5bc942a5e 100644
--- a/libavcodec/h264pred_template.c
+++ b/libavcodec/h264pred_template.c
@@ -111,32 +111,6 @@ static void FUNCC(pred4x4_128_dc)(uint8_t *_src, const uint8_t *topright,
AV_WN4PA(src+3*stride, a);
}
-static void FUNCC(pred4x4_127_dc)(uint8_t *_src, const uint8_t *topright,
- ptrdiff_t _stride)
-{
- pixel *src = (pixel*)_src;
- int stride = _stride>>(sizeof(pixel)-1);
- const pixel4 a = PIXEL_SPLAT_X4((1<<(BIT_DEPTH-1))-1);
-
- AV_WN4PA(src+0*stride, a);
- AV_WN4PA(src+1*stride, a);
- AV_WN4PA(src+2*stride, a);
- AV_WN4PA(src+3*stride, a);
-}
-
-static void FUNCC(pred4x4_129_dc)(uint8_t *_src, const uint8_t *topright,
- ptrdiff_t _stride)
-{
- pixel *src = (pixel*)_src;
- int stride = _stride>>(sizeof(pixel)-1);
- const pixel4 a = PIXEL_SPLAT_X4((1<<(BIT_DEPTH-1))+1);
-
- AV_WN4PA(src+0*stride, a);
- AV_WN4PA(src+1*stride, a);
- AV_WN4PA(src+2*stride, a);
- AV_WN4PA(src+3*stride, a);
-}
-
#define LOAD_TOP_RIGHT_EDGE\
const unsigned av_unused t4 = topright[0];\
@@ -427,9 +401,11 @@ static void FUNCC(pred16x16_##n##_dc)(uint8_t *_src, ptrdiff_t stride)\
PREDICT_16x16_DC(PIXEL_SPLAT_X4(v));\
}
-PRED16x16_X(127, (1<<(BIT_DEPTH-1))-1)
PRED16x16_X(128, (1<<(BIT_DEPTH-1))+0)
+#if BIT_DEPTH == 8
+PRED16x16_X(127, (1<<(BIT_DEPTH-1))-1)
PRED16x16_X(129, (1<<(BIT_DEPTH-1))+1)
+#endif
static inline void FUNCC(pred16x16_plane_compat)(uint8_t *_src,
ptrdiff_t _stride,
@@ -551,9 +527,11 @@ static void FUNCC(pred8x8_##n##_dc)(uint8_t *_src, ptrdiff_t stride)\
}\
}
-PRED8x8_X(127, (1<<(BIT_DEPTH-1))-1)
PRED8x8_X(128, (1<<(BIT_DEPTH-1))+0)
+#if BIT_DEPTH == 8
+PRED8x8_X(127, (1<<(BIT_DEPTH-1))-1)
PRED8x8_X(129, (1<<(BIT_DEPTH-1))+1)
+#endif
static void FUNCC(pred8x16_128_dc)(uint8_t *_src, ptrdiff_t stride)
{
--
2.32.0
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 11+ messages in thread
* [FFmpeg-devel] [PATCH 5/6] avcodec/h264pred: Remove dead > 8 pixels checks for 8bit codecs
2022-01-10 10:47 [FFmpeg-devel] [PATCH] avcodec/mpegvideo, svq3: Remove unused next_p_frame_damaged Andreas Rheinhardt
` (2 preceding siblings ...)
2022-01-10 17:51 ` [FFmpeg-devel] [PATCH 4/6] avcodec/h264pred: Don't compile > 8 bit versions of VP7/8 functions Andreas Rheinhardt
@ 2022-01-10 17:51 ` Andreas Rheinhardt
2022-01-10 17:51 ` [FFmpeg-devel] [PATCH 6/6] avcodec/h264pred: Reindentation Andreas Rheinhardt
` (4 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: Andreas Rheinhardt @ 2022-01-10 17:51 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
RV40, SVQ3 and VP7/VP8 are eight-bit only, so it makes no sense
to check for them in the codepath initializing > eight bit contexts.
Move the codec-specific code to a switch located after the eight-bit
init code where this is easily possible; and add checks to the macro
to enable the compiler to remove the remaining checks when initializing
bitdepths > 8 at compile-time.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/h264pred.c | 101 ++++++++++++++++--------------------------
1 file changed, 37 insertions(+), 64 deletions(-)
diff --git a/libavcodec/h264pred.c b/libavcodec/h264pred.c
index 731cf48ea6..2d115f7b43 100644
--- a/libavcodec/h264pred.c
+++ b/libavcodec/h264pred.c
@@ -445,56 +445,19 @@ av_cold void ff_h264_pred_init(H264PredContext *h, int codec_id,
#define FUNCD(a) a ## _c
#define H264_PRED(depth) \
- if(codec_id != AV_CODEC_ID_RV40){\
- if (codec_id == AV_CODEC_ID_VP7 || codec_id == AV_CODEC_ID_VP8) {\
- h->pred4x4[VERT_PRED ]= FUNCD(pred4x4_vertical_vp8);\
- h->pred4x4[HOR_PRED ]= FUNCD(pred4x4_horizontal_vp8);\
- } else {\
h->pred4x4[VERT_PRED ]= FUNCC(pred4x4_vertical , depth);\
h->pred4x4[HOR_PRED ]= FUNCC(pred4x4_horizontal , depth);\
- }\
h->pred4x4[DC_PRED ]= FUNCC(pred4x4_dc , depth);\
- if(codec_id == AV_CODEC_ID_SVQ3)\
- h->pred4x4[DIAG_DOWN_LEFT_PRED ]= FUNCD(pred4x4_down_left_svq3);\
- else\
h->pred4x4[DIAG_DOWN_LEFT_PRED ]= FUNCC(pred4x4_down_left , depth);\
h->pred4x4[DIAG_DOWN_RIGHT_PRED]= FUNCC(pred4x4_down_right , depth);\
h->pred4x4[VERT_RIGHT_PRED ]= FUNCC(pred4x4_vertical_right , depth);\
h->pred4x4[HOR_DOWN_PRED ]= FUNCC(pred4x4_horizontal_down , depth);\
- if (codec_id == AV_CODEC_ID_VP7 || codec_id == AV_CODEC_ID_VP8) {\
- h->pred4x4[VERT_LEFT_PRED ]= FUNCD(pred4x4_vertical_left_vp8);\
- } else\
h->pred4x4[VERT_LEFT_PRED ]= FUNCC(pred4x4_vertical_left , depth);\
h->pred4x4[HOR_UP_PRED ]= FUNCC(pred4x4_horizontal_up , depth);\
- if (codec_id != AV_CODEC_ID_VP7 && codec_id != AV_CODEC_ID_VP8) {\
h->pred4x4[LEFT_DC_PRED ]= FUNCC(pred4x4_left_dc , depth);\
h->pred4x4[TOP_DC_PRED ]= FUNCC(pred4x4_top_dc , depth);\
- } else {\
- h->pred4x4[TM_VP8_PRED ]= FUNCD(pred4x4_tm_vp8);\
- h->pred4x4[DC_127_PRED ]= FUNCD(pred4x4_127_dc);\
- h->pred4x4[DC_129_PRED ]= FUNCD(pred4x4_129_dc);\
- h->pred4x4[VERT_VP8_PRED ]= FUNCC(pred4x4_vertical , depth);\
- h->pred4x4[HOR_VP8_PRED ]= FUNCC(pred4x4_horizontal , depth);\
- }\
- if (codec_id != AV_CODEC_ID_VP8)\
+ if (depth > 8 || codec_id != AV_CODEC_ID_VP8)\
h->pred4x4[DC_128_PRED ]= FUNCC(pred4x4_128_dc , depth);\
- }else{\
- h->pred4x4[VERT_PRED ]= FUNCC(pred4x4_vertical , depth);\
- h->pred4x4[HOR_PRED ]= FUNCC(pred4x4_horizontal , depth);\
- h->pred4x4[DC_PRED ]= FUNCC(pred4x4_dc , depth);\
- h->pred4x4[DIAG_DOWN_LEFT_PRED ]= FUNCD(pred4x4_down_left_rv40);\
- h->pred4x4[DIAG_DOWN_RIGHT_PRED]= FUNCC(pred4x4_down_right , depth);\
- h->pred4x4[VERT_RIGHT_PRED ]= FUNCC(pred4x4_vertical_right , depth);\
- h->pred4x4[HOR_DOWN_PRED ]= FUNCC(pred4x4_horizontal_down , depth);\
- h->pred4x4[VERT_LEFT_PRED ]= FUNCD(pred4x4_vertical_left_rv40);\
- h->pred4x4[HOR_UP_PRED ]= FUNCD(pred4x4_horizontal_up_rv40);\
- h->pred4x4[LEFT_DC_PRED ]= FUNCC(pred4x4_left_dc , depth);\
- h->pred4x4[TOP_DC_PRED ]= FUNCC(pred4x4_top_dc , depth);\
- h->pred4x4[DC_128_PRED ]= FUNCC(pred4x4_128_dc , depth);\
- h->pred4x4[DIAG_DOWN_LEFT_PRED_RV40_NODOWN]= FUNCD(pred4x4_down_left_rv40_nodown);\
- h->pred4x4[HOR_UP_PRED_RV40_NODOWN]= FUNCD(pred4x4_horizontal_up_rv40_nodown);\
- h->pred4x4[VERT_LEFT_PRED_RV40_NODOWN]= FUNCD(pred4x4_vertical_left_rv40_nodown);\
- }\
\
h->pred8x8l[VERT_PRED ]= FUNCC(pred8x8l_vertical , depth);\
h->pred8x8l[HOR_PRED ]= FUNCC(pred8x8l_horizontal , depth);\
@@ -516,16 +479,14 @@ av_cold void ff_h264_pred_init(H264PredContext *h, int codec_id,
h->pred8x8[VERT_PRED8x8 ]= FUNCC(pred8x16_vertical , depth);\
h->pred8x8[HOR_PRED8x8 ]= FUNCC(pred8x16_horizontal , depth);\
}\
- if (codec_id != AV_CODEC_ID_VP7 && codec_id != AV_CODEC_ID_VP8) {\
if (chroma_format_idc <= 1) {\
h->pred8x8[PLANE_PRED8x8]= FUNCC(pred8x8_plane , depth);\
} else {\
h->pred8x8[PLANE_PRED8x8]= FUNCC(pred8x16_plane , depth);\
}\
- } else\
- h->pred8x8[PLANE_PRED8x8]= FUNCD(pred8x8_tm_vp8);\
- if (codec_id != AV_CODEC_ID_RV40 && codec_id != AV_CODEC_ID_VP7 && \
- codec_id != AV_CODEC_ID_VP8) {\
+ if (depth > 8 || (codec_id != AV_CODEC_ID_RV40 && \
+ codec_id != AV_CODEC_ID_VP7 && \
+ codec_id != AV_CODEC_ID_VP8)) { \
if (chroma_format_idc <= 1) {\
h->pred8x8[DC_PRED8x8 ]= FUNCC(pred8x8_dc , depth);\
h->pred8x8[LEFT_DC_PRED8x8]= FUNCC(pred8x8_left_dc , depth);\
@@ -547,10 +508,6 @@ av_cold void ff_h264_pred_init(H264PredContext *h, int codec_id,
h->pred8x8[DC_PRED8x8 ]= FUNCD(pred8x8_dc_rv40);\
h->pred8x8[LEFT_DC_PRED8x8]= FUNCD(pred8x8_left_dc_rv40);\
h->pred8x8[TOP_DC_PRED8x8 ]= FUNCD(pred8x8_top_dc_rv40);\
- if (codec_id == AV_CODEC_ID_VP7 || codec_id == AV_CODEC_ID_VP8) {\
- h->pred8x8[DC_127_PRED8x8]= FUNCC(pred8x8_127_dc, 8);\
- h->pred8x8[DC_129_PRED8x8]= FUNCC(pred8x8_129_dc, 8);\
- }\
}\
if (chroma_format_idc <= 1) {\
h->pred8x8[DC_128_PRED8x8 ]= FUNCC(pred8x8_128_dc , depth);\
@@ -561,23 +518,7 @@ av_cold void ff_h264_pred_init(H264PredContext *h, int codec_id,
h->pred16x16[DC_PRED8x8 ]= FUNCC(pred16x16_dc , depth);\
h->pred16x16[VERT_PRED8x8 ]= FUNCC(pred16x16_vertical , depth);\
h->pred16x16[HOR_PRED8x8 ]= FUNCC(pred16x16_horizontal , depth);\
- switch(codec_id){\
- case AV_CODEC_ID_SVQ3:\
- h->pred16x16[PLANE_PRED8x8 ]= FUNCD(pred16x16_plane_svq3);\
- break;\
- case AV_CODEC_ID_RV40:\
- h->pred16x16[PLANE_PRED8x8 ]= FUNCD(pred16x16_plane_rv40);\
- break;\
- case AV_CODEC_ID_VP7:\
- case AV_CODEC_ID_VP8:\
- h->pred16x16[PLANE_PRED8x8 ]= FUNCD(pred16x16_tm_vp8);\
- h->pred16x16[DC_127_PRED8x8]= FUNCC(pred16x16_127_dc, 8);\
- h->pred16x16[DC_129_PRED8x8]= FUNCC(pred16x16_129_dc, 8);\
- break;\
- default:\
- h->pred16x16[PLANE_PRED8x8 ]= FUNCC(pred16x16_plane , depth);\
- break;\
- }\
+ h->pred16x16[PLANE_PRED8x8 ]= FUNCC(pred16x16_plane , depth);\
h->pred16x16[LEFT_DC_PRED8x8]= FUNCC(pred16x16_left_dc , depth);\
h->pred16x16[TOP_DC_PRED8x8 ]= FUNCC(pred16x16_top_dc , depth);\
h->pred16x16[DC_128_PRED8x8 ]= FUNCC(pred16x16_128_dc , depth);\
@@ -615,6 +556,38 @@ av_cold void ff_h264_pred_init(H264PredContext *h, int codec_id,
default:
av_assert0(bit_depth<=8);
H264_PRED(8)
+ switch (codec_id) {
+ case AV_CODEC_ID_SVQ3:
+ h->pred4x4[DIAG_DOWN_LEFT_PRED] = FUNCD(pred4x4_down_left_svq3);
+ h->pred16x16[PLANE_PRED8x8 ] = FUNCD(pred16x16_plane_svq3);
+ break;
+ case AV_CODEC_ID_RV40:
+ h->pred4x4[DIAG_DOWN_LEFT_PRED] = FUNCD(pred4x4_down_left_rv40);
+ h->pred4x4[VERT_LEFT_PRED ] = FUNCD(pred4x4_vertical_left_rv40);
+ h->pred4x4[HOR_UP_PRED ] = FUNCD(pred4x4_horizontal_up_rv40);
+ h->pred4x4[DIAG_DOWN_LEFT_PRED_RV40_NODOWN] = FUNCD(pred4x4_down_left_rv40_nodown);
+ h->pred4x4[HOR_UP_PRED_RV40_NODOWN] = FUNCD(pred4x4_horizontal_up_rv40_nodown);
+ h->pred4x4[VERT_LEFT_PRED_RV40_NODOWN] = FUNCD(pred4x4_vertical_left_rv40_nodown);
+ h->pred16x16[PLANE_PRED8x8 ] = FUNCD(pred16x16_plane_rv40);
+ break;
+ case AV_CODEC_ID_VP7:
+ case AV_CODEC_ID_VP8:
+ h->pred4x4[VERT_PRED ] = FUNCD(pred4x4_vertical_vp8);
+ h->pred4x4[HOR_PRED ] = FUNCD(pred4x4_horizontal_vp8);
+ h->pred4x4[VERT_LEFT_PRED ] = FUNCD(pred4x4_vertical_left_vp8);
+ h->pred4x4[TM_VP8_PRED ] = FUNCD(pred4x4_tm_vp8);
+ h->pred4x4[VERT_VP8_PRED ] = FUNCC(pred4x4_vertical, 8);
+ h->pred4x4[DC_127_PRED ] = FUNCD(pred4x4_127_dc);
+ h->pred4x4[DC_129_PRED ] = FUNCD(pred4x4_129_dc);
+ h->pred4x4[HOR_VP8_PRED ] = FUNCC(pred4x4_horizontal, 8);
+ h->pred8x8[PLANE_PRED8x8 ] = FUNCD(pred8x8_tm_vp8);
+ h->pred8x8[DC_127_PRED8x8 ] = FUNCC(pred8x8_127_dc, 8);
+ h->pred8x8[DC_129_PRED8x8 ] = FUNCC(pred8x8_129_dc, 8);
+ h->pred16x16[PLANE_PRED8x8 ] = FUNCD(pred16x16_tm_vp8);
+ h->pred16x16[DC_127_PRED8x8] = FUNCC(pred16x16_127_dc, 8);
+ h->pred16x16[DC_129_PRED8x8] = FUNCC(pred16x16_129_dc, 8);
+ break;
+ }
break;
}
--
2.32.0
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 11+ messages in thread
* [FFmpeg-devel] [PATCH 6/6] avcodec/h264pred: Reindentation
2022-01-10 10:47 [FFmpeg-devel] [PATCH] avcodec/mpegvideo, svq3: Remove unused next_p_frame_damaged Andreas Rheinhardt
` (3 preceding siblings ...)
2022-01-10 17:51 ` [FFmpeg-devel] [PATCH 5/6] avcodec/h264pred: Remove dead > 8 pixels checks for 8bit codecs Andreas Rheinhardt
@ 2022-01-10 17:51 ` Andreas Rheinhardt
2022-01-10 22:55 ` [FFmpeg-devel] [PATCH 7/9] avcodec/mpegvideo: Don't set unrestricted_mv for decoders Andreas Rheinhardt
` (3 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: Andreas Rheinhardt @ 2022-01-10 17:51 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/h264pred.c | 35 ++++++++++++++++-------------------
1 file changed, 16 insertions(+), 19 deletions(-)
diff --git a/libavcodec/h264pred.c b/libavcodec/h264pred.c
index 2d115f7b43..d83ca37a69 100644
--- a/libavcodec/h264pred.c
+++ b/libavcodec/h264pred.c
@@ -445,19 +445,19 @@ av_cold void ff_h264_pred_init(H264PredContext *h, int codec_id,
#define FUNCD(a) a ## _c
#define H264_PRED(depth) \
- h->pred4x4[VERT_PRED ]= FUNCC(pred4x4_vertical , depth);\
- h->pred4x4[HOR_PRED ]= FUNCC(pred4x4_horizontal , depth);\
- h->pred4x4[DC_PRED ]= FUNCC(pred4x4_dc , depth);\
- h->pred4x4[DIAG_DOWN_LEFT_PRED ]= FUNCC(pred4x4_down_left , depth);\
- h->pred4x4[DIAG_DOWN_RIGHT_PRED]= FUNCC(pred4x4_down_right , depth);\
- h->pred4x4[VERT_RIGHT_PRED ]= FUNCC(pred4x4_vertical_right , depth);\
- h->pred4x4[HOR_DOWN_PRED ]= FUNCC(pred4x4_horizontal_down , depth);\
- h->pred4x4[VERT_LEFT_PRED ]= FUNCC(pred4x4_vertical_left , depth);\
- h->pred4x4[HOR_UP_PRED ]= FUNCC(pred4x4_horizontal_up , depth);\
- h->pred4x4[LEFT_DC_PRED ]= FUNCC(pred4x4_left_dc , depth);\
- h->pred4x4[TOP_DC_PRED ]= FUNCC(pred4x4_top_dc , depth);\
+ h->pred4x4[VERT_PRED ] = FUNCC(pred4x4_vertical, depth);\
+ h->pred4x4[HOR_PRED ] = FUNCC(pred4x4_horizontal, depth);\
+ h->pred4x4[DC_PRED ] = FUNCC(pred4x4_dc, depth);\
+ h->pred4x4[DIAG_DOWN_LEFT_PRED ] = FUNCC(pred4x4_down_left, depth);\
+ h->pred4x4[DIAG_DOWN_RIGHT_PRED] = FUNCC(pred4x4_down_right, depth);\
+ h->pred4x4[VERT_RIGHT_PRED ] = FUNCC(pred4x4_vertical_right, depth);\
+ h->pred4x4[HOR_DOWN_PRED ] = FUNCC(pred4x4_horizontal_down, depth);\
+ h->pred4x4[VERT_LEFT_PRED ] = FUNCC(pred4x4_vertical_left, depth);\
+ h->pred4x4[HOR_UP_PRED ] = FUNCC(pred4x4_horizontal_up, depth);\
+ h->pred4x4[LEFT_DC_PRED ] = FUNCC(pred4x4_left_dc, depth);\
+ h->pred4x4[TOP_DC_PRED ] = FUNCC(pred4x4_top_dc, depth);\
if (depth > 8 || codec_id != AV_CODEC_ID_VP8)\
- h->pred4x4[DC_128_PRED ]= FUNCC(pred4x4_128_dc , depth);\
+ h->pred4x4[DC_128_PRED ] = FUNCC(pred4x4_128_dc, depth);\
\
h->pred8x8l[VERT_PRED ]= FUNCC(pred8x8l_vertical , depth);\
h->pred8x8l[HOR_PRED ]= FUNCC(pred8x8l_horizontal , depth);\
@@ -475,15 +475,12 @@ av_cold void ff_h264_pred_init(H264PredContext *h, int codec_id,
if (chroma_format_idc <= 1) {\
h->pred8x8[VERT_PRED8x8 ]= FUNCC(pred8x8_vertical , depth);\
h->pred8x8[HOR_PRED8x8 ]= FUNCC(pred8x8_horizontal , depth);\
+ h->pred8x8[PLANE_PRED8x8] = FUNCC(pred8x8_plane, depth);\
} else {\
h->pred8x8[VERT_PRED8x8 ]= FUNCC(pred8x16_vertical , depth);\
h->pred8x8[HOR_PRED8x8 ]= FUNCC(pred8x16_horizontal , depth);\
+ h->pred8x8[PLANE_PRED8x8] = FUNCC(pred8x16_plane, depth);\
}\
- if (chroma_format_idc <= 1) {\
- h->pred8x8[PLANE_PRED8x8]= FUNCC(pred8x8_plane , depth);\
- } else {\
- h->pred8x8[PLANE_PRED8x8]= FUNCC(pred8x16_plane , depth);\
- }\
if (depth > 8 || (codec_id != AV_CODEC_ID_RV40 && \
codec_id != AV_CODEC_ID_VP7 && \
codec_id != AV_CODEC_ID_VP8)) { \
@@ -531,8 +528,8 @@ av_cold void ff_h264_pred_init(H264PredContext *h, int codec_id,
h->pred8x8l_filter_add [VERT_PRED ]= FUNCC(pred8x8l_vertical_filter_add , depth);\
h->pred8x8l_filter_add [ HOR_PRED ]= FUNCC(pred8x8l_horizontal_filter_add , depth);\
if (chroma_format_idc <= 1) {\
- h->pred8x8_add [VERT_PRED8x8]= FUNCC(pred8x8_vertical_add , depth);\
- h->pred8x8_add [ HOR_PRED8x8]= FUNCC(pred8x8_horizontal_add , depth);\
+ h->pred8x8_add[VERT_PRED8x8] = FUNCC(pred8x8_vertical_add, depth);\
+ h->pred8x8_add[ HOR_PRED8x8] = FUNCC(pred8x8_horizontal_add, depth);\
} else {\
h->pred8x8_add [VERT_PRED8x8]= FUNCC(pred8x16_vertical_add , depth);\
h->pred8x8_add [ HOR_PRED8x8]= FUNCC(pred8x16_horizontal_add , depth);\
--
2.32.0
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 11+ messages in thread
* [FFmpeg-devel] [PATCH 7/9] avcodec/mpegvideo: Don't set unrestricted_mv for decoders
2022-01-10 10:47 [FFmpeg-devel] [PATCH] avcodec/mpegvideo, svq3: Remove unused next_p_frame_damaged Andreas Rheinhardt
` (4 preceding siblings ...)
2022-01-10 17:51 ` [FFmpeg-devel] [PATCH 6/6] avcodec/h264pred: Reindentation Andreas Rheinhardt
@ 2022-01-10 22:55 ` Andreas Rheinhardt
2022-01-10 22:55 ` [FFmpeg-devel] [PATCH 8/9] avcodec/mpeg4videodec: Avoid multiple consecutive av_log() Andreas Rheinhardt
` (2 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: Andreas Rheinhardt @ 2022-01-10 22:55 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
It is write-only for them.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/flvdec.c | 1 -
libavcodec/h263dec.c | 2 --
libavcodec/intelh263dec.c | 1 -
libavcodec/ituh263dec.c | 2 --
libavcodec/rv10.c | 2 --
5 files changed, 8 deletions(-)
diff --git a/libavcodec/flvdec.c b/libavcodec/flvdec.c
index 6258c1c0a7..2ddcf021fd 100644
--- a/libavcodec/flvdec.c
+++ b/libavcodec/flvdec.c
@@ -90,7 +90,6 @@ int ff_flv_decode_picture_header(MpegEncContext *s)
s->h263_plus = 0;
- s->unrestricted_mv = 1;
s->h263_long_vectors = 0;
/* PEI */
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index 9cc2665cac..ac48acf47a 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -83,13 +83,11 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx)
s->quant_precision = 5;
s->decode_mb = ff_h263_decode_mb;
s->low_delay = 1;
- s->unrestricted_mv = 1;
/* select sub codec */
switch (avctx->codec->id) {
case AV_CODEC_ID_H263:
case AV_CODEC_ID_H263P:
- s->unrestricted_mv = 0;
avctx->chroma_sample_location = AVCHROMA_LOC_CENTER;
break;
case AV_CODEC_ID_MPEG4:
diff --git a/libavcodec/intelh263dec.c b/libavcodec/intelh263dec.c
index 7c794dc5e3..58c1b63c0a 100644
--- a/libavcodec/intelh263dec.c
+++ b/libavcodec/intelh263dec.c
@@ -66,7 +66,6 @@ int ff_intel_h263_decode_picture_header(MpegEncContext *s)
return -1; /* SAC: off */
}
s->obmc= get_bits1(&s->gb);
- s->unrestricted_mv = s->obmc || s->h263_long_vectors;
s->pb_frame = get_bits1(&s->gb);
if (format < 6) {
diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c
index 17af5d7f89..5329e62a5e 100644
--- a/libavcodec/ituh263dec.c
+++ b/libavcodec/ituh263dec.c
@@ -1150,7 +1150,6 @@ int ff_h263_decode_picture_header(MpegEncContext *s)
return -1; /* SAC: off */
}
s->obmc= get_bits1(&s->gb); /* Advanced prediction mode */
- s->unrestricted_mv = s->h263_long_vectors || s->obmc;
s->pb_frame = get_bits1(&s->gb);
s->chroma_qscale= s->qscale = get_bits(&s->gb, 5);
@@ -1180,7 +1179,6 @@ int ff_h263_decode_picture_header(MpegEncContext *s)
s->obmc= get_bits1(&s->gb); /* Advanced prediction mode */
s->h263_aic = get_bits1(&s->gb); /* Advanced Intra Coding (AIC) */
s->loop_filter= get_bits1(&s->gb);
- s->unrestricted_mv = s->umvplus || s->obmc || s->loop_filter;
if(s->avctx->lowres)
s->loop_filter = 0;
diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c
index d8261c34c7..0dc2c87335 100644
--- a/libavcodec/rv10.c
+++ b/libavcodec/rv10.c
@@ -149,7 +149,6 @@ static int rv10_decode_picture_header(MpegEncContext *s)
}
skip_bits(&s->gb, 3); /* ignored */
s->f_code = 1;
- s->unrestricted_mv = 1;
return mb_count;
}
@@ -298,7 +297,6 @@ static int rv20_decode_picture_header(RVDecContext *rv, int whole_size)
skip_bits(&s->gb, 5);
s->f_code = 1;
- s->unrestricted_mv = 1;
s->h263_aic = s->pict_type == AV_PICTURE_TYPE_I;
s->modified_quant = 1;
if (!s->avctx->lowres)
--
2.32.0
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 11+ messages in thread
* [FFmpeg-devel] [PATCH 8/9] avcodec/mpeg4videodec: Avoid multiple consecutive av_log()
2022-01-10 10:47 [FFmpeg-devel] [PATCH] avcodec/mpegvideo, svq3: Remove unused next_p_frame_damaged Andreas Rheinhardt
` (5 preceding siblings ...)
2022-01-10 22:55 ` [FFmpeg-devel] [PATCH 7/9] avcodec/mpegvideo: Don't set unrestricted_mv for decoders Andreas Rheinhardt
@ 2022-01-10 22:55 ` Andreas Rheinhardt
2022-01-11 16:51 ` Michael Niedermayer
2022-01-10 22:55 ` [FFmpeg-devel] [PATCH 9/9] avcodec/mpegpicture: Decrease size of encoding_error array Andreas Rheinhardt
2022-01-12 9:48 ` [FFmpeg-devel] [PATCH] avcodec/mpegvideo, svq3: Remove unused next_p_frame_damaged Andreas Rheinhardt
8 siblings, 1 reply; 11+ messages in thread
From: Andreas Rheinhardt @ 2022-01-10 22:55 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
These messages belong together, yet they can be torn apart
if some other call to av_log() happens between them.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/mpeg4videodec.c | 59 +++++++++++++++++++-------------------
1 file changed, 30 insertions(+), 29 deletions(-)
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index 515a09d8a1..737689b35b 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -3276,62 +3276,63 @@ int ff_mpeg4_decode_picture_header(Mpeg4DecContext *ctx, GetBitContext *gb,
continue; // no startcode
if (s->avctx->debug & FF_DEBUG_STARTCODE) {
- av_log(s->avctx, AV_LOG_DEBUG, "startcode: %3X ", startcode);
+ const char *name;
if (startcode <= 0x11F)
- av_log(s->avctx, AV_LOG_DEBUG, "Video Object Start");
+ name = "Video Object Start";
else if (startcode <= 0x12F)
- av_log(s->avctx, AV_LOG_DEBUG, "Video Object Layer Start");
+ name = "Video Object Layer Start";
else if (startcode <= 0x13F)
- av_log(s->avctx, AV_LOG_DEBUG, "Reserved");
+ name = "Reserved";
else if (startcode <= 0x15F)
- av_log(s->avctx, AV_LOG_DEBUG, "FGS bp start");
+ name = "FGS bp start";
else if (startcode <= 0x1AF)
- av_log(s->avctx, AV_LOG_DEBUG, "Reserved");
+ name = "Reserved";
else if (startcode == 0x1B0)
- av_log(s->avctx, AV_LOG_DEBUG, "Visual Object Seq Start");
+ name = "Visual Object Seq Start";
else if (startcode == 0x1B1)
- av_log(s->avctx, AV_LOG_DEBUG, "Visual Object Seq End");
+ name = "Visual Object Seq End";
else if (startcode == 0x1B2)
- av_log(s->avctx, AV_LOG_DEBUG, "User Data");
+ name = "User Data";
else if (startcode == 0x1B3)
- av_log(s->avctx, AV_LOG_DEBUG, "Group of VOP start");
+ name = "Group of VOP start";
else if (startcode == 0x1B4)
- av_log(s->avctx, AV_LOG_DEBUG, "Video Session Error");
+ name = "Video Session Error";
else if (startcode == 0x1B5)
- av_log(s->avctx, AV_LOG_DEBUG, "Visual Object Start");
+ name = "Visual Object Start";
else if (startcode == 0x1B6)
- av_log(s->avctx, AV_LOG_DEBUG, "Video Object Plane start");
+ name = "Video Object Plane start";
else if (startcode == 0x1B7)
- av_log(s->avctx, AV_LOG_DEBUG, "slice start");
+ name = "slice start";
else if (startcode == 0x1B8)
- av_log(s->avctx, AV_LOG_DEBUG, "extension start");
+ name = "extension start";
else if (startcode == 0x1B9)
- av_log(s->avctx, AV_LOG_DEBUG, "fgs start");
+ name = "fgs start";
else if (startcode == 0x1BA)
- av_log(s->avctx, AV_LOG_DEBUG, "FBA Object start");
+ name = "FBA Object start";
else if (startcode == 0x1BB)
- av_log(s->avctx, AV_LOG_DEBUG, "FBA Object Plane start");
+ name = "FBA Object Plane start";
else if (startcode == 0x1BC)
- av_log(s->avctx, AV_LOG_DEBUG, "Mesh Object start");
+ name = "Mesh Object start";
else if (startcode == 0x1BD)
- av_log(s->avctx, AV_LOG_DEBUG, "Mesh Object Plane start");
+ name = "Mesh Object Plane start";
else if (startcode == 0x1BE)
- av_log(s->avctx, AV_LOG_DEBUG, "Still Texture Object start");
+ name = "Still Texture Object start";
else if (startcode == 0x1BF)
- av_log(s->avctx, AV_LOG_DEBUG, "Texture Spatial Layer start");
+ name = "Texture Spatial Layer start";
else if (startcode == 0x1C0)
- av_log(s->avctx, AV_LOG_DEBUG, "Texture SNR Layer start");
+ name = "Texture SNR Layer start";
else if (startcode == 0x1C1)
- av_log(s->avctx, AV_LOG_DEBUG, "Texture Tile start");
+ name = "Texture Tile start";
else if (startcode == 0x1C2)
- av_log(s->avctx, AV_LOG_DEBUG, "Texture Shape Layer start");
+ name = "Texture Shape Layer start";
else if (startcode == 0x1C3)
- av_log(s->avctx, AV_LOG_DEBUG, "stuffing start");
+ name = "stuffing start";
else if (startcode <= 0x1C5)
- av_log(s->avctx, AV_LOG_DEBUG, "reserved");
+ name = "Reserved";
else if (startcode <= 0x1FF)
- av_log(s->avctx, AV_LOG_DEBUG, "System start");
- av_log(s->avctx, AV_LOG_DEBUG, " at %d\n", get_bits_count(gb));
+ name = "System start";
+ av_log(s->avctx, AV_LOG_DEBUG, "startcode: %3X %s at %d\n",
+ startcode, name, get_bits_count(gb));
}
if (startcode >= 0x120 && startcode <= 0x12F) {
--
2.32.0
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 11+ messages in thread
* [FFmpeg-devel] [PATCH 9/9] avcodec/mpegpicture: Decrease size of encoding_error array
2022-01-10 10:47 [FFmpeg-devel] [PATCH] avcodec/mpegvideo, svq3: Remove unused next_p_frame_damaged Andreas Rheinhardt
` (6 preceding siblings ...)
2022-01-10 22:55 ` [FFmpeg-devel] [PATCH 8/9] avcodec/mpeg4videodec: Avoid multiple consecutive av_log() Andreas Rheinhardt
@ 2022-01-10 22:55 ` Andreas Rheinhardt
2022-01-12 9:48 ` [FFmpeg-devel] [PATCH] avcodec/mpegvideo, svq3: Remove unused next_p_frame_damaged Andreas Rheinhardt
8 siblings, 0 replies; 11+ messages in thread
From: Andreas Rheinhardt @ 2022-01-10 22:55 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
The current size is AV_NUM_DATA_POINTERS (i.e. eight).
This number is chosen in order to minimize the amount of allocations
for AVFrame.extended_(data|buf) for audio; it is meaningless
for video for which four is sufficient. So decrease this array
in order to minimize what is copied in ff_mpeg_ref_picture()
and at the places that copy a whole MpegEncContext.
Also do the same for snowenc.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/mpegpicture.h | 3 ++-
libavcodec/mpegvideo_enc.c | 2 +-
libavcodec/snow.h | 4 +++-
libavcodec/snowenc.c | 2 +-
4 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/libavcodec/mpegpicture.h b/libavcodec/mpegpicture.h
index 4bcd666797..a354c2a83c 100644
--- a/libavcodec/mpegpicture.h
+++ b/libavcodec/mpegpicture.h
@@ -29,6 +29,7 @@
#include "motion_est.h"
#include "thread.h"
+#define MPEGVIDEO_MAX_PLANES 4
#define MAX_PICTURE_COUNT 36
#define EDGE_WIDTH 16
@@ -88,7 +89,7 @@ typedef struct Picture {
int reference;
int shared;
- uint64_t encoding_error[AV_NUM_DATA_POINTERS];
+ uint64_t encoding_error[MPEGVIDEO_MAX_PLANES];
} Picture;
/**
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index afad9c8be1..35f0f79d4e 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1792,7 +1792,7 @@ vbv_retry:
}
ff_side_data_set_encoder_stats(pkt, s->current_picture.f->quality,
s->current_picture_ptr->encoding_error,
- (avctx->flags&AV_CODEC_FLAG_PSNR) ? 4 : 0,
+ (avctx->flags&AV_CODEC_FLAG_PSNR) ? MPEGVIDEO_MAX_PLANES : 0,
s->pict_type);
if (avctx->flags & AV_CODEC_FLAG_PASS1)
diff --git a/libavcodec/snow.h b/libavcodec/snow.h
index 8795491cf3..f5beca66e9 100644
--- a/libavcodec/snow.h
+++ b/libavcodec/snow.h
@@ -35,6 +35,8 @@
#include "mpegvideo.h"
#include "h264qpel.h"
+#define SNOW_MAX_PLANES 4
+
#define FF_ME_ITER 3
#define MID_STATE 128
@@ -188,7 +190,7 @@ typedef struct SnowContext{
AVMotionVector *avmv;
unsigned avmv_size;
int avmv_index;
- uint64_t encoding_error[AV_NUM_DATA_POINTERS];
+ uint64_t encoding_error[SNOW_MAX_PLANES];
int pred;
}SnowContext;
diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c
index 96b0d320bc..df31eb8132 100644
--- a/libavcodec/snowenc.c
+++ b/libavcodec/snowenc.c
@@ -1858,7 +1858,7 @@ redo_frame:
ff_side_data_set_encoder_stats(pkt, s->current_picture->quality,
s->encoding_error,
- (s->avctx->flags&AV_CODEC_FLAG_PSNR) ? 4 : 0,
+ (s->avctx->flags&AV_CODEC_FLAG_PSNR) ? SNOW_MAX_PLANES : 0,
s->current_picture->pict_type);
pkt->size = ff_rac_terminate(c, 0);
--
2.32.0
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [FFmpeg-devel] [PATCH 8/9] avcodec/mpeg4videodec: Avoid multiple consecutive av_log()
2022-01-10 22:55 ` [FFmpeg-devel] [PATCH 8/9] avcodec/mpeg4videodec: Avoid multiple consecutive av_log() Andreas Rheinhardt
@ 2022-01-11 16:51 ` Michael Niedermayer
0 siblings, 0 replies; 11+ messages in thread
From: Michael Niedermayer @ 2022-01-11 16:51 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 682 bytes --]
On Mon, Jan 10, 2022 at 11:55:35PM +0100, Andreas Rheinhardt wrote:
> These messages belong together, yet they can be torn apart
> if some other call to av_log() happens between them.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> libavcodec/mpeg4videodec.c | 59 +++++++++++++++++++-------------------
> 1 file changed, 30 insertions(+), 29 deletions(-)
LGTM
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avcodec/mpegvideo, svq3: Remove unused next_p_frame_damaged
2022-01-10 10:47 [FFmpeg-devel] [PATCH] avcodec/mpegvideo, svq3: Remove unused next_p_frame_damaged Andreas Rheinhardt
` (7 preceding siblings ...)
2022-01-10 22:55 ` [FFmpeg-devel] [PATCH 9/9] avcodec/mpegpicture: Decrease size of encoding_error array Andreas Rheinhardt
@ 2022-01-12 9:48 ` Andreas Rheinhardt
8 siblings, 0 replies; 11+ messages in thread
From: Andreas Rheinhardt @ 2022-01-12 9:48 UTC (permalink / raw)
To: ffmpeg-devel
Andreas Rheinhardt:
> Always zero since 4d2858deac5213eaddfdc06f98379b6325d7b953.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> libavcodec/h263dec.c | 7 -------
> libavcodec/mpegvideo.h | 1 -
> libavcodec/mpegvideo_dec.c | 1 -
> libavcodec/svq3.c | 8 --------
> libavcodec/vc1dec.c | 7 -------
> 5 files changed, 24 deletions(-)
>
> diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
> index 11e80cb9e9..9cc2665cac 100644
> --- a/libavcodec/h263dec.c
> +++ b/libavcodec/h263dec.c
> @@ -603,13 +603,6 @@ retry:
> avctx->skip_frame >= AVDISCARD_ALL)
> return get_consumed_bytes(s, buf_size);
>
> - if (s->next_p_frame_damaged) {
> - if (s->pict_type == AV_PICTURE_TYPE_B)
> - return get_consumed_bytes(s, buf_size);
> - else
> - s->next_p_frame_damaged = 0;
> - }
> -
> if ((!s->no_rounding) || s->pict_type == AV_PICTURE_TYPE_B) {
> s->me.qpel_put = s->qdsp.put_qpel_pixels_tab;
> s->me.qpel_avg = s->qdsp.avg_qpel_pixels_tab;
> diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
> index 1c14f5b0f0..448fe2cedc 100644
> --- a/libavcodec/mpegvideo.h
> +++ b/libavcodec/mpegvideo.h
> @@ -342,7 +342,6 @@ typedef struct MpegEncContext {
> int resync_mb_y; ///< y position of last resync marker
> GetBitContext last_resync_gb; ///< used to search for the next resync marker
> int mb_num_left; ///< number of MBs left in this video packet (for partitioned Slices only)
> - int next_p_frame_damaged; ///< set if the next p frame is damaged, to avoid showing trashed B-frames
>
> #if FF_API_FLAG_TRUNCATED
> ParseContext parse_context;
> diff --git a/libavcodec/mpegvideo_dec.c b/libavcodec/mpegvideo_dec.c
> index 8b625d2835..1e238bd1e1 100644
> --- a/libavcodec/mpegvideo_dec.c
> +++ b/libavcodec/mpegvideo_dec.c
> @@ -132,7 +132,6 @@ do {\
> s->next_picture_ptr = REBASE_PICTURE(s1->next_picture_ptr, s, s1);
>
> // Error/bug resilience
> - s->next_p_frame_damaged = s1->next_p_frame_damaged;
> s->workaround_bugs = s1->workaround_bugs;
> s->padding_bug_score = s1->padding_bug_score;
>
> diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
> index e329578af0..6f3ade8ace 100644
> --- a/libavcodec/svq3.c
> +++ b/libavcodec/svq3.c
> @@ -98,7 +98,6 @@ typedef struct SVQ3Context {
> int has_watermark;
> uint32_t watermark_key;
> int adaptive_quant;
> - int next_p_frame_damaged;
> int h_edge_pos;
> int v_edge_pos;
> int last_frame_output;
> @@ -1470,13 +1469,6 @@ static int svq3_decode_frame(AVCodecContext *avctx, void *data,
> avctx->skip_frame >= AVDISCARD_ALL)
> return 0;
>
> - if (s->next_p_frame_damaged) {
> - if (s->pict_type == AV_PICTURE_TYPE_B)
> - return 0;
> - else
> - s->next_p_frame_damaged = 0;
> - }
> -
> if (s->pict_type == AV_PICTURE_TYPE_B) {
> s->frame_num_offset = s->slice_num - s->prev_frame_num;
>
> diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
> index 267d72d15b..7ed5133cfa 100644
> --- a/libavcodec/vc1dec.c
> +++ b/libavcodec/vc1dec.c
> @@ -872,13 +872,6 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
> goto end;
> }
>
> - if (s->next_p_frame_damaged) {
> - if (s->pict_type == AV_PICTURE_TYPE_B)
> - goto end;
> - else
> - s->next_p_frame_damaged = 0;
> - }
> -
> if ((ret = ff_mpv_frame_start(s, avctx)) < 0) {
> goto err;
> }
>
Will apply this patchset tomorrow unless there are objections.
- Andreas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2022-01-12 9:49 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-10 10:47 [FFmpeg-devel] [PATCH] avcodec/mpegvideo, svq3: Remove unused next_p_frame_damaged Andreas Rheinhardt
2022-01-10 17:51 ` [FFmpeg-devel] [PATCH 2/6] avcodec/svq3: Remove dead topright_samples_available variable, code Andreas Rheinhardt
2022-01-10 17:51 ` [FFmpeg-devel] [PATCH 3/6] avcodec/h264_slice: Inline H264 codec id Andreas Rheinhardt
2022-01-10 17:51 ` [FFmpeg-devel] [PATCH 4/6] avcodec/h264pred: Don't compile > 8 bit versions of VP7/8 functions Andreas Rheinhardt
2022-01-10 17:51 ` [FFmpeg-devel] [PATCH 5/6] avcodec/h264pred: Remove dead > 8 pixels checks for 8bit codecs Andreas Rheinhardt
2022-01-10 17:51 ` [FFmpeg-devel] [PATCH 6/6] avcodec/h264pred: Reindentation Andreas Rheinhardt
2022-01-10 22:55 ` [FFmpeg-devel] [PATCH 7/9] avcodec/mpegvideo: Don't set unrestricted_mv for decoders Andreas Rheinhardt
2022-01-10 22:55 ` [FFmpeg-devel] [PATCH 8/9] avcodec/mpeg4videodec: Avoid multiple consecutive av_log() Andreas Rheinhardt
2022-01-11 16:51 ` Michael Niedermayer
2022-01-10 22:55 ` [FFmpeg-devel] [PATCH 9/9] avcodec/mpegpicture: Decrease size of encoding_error array Andreas Rheinhardt
2022-01-12 9:48 ` [FFmpeg-devel] [PATCH] avcodec/mpegvideo, svq3: Remove unused next_p_frame_damaged Andreas Rheinhardt
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git