diff options
author | fbarchard@google.com <fbarchard@google.com@16f28f9a-4ce2-e073-06de-1de4eb20be90> | 2013-02-26 03:00:31 +0000 |
---|---|---|
committer | fbarchard@google.com <fbarchard@google.com@16f28f9a-4ce2-e073-06de-1de4eb20be90> | 2013-02-26 03:00:31 +0000 |
commit | 928483f397cc1bcbb1af48d6a6770a66d6e89995 (patch) | |
tree | 78e23ef32b5192dc4af19c176c989bb6af0a3cc4 /source/convert_from.cc | |
parent | c22cd5b209c9ab0897efbd1b7fbb7e3c8f5b8f29 (diff) | |
download | libyuv-928483f397cc1bcbb1af48d6a6770a66d6e89995.tar.gz |
Add I420ToNV12 and NV21 to convert from
BUG=178
TEST=none
Review URL: https://webrtc-codereview.appspot.com/1127007
git-svn-id: http://libyuv.googlecode.com/svn/trunk@581 16f28f9a-4ce2-e073-06de-1de4eb20be90
Diffstat (limited to 'source/convert_from.cc')
-rw-r--r-- | source/convert_from.cc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/source/convert_from.cc b/source/convert_from.cc index 5856459e..6949f593 100644 --- a/source/convert_from.cc +++ b/source/convert_from.cc @@ -1127,6 +1127,31 @@ int ConvertFromI420(const uint8* y, int y_stride, dst_sample_stride ? dst_sample_stride : width, width, height); break; + case FOURCC_NV12: { + uint8* dst_uv = dst_sample + width * height; + r = I420ToNV12(y, y_stride, + u, u_stride, + v, v_stride, + dst_sample, + dst_sample_stride ? dst_sample_stride : width, + dst_uv, + dst_sample_stride ? dst_sample_stride : width, + width, height); + break; + } + case FOURCC_NV21: { + uint8* dst_vu = dst_sample + width * height; + r = I420ToNV21(y, y_stride, + u, u_stride, + v, v_stride, + dst_sample, + dst_sample_stride ? dst_sample_stride : width, + dst_vu, + dst_sample_stride ? dst_sample_stride : width, + width, height); + break; + } + // TODO(fbarchard): Add M420 and Q420. // Triplanar formats // TODO(fbarchard): halfstride instead of halfwidth case FOURCC_I420: |