Showing the changes to test/api/encode_decode_api_test.cpp (1 of 1 file). Show all
Unified · Split
| @@ -82,8 +82,9 @@ void EncodeDecodeTestAPIBase::prepareParamDefault (int iLayers, int iSlices, int · 81 unmodified lines | |||
| 82 | 82 | ||
| 83 | void EncodeDecodeTestAPIBase::EncodeOneFrame (int iCheckTypeIndex) { | 83 | void EncodeDecodeTestAPIBase::EncodeOneFrame (int iCheckTypeIndex) { |
| 84 | int frameSize = EncPic.iPicWidth * EncPic.iPicHeight * 3 / 2; | 84 | int frameSize = EncPic.iPicWidth * EncPic.iPicHeight * 3 / 2; |
| 85 | memset (buf_.data(), iRandValue, (frameSize >> 2)); | 85 | int lumaSize = EncPic.iPicWidth * EncPic.iPicHeight; |
| 86 | memset (buf_.data() + (frameSize >> 2), rand() % 256, (frameSize - (frameSize >> 2))); | 86 | memset (buf_.data(), iRandValue, lumaSize); |
| 87 | memset (buf_.data() + lumaSize, rand() % 256, (frameSize - lumaSize)); | ||
| 87 | int rv = encoder_->EncodeFrame (&EncPic, &info); | 88 | int rv = encoder_->EncodeFrame (&EncPic, &info); |
| 88 | if (0 == iCheckTypeIndex) | 89 | if (0 == iCheckTypeIndex) |
| 89 | ASSERT_TRUE (rv == cmResultSuccess); | 90 | ASSERT_TRUE (rv == cmResultSuccess); |