Bug 1305907 - Assume BT.709 as VP9 default color space r=jya
authorsotaro <sotaro.ikeda.g@gmail.com>
Fri, 02 Dec 2016 20:38:17 +0900
changeset 325133 1f73de3c604de4b6d087df99171cb0d3ef9ce498
parent 325132 81738db2f99b78838243c1345985094c5a0a4795
child 325134 e777cf9e040ff9694a8ba747a6aadf75b8e9fcf8
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersjya
bugs1305907
milestone53.0a1
Bug 1305907 - Assume BT.709 as VP9 default color space r=jya
dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
layout/reftests/webm-video/colors-16x8.webm
layout/reftests/webm-video/colors-8x16.webm
--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
@@ -305,16 +305,23 @@ FFmpegVideoDecoder<LIBAV_VER>::DoDecode(
     switch (mLib->av_frame_get_colorspace(mFrame)) {
       case AVCOL_SPC_BT709:
         b.mYUVColorSpace = YUVColorSpace::BT709;
         break;
       case AVCOL_SPC_SMPTE170M:
       case AVCOL_SPC_BT470BG:
         b.mYUVColorSpace = YUVColorSpace::BT601;
         break;
+      case AVCOL_SPC_UNSPECIFIED:
+#if LIBAVCODEC_VERSION_MAJOR >= 55
+        if (mCodecContext->codec_id == AV_CODEC_ID_VP9) {
+          b.mYUVColorSpace = YUVColorSpace::BT709;
+        }
+#endif
+        break;
       default:
         break;
     }
   }
   RefPtr<VideoData> v =
     VideoData::CreateAndCopyData(mInfo,
                                   mImageContainer,
                                   aSample->mOffset,
index 701341fc2a3a5def1749c3523daa566abc6aadf9..89cf30e15226e57c70685ac30b2ccb50f694ce39
GIT binary patch
literal 565
zc$|}Ry}y`|0Sx4w+8P<1z60^6Mi!^fjT}x*E#;|6xlZkkOirzhOcKEj=@6xi{{($!
zmpJJ7?(Pm=-6HC_GA(#b<5S<=JwTpV$hz#{HBF4l5Uxz{ZZP-Z8>lU-7={c0c?{}m
zBdzNjoB5p_d>eXw63fy|&Gk&p^b8FQ!W~ihE}b0?{SII)pn!ntc3KBzSYB^rEI!)E
zIH!?8Y3rQk(!7+m*0A`n0L$h^M&-xNE!MM6F+6~(<=xOIu&a?{RwGl$rbZTd=WV4>
ziInG!42$nKGB7kO@@#feV31?rJHXD;+zgarVPN17`2YW3&6?%^|9^YbRsa9v`L6nZ
zlYxx?|E`}?`2YX^-%WLn|NsBo-C_U#|J6v4$WuuW`REc*_}|Kf>_Admf&mn7Q2PXT
V_it`w*xm(986TS%3qLe60{|y@mOlUh
index 8b6b363138fecfdaf33959bd28e8b0966604fdc5..3f6105a02e35bc64ca5e230c51c0e32c7e07d4bf
GIT binary patch
literal 559
zc$|}Ry}y`|0Sx4w+8P<1z60^6Mi!^fjT}x*E#;|6xlZkkOirzhOcKEj=@6xiKLmYe
zmpJJ7?(Pm=-6HC_GA(#b<5S<=JwTpV$hz#{HBF4l5Uxz{ZZP-u8>lU-7={c0c?{}m
zBdzNjoB5p_d>eXw63fy|&Gk&p^b8FQ!W~ihE}b0?{SII)pn!ntc3KBzSYB^rEI!)E
zIH!?8Y3rQk(!7+m*0A`n0L$h^M&-xNE!MM6F+6~(<=xQ8v8z#FRwGl$rbZTd=WV4>
ziMZ#D42y3zGB7kO@@#feVBlkrJHXD;+zgarVPN3y`2YX^eC_)G|Lz3j0-1#l^8eo*
zk*@#$|L<0Yx-NU5(A}0`Ao(HYlKlVw|9HQ@SPbO-5z_>czj`tlKrsfjNpN@n=0=9?
PUBEQ)v5B$pLnAW)rtOeP