|
|
@@ -24,7 +24,7 @@ |
|
|
* @file |
|
|
* @file |
|
|
* Hap decoder |
|
|
* Hap decoder |
|
|
* |
|
|
* |
|
|
* Fourcc: Hap1, Hap5, HapY |
|
|
|
|
|
|
|
|
* Fourcc: Hap1, Hap5, HapY, HapA, HapM |
|
|
* |
|
|
* |
|
|
* https://github.com/Vidvox/hap/blob/master/documentation/HapVideoDRAFT.md |
|
|
* https://github.com/Vidvox/hap/blob/master/documentation/HapVideoDRAFT.md |
|
|
*/ |
|
|
*/ |
|
|
@@ -163,7 +163,8 @@ static int hap_parse_frame_header(AVCodecContext *avctx) |
|
|
|
|
|
|
|
|
if ((avctx->codec_tag == MKTAG('H','a','p','1') && (section_type & 0x0F) != HAP_FMT_RGBDXT1) || |
|
|
if ((avctx->codec_tag == MKTAG('H','a','p','1') && (section_type & 0x0F) != HAP_FMT_RGBDXT1) || |
|
|
(avctx->codec_tag == MKTAG('H','a','p','5') && (section_type & 0x0F) != HAP_FMT_RGBADXT5) || |
|
|
(avctx->codec_tag == MKTAG('H','a','p','5') && (section_type & 0x0F) != HAP_FMT_RGBADXT5) || |
|
|
(avctx->codec_tag == MKTAG('H','a','p','Y') && (section_type & 0x0F) != HAP_FMT_YCOCGDXT5)) { |
|
|
|
|
|
|
|
|
(avctx->codec_tag == MKTAG('H','a','p','Y') && (section_type & 0x0F) != HAP_FMT_YCOCGDXT5) || |
|
|
|
|
|
(avctx->codec_tag == MKTAG('H','a','p','A') && (section_type & 0x0F) != HAP_FMT_RGTC1)) { |
|
|
av_log(avctx, AV_LOG_ERROR, |
|
|
av_log(avctx, AV_LOG_ERROR, |
|
|
"Invalid texture format %#04x.\n", section_type & 0x0F); |
|
|
"Invalid texture format %#04x.\n", section_type & 0x0F); |
|
|
return AVERROR_INVALIDDATA; |
|
|
return AVERROR_INVALIDDATA; |
|
|
@@ -403,6 +404,15 @@ static av_cold int hap_init(AVCodecContext *avctx) |
|
|
ctx->tex_fun = ctx->dxtc.dxt5ys_block; |
|
|
ctx->tex_fun = ctx->dxtc.dxt5ys_block; |
|
|
avctx->pix_fmt = AV_PIX_FMT_RGB0; |
|
|
avctx->pix_fmt = AV_PIX_FMT_RGB0; |
|
|
break; |
|
|
break; |
|
|
|
|
|
case MKTAG('H','a','p','A'): |
|
|
|
|
|
texture_name = "RGTC1"; |
|
|
|
|
|
ctx->tex_rat = 8; |
|
|
|
|
|
ctx->tex_fun = ctx->dxtc.rgtc1u_block; |
|
|
|
|
|
avctx->pix_fmt = AV_PIX_FMT_RGB0; |
|
|
|
|
|
break; |
|
|
|
|
|
case MKTAG('H','a','p','M'): |
|
|
|
|
|
avpriv_report_missing_feature(avctx, "HapQAlpha"); |
|
|
|
|
|
return AVERROR_PATCHWELCOME; |
|
|
default: |
|
|
default: |
|
|
return AVERROR_DECODER_NOT_FOUND; |
|
|
return AVERROR_DECODER_NOT_FOUND; |
|
|
} |
|
|
} |
|
|
|