Chen-tao / webm

Automatically exported from code.google.com/p/webm
0 stars 0 forks source link

Enabling PSNR when creating temporal layers break the bitstream #375

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What is the expected behavior? What do you see instead?
I set the following flag to the encoder 
   vpx_codec_flags_t flags = VPX_CODEC_USE_PSNR; 

Enabling the temporal layers this way
  _cfg->ts_number_layers     = 2;
  _cfg->ts_periodicity       = 2 ;
  // split stream 60% 40%
  _cfg->ts_target_bitrate[0] = bitrateKbit * 3 / 5;
  _cfg->ts_target_bitrate[1] = bitrateKbit;
  _cfg->ts_rate_decimator[0] = 2;
  _cfg->ts_rate_decimator[1] = 1;

I alternate setting the encode flags to
                flags |= VP8_EFLAG_NO_UPD_GF;
                flags |= VP8_EFLAG_NO_UPD_ARF;
                flags |= VP8_EFLAG_NO_REF_GF;
                flags |= VP8_EFLAG_NO_REF_ARF;

and 
                flags |= VP8_EFLAG_NO_UPD_GF;
                flags |= VP8_EFLAG_NO_UPD_ARF;
                flags |= VP8_EFLAG_NO_UPD_LAST;
                flags |= VP8_EFLAG_NO_UPD_ENTROPY;

When I don't set the VPX_CODEC_USE_PSNR the bitstream is good. When I enable it 
it shows artifacts in the decoded stream.

What version are you using? On what operating system?
Latest on Linux

Can you reproduce using the vpxdec or vpxenc tools? What command line are
you using?

Please provide any additional information below.

Original issue reported on code.google.com by pwes...@webrtc.org on 16 Nov 2011 at 12:02

GoogleCodeExporter commented 9 years ago

Original comment by iss...@webmproject.org on 16 Nov 2011 at 12:10

GoogleCodeExporter commented 9 years ago

Original comment by slavarn...@google.com on 16 Nov 2011 at 4:07

GoogleCodeExporter commented 9 years ago
This bug arises because both VPX_CODEC_USR_PSNR and
VP8_EFLAG_NO_REF_LAST are defined to be 1<<16. Thus
enabling output of PSNR data using the former flag
turns off use of the last frame as a reference frame.

The resulting conflict messes up the frame referencing
chain and results in errors.

Original comment by agra...@google.com on 16 Nov 2011 at 5:58

GoogleCodeExporter commented 9 years ago
VP8_EFLAG_* are flags to be passed to vpx_codec_encode(), and VPX_CODEC_USE_* 
are flags to be passed to vpx_codec_enc_init().

Original comment by jkoles...@google.com on 18 Nov 2011 at 11:30

GoogleCodeExporter commented 9 years ago
But that is exactly what I'm doing, I pass VP8_EFLAG_* to vpx_codec_encode(), 
and VPX_CODEC_USE_PSNR to vpx_codec_enc_init().

Original comment by patrik.w...@gmail.com on 22 Nov 2011 at 1:16