| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 #include "test/codec_factory.h" | 10 #include "test/codec_factory.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 return res_dec; | 23 return res_dec; |
| 24 } | 24 } |
| 25 | 25 |
| 26 void DecoderTest::RunLoop(CompressedVideoSource *video) { | 26 void DecoderTest::RunLoop(CompressedVideoSource *video) { |
| 27 vpx_codec_dec_cfg_t dec_cfg = {0}; | 27 vpx_codec_dec_cfg_t dec_cfg = {0}; |
| 28 Decoder* const decoder = codec_->CreateDecoder(dec_cfg, 0); | 28 Decoder* const decoder = codec_->CreateDecoder(dec_cfg, 0); |
| 29 ASSERT_TRUE(decoder != NULL); | 29 ASSERT_TRUE(decoder != NULL); |
| 30 | 30 |
| 31 // Decode frames. | 31 // Decode frames. |
| 32 for (video->Begin(); video->cxdata(); video->Next()) { | 32 for (video->Begin(); video->cxdata(); video->Next()) { |
| 33 PreDecodeFrameHook(*video, decoder); |
| 33 vpx_codec_err_t res_dec = decoder->DecodeFrame(video->cxdata(), | 34 vpx_codec_err_t res_dec = decoder->DecodeFrame(video->cxdata(), |
| 34 video->frame_size()); | 35 video->frame_size()); |
| 35 ASSERT_EQ(VPX_CODEC_OK, res_dec) << decoder->DecodeError(); | 36 ASSERT_EQ(VPX_CODEC_OK, res_dec) << decoder->DecodeError(); |
| 36 | 37 |
| 37 DxDataIterator dec_iter = decoder->GetDxData(); | 38 DxDataIterator dec_iter = decoder->GetDxData(); |
| 38 const vpx_image_t *img = NULL; | 39 const vpx_image_t *img = NULL; |
| 39 | 40 |
| 40 // Get decompressed data | 41 // Get decompressed data |
| 41 while ((img = dec_iter.Next())) | 42 while ((img = dec_iter.Next())) |
| 42 DecompressedFrameHook(*img, video->frame_number()); | 43 DecompressedFrameHook(*img, video->frame_number()); |
| 43 } | 44 } |
| 44 | 45 |
| 45 delete decoder; | 46 delete decoder; |
| 46 } | 47 } |
| 47 } // namespace libvpx_test | 48 } // namespace libvpx_test |
| OLD | NEW |