[FFmpeg-devel] [PATCH v2 2/3] avfilter/vsrc_mptestsrc: simplify the code and change the type of frame

Limin Wang lance.lmwang at gmail.com
Fri Aug 23 15:21:48 EEST 2019


On Thu, Aug 22, 2019 at 03:04:19PM +0200, Moritz Barsnick wrote:
> On Mon, Aug 12, 2019 at 23:39:52 +0800, lance.lmwang at gmail.com wrote:
> 
> This looks very wrong. Does it work?
> 
> > -    if (tt == TEST_ALL && frame%test->max_frames) /* draw a black frame at the beginning of each test */
> > -        tt = (frame/test->max_frames)%(TEST_NB-1);
> > +    frame = frame/test->max_frames;
> 
> Here, you reduce frame to frame/test->max_frames.

good catch, it's wrong, it's simple replacement, so haven't check it carefully.
Now I have fixed it and update the patch. Have checked with ffplay.

> 
> > +    if (tt == TEST_ALL && frame) /* draw a black frame at the beginning of each test */
> > +        tt = frame%(TEST_NB-1);
> 
> Which makes this replacement correct. But:
> 
> > -    case TEST_DC_LUMA:       dc_test(picref->data[0], picref->linesize[0], 256, 256, frame%test->max_frames); break;
> > -    case TEST_DC_CHROMA:     dc_test(picref->data[1], picref->linesize[1], 256, 256, frame%test->max_frames); break;
> > -    case TEST_FREQ_LUMA:   freq_test(picref->data[0], picref->linesize[0], frame%test->max_frames); break;
> > -    case TEST_FREQ_CHROMA: freq_test(picref->data[1], picref->linesize[1], frame%test->max_frames); break;
> > -    case TEST_AMP_LUMA:     amp_test(picref->data[0], picref->linesize[0], frame%test->max_frames); break;
> > -    case TEST_AMP_CHROMA:   amp_test(picref->data[1], picref->linesize[1], frame%test->max_frames); break;
> > -    case TEST_CBP:          cbp_test(picref->data   , picref->linesize   , frame%test->max_frames); break;
> > -    case TEST_MV:            mv_test(picref->data[0], picref->linesize[0], frame%test->max_frames); break;
> > -    case TEST_RING1:      ring1_test(picref->data[0], picref->linesize[0], frame%test->max_frames); break;
> > -    case TEST_RING2:      ring2_test(picref->data[0], picref->linesize[0], frame%test->max_frames); break;
> > +    case TEST_DC_LUMA:       dc_test(picref->data[0], picref->linesize[0], 256, 256, frame); break;
> > +    case TEST_DC_CHROMA:     dc_test(picref->data[1], picref->linesize[1], 256, 256, frame); break;
> > +    case TEST_FREQ_LUMA:   freq_test(picref->data[0], picref->linesize[0], frame); break;
> > +    case TEST_FREQ_CHROMA: freq_test(picref->data[1], picref->linesize[1], frame); break;
> > +    case TEST_AMP_LUMA:     amp_test(picref->data[0], picref->linesize[0], frame); break;
> > +    case TEST_AMP_CHROMA:   amp_test(picref->data[1], picref->linesize[1], frame); break;
> > +    case TEST_CBP:          cbp_test(picref->data   , picref->linesize   , frame); break;
> > +    case TEST_MV:            mv_test(picref->data[0], picref->linesize[0], frame); break;
> > +    case TEST_RING1:      ring1_test(picref->data[0], picref->linesize[0], frame); break;
> > +    case TEST_RING2:      ring2_test(picref->data[0], picref->linesize[0], frame); break;
> 
> Here, you have effectively replaced "frame%test->max_frames" with
> "frame/test->max_frames" (now "frame"). Are you sure?
> 
> Cheers,
> Moritz
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-devel mailing list