Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] avcodec/me_cmp: Remove now incorrect av_assert2()
@ 2022-08-17  8:53 Andreas Rheinhardt
  2022-08-17  8:58 ` Martin Storsjö
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Rheinhardt @ 2022-08-17  8:53 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

Since d69d12a5b9236b9d2f1fd247ea452f84cdd1aaf9 these av_assert2()
(or more exactly, the ones in hadamard8_diff8x8_c() and
hadamard8_intra8x8_c()) are hit. So just remove all of these asserts.
(If the test were improved to know which functions expect h == 8
and which support any value, the asserts could be readded
at the appropriate places.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/me_cmp.c | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/libavcodec/me_cmp.c b/libavcodec/me_cmp.c
index fa82ae54ae..4242fbc6e4 100644
--- a/libavcodec/me_cmp.c
+++ b/libavcodec/me_cmp.c
@@ -558,8 +558,6 @@ static int hadamard8_diff8x8_c(MpegEncContext *s, const uint8_t *dst,
 {
     int i, temp[64], sum = 0;
 
-    av_assert2(h == 8);
-
     for (i = 0; i < 8; i++) {
         // FIXME: try pointer walks
         BUTTERFLY2(temp[8 * i + 0], temp[8 * i + 1],
@@ -610,8 +608,6 @@ static int hadamard8_intra8x8_c(MpegEncContext *s, const uint8_t *src,
 {
     int i, temp[64], sum = 0;
 
-    av_assert2(h == 8);
-
     for (i = 0; i < 8; i++) {
         // FIXME: try pointer walks
         BUTTERFLY2(temp[8 * i + 0], temp[8 * i + 1],
@@ -662,8 +658,6 @@ static int dct_sad8x8_c(MpegEncContext *s, const uint8_t *src1,
 {
     LOCAL_ALIGNED_16(int16_t, temp, [64]);
 
-    av_assert2(h == 8);
-
     s->pdsp.diff_pixels_unaligned(temp, src1, src2, stride);
     s->fdsp.fdct(temp);
     return s->mecc.sum_abs_dctelem(temp);
@@ -729,8 +723,6 @@ static int dct_max8x8_c(MpegEncContext *s, const uint8_t *src1,
     LOCAL_ALIGNED_16(int16_t, temp, [64]);
     int sum = 0, i;
 
-    av_assert2(h == 8);
-
     s->pdsp.diff_pixels_unaligned(temp, src1, src2, stride);
     s->fdsp.fdct(temp);
 
@@ -747,7 +739,6 @@ static int quant_psnr8x8_c(MpegEncContext *s, const uint8_t *src1,
     int16_t *const bak = temp + 64;
     int sum = 0, i;
 
-    av_assert2(h == 8);
     s->mb_intra = 0;
 
     s->pdsp.diff_pixels_unaligned(temp, src1, src2, stride);
@@ -776,8 +767,6 @@ static int rd8x8_c(MpegEncContext *s, const uint8_t *src1, const uint8_t *src2,
     const int esc_length = s->ac_esc_length;
     uint8_t *length, *last_length;
 
-    av_assert2(h == 8);
-
     copy_block8(lsrc1, src1, 8, stride, 8);
     copy_block8(lsrc2, src2, 8, stride, 8);
 
@@ -851,8 +840,6 @@ static int bit8x8_c(MpegEncContext *s, const uint8_t *src1, const uint8_t *src2,
     const int esc_length = s->ac_esc_length;
     uint8_t *length, *last_length;
 
-    av_assert2(h == 8);
-
     s->pdsp.diff_pixels_unaligned(temp, src1, src2, stride);
 
     s->block_last_index[0 /* FIXME */] =
-- 
2.34.1

_______________________________________________
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] 2+ messages in thread

* Re: [FFmpeg-devel] [PATCH] avcodec/me_cmp: Remove now incorrect av_assert2()
  2022-08-17  8:53 [FFmpeg-devel] [PATCH] avcodec/me_cmp: Remove now incorrect av_assert2() Andreas Rheinhardt
@ 2022-08-17  8:58 ` Martin Storsjö
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Storsjö @ 2022-08-17  8:58 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Andreas Rheinhardt

On Wed, 17 Aug 2022, Andreas Rheinhardt wrote:

> Since d69d12a5b9236b9d2f1fd247ea452f84cdd1aaf9 these av_assert2()
> (or more exactly, the ones in hadamard8_diff8x8_c() and
> hadamard8_intra8x8_c()) are hit. So just remove all of these asserts.
> (If the test were improved to know which functions expect h == 8
> and which support any value, the asserts could be readded
> at the appropriate places.)
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> libavcodec/me_cmp.c | 13 -------------
> 1 file changed, 13 deletions(-)

LGTM, thanks!

// Martin

_______________________________________________
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] 2+ messages in thread

end of thread, other threads:[~2022-08-17  8:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-17  8:53 [FFmpeg-devel] [PATCH] avcodec/me_cmp: Remove now incorrect av_assert2() Andreas Rheinhardt
2022-08-17  8:58 ` Martin Storsjö

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