| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/filters/vpx_video_decoder.h" | 5 #include "media/filters/vpx_video_decoder.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 case VPX_IMG_FMT_I420: | 720 case VPX_IMG_FMT_I420: |
| 721 codec_format = vpx_image_alpha ? PIXEL_FORMAT_YV12A : PIXEL_FORMAT_YV12; | 721 codec_format = vpx_image_alpha ? PIXEL_FORMAT_YV12A : PIXEL_FORMAT_YV12; |
| 722 break; | 722 break; |
| 723 | 723 |
| 724 case VPX_IMG_FMT_I444: | 724 case VPX_IMG_FMT_I444: |
| 725 codec_format = PIXEL_FORMAT_YV24; | 725 codec_format = PIXEL_FORMAT_YV24; |
| 726 break; | 726 break; |
| 727 | 727 |
| 728 case VPX_IMG_FMT_I42016: | 728 case VPX_IMG_FMT_I42016: |
| 729 switch (vpx_image->bit_depth) { | 729 switch (vpx_image->bit_depth) { |
| 730 case 9: | |
| 731 codec_format = PIXEL_FORMAT_YUV420P9; | |
| 732 break; | |
| 733 case 10: | 730 case 10: |
| 734 codec_format = PIXEL_FORMAT_YUV420P10; | 731 codec_format = PIXEL_FORMAT_YUV420P10; |
| 735 break; | 732 break; |
| 733 case 12: |
| 734 codec_format = PIXEL_FORMAT_YUV420P12; |
| 735 break; |
| 736 default: | 736 default: |
| 737 DLOG(ERROR) << "Unsupported bit depth: " << vpx_image->bit_depth; | 737 DLOG(ERROR) << "Unsupported bit depth: " << vpx_image->bit_depth; |
| 738 return false; | 738 return false; |
| 739 } | 739 } |
| 740 break; | 740 break; |
| 741 | 741 |
| 742 case VPX_IMG_FMT_I42216: | 742 case VPX_IMG_FMT_I42216: |
| 743 switch (vpx_image->bit_depth) { | 743 switch (vpx_image->bit_depth) { |
| 744 case 9: | |
| 745 codec_format = PIXEL_FORMAT_YUV422P9; | |
| 746 break; | |
| 747 case 10: | 744 case 10: |
| 748 codec_format = PIXEL_FORMAT_YUV422P10; | 745 codec_format = PIXEL_FORMAT_YUV422P10; |
| 749 break; | 746 break; |
| 747 case 12: |
| 748 codec_format = PIXEL_FORMAT_YUV422P12; |
| 749 break; |
| 750 default: | 750 default: |
| 751 DLOG(ERROR) << "Unsupported bit depth: " << vpx_image->bit_depth; | 751 DLOG(ERROR) << "Unsupported bit depth: " << vpx_image->bit_depth; |
| 752 return false; | 752 return false; |
| 753 } | 753 } |
| 754 break; | 754 break; |
| 755 | 755 |
| 756 case VPX_IMG_FMT_I44416: | 756 case VPX_IMG_FMT_I44416: |
| 757 switch (vpx_image->bit_depth) { | 757 switch (vpx_image->bit_depth) { |
| 758 case 9: | |
| 759 codec_format = PIXEL_FORMAT_YUV444P9; | |
| 760 break; | |
| 761 case 10: | 758 case 10: |
| 762 codec_format = PIXEL_FORMAT_YUV444P10; | 759 codec_format = PIXEL_FORMAT_YUV444P10; |
| 763 break; | 760 break; |
| 761 case 12: |
| 762 codec_format = PIXEL_FORMAT_YUV444P12; |
| 763 break; |
| 764 default: | 764 default: |
| 765 DLOG(ERROR) << "Unsupported bit depth: " << vpx_image->bit_depth; | 765 DLOG(ERROR) << "Unsupported bit depth: " << vpx_image->bit_depth; |
| 766 return false; | 766 return false; |
| 767 } | 767 } |
| 768 break; | 768 break; |
| 769 | 769 |
| 770 default: | 770 default: |
| 771 DLOG(ERROR) << "Unsupported pixel format: " << vpx_image->fmt; | 771 DLOG(ERROR) << "Unsupported pixel format: " << vpx_image->fmt; |
| 772 return false; | 772 return false; |
| 773 } | 773 } |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 826 (*video_frame)->visible_data(VideoFrame::kUPlane), | 826 (*video_frame)->visible_data(VideoFrame::kUPlane), |
| 827 (*video_frame)->stride(VideoFrame::kUPlane), | 827 (*video_frame)->stride(VideoFrame::kUPlane), |
| 828 (*video_frame)->visible_data(VideoFrame::kVPlane), | 828 (*video_frame)->visible_data(VideoFrame::kVPlane), |
| 829 (*video_frame)->stride(VideoFrame::kVPlane), coded_size.width(), | 829 (*video_frame)->stride(VideoFrame::kVPlane), coded_size.width(), |
| 830 coded_size.height()); | 830 coded_size.height()); |
| 831 | 831 |
| 832 return true; | 832 return true; |
| 833 } | 833 } |
| 834 | 834 |
| 835 } // namespace media | 835 } // namespace media |
| OLD | NEW |