* Format: 8-bit {0,Y,Cb,Cr} x 16 */
| 5731 | * Format: 8-bit {0,Y,Cb,Cr} x 16 |
| 5732 | */ |
| 5733 | static int ffmpeg_parse_vobsub_extradata_mp4( AVCodecParameters *codecpar, |
| 5734 | hb_subtitle_t *subtitle ) |
| 5735 | { |
| 5736 | if ( codecpar->extradata_size != 4*16 ) |
| 5737 | return 1; |
| 5738 | |
| 5739 | int i, j; |
| 5740 | for ( i=0, j=0; i<16; i++, j+=4 ) |
| 5741 | { |
| 5742 | subtitle->palette[i] = |
| 5743 | codecpar->extradata[j+1] << 16 | // Y |
| 5744 | codecpar->extradata[j+2] << 8 | // Cb |
| 5745 | codecpar->extradata[j+3] << 0; // Cr |
| 5746 | subtitle->palette_set = 1; |
| 5747 | } |
| 5748 | if (codecpar->width <= 0 || codecpar->height <= 0) |
| 5749 | { |
| 5750 | subtitle->width = 720; |
| 5751 | subtitle->height = 480; |
| 5752 | } |
| 5753 | else |
| 5754 | { |
| 5755 | subtitle->width = codecpar->width; |
| 5756 | subtitle->height = codecpar->height; |
| 5757 | } |
| 5758 | return 0; |
| 5759 | } |
| 5760 | |
| 5761 | /* |
| 5762 | * Parses the 'subtitle->palette' information from the specific VOB subtitle track's private data. |
no outgoing calls
no test coverage detected