| 810 | } |
| 811 | |
| 812 | static void ssa_work_init(hb_filter_private_t *pv, const hb_data_t *sub_data) |
| 813 | { |
| 814 | // NOTE: The codec extradata is expected to be in MKV format |
| 815 | // I would like to initialize this in ssa_post_init, but when we are |
| 816 | // transcoding text subtitles to SSA, the extradata does not |
| 817 | // get initialized until the decoder is initialized. Since |
| 818 | // decoder initialization happens after filter initialization, |
| 819 | // we need to postpone this. |
| 820 | ass_process_codec_private(pv->ssa_track, (const char *)sub_data->bytes, sub_data->size); |
| 821 | |
| 822 | switch(pv->ssa_track->YCbCrMatrix) |
| 823 | { |
| 824 | case YCBCR_DEFAULT: //No YCbCrMatrix header: VSFilter default |
| 825 | case YCBCR_FCC_TV: //FCC is almost the same as 601 |
| 826 | case YCBCR_FCC_PC: |
| 827 | case YCBCR_BT601_TV: |
| 828 | case YCBCR_BT601_PC: |
| 829 | pv->rgb2yuv_fn = hb_rgb2yuv; |
| 830 | break; |
| 831 | case YCBCR_BT709_TV: |
| 832 | case YCBCR_BT709_PC: |
| 833 | case YCBCR_SMPTE240M_TV: |
| 834 | case YCBCR_SMPTE240M_PC: //240M is almost the same as 709 |
| 835 | pv->rgb2yuv_fn = hb_rgb2yuv_bt709; |
| 836 | break; |
| 837 | //use video csp |
| 838 | case YCBCR_UNKNOWN://cannot parse |
| 839 | case YCBCR_NONE: //explicitly requested no override |
| 840 | default: |
| 841 | pv->rgb2yuv_fn = hb_get_rgb2yuv_function(pv->input.color_matrix); |
| 842 | break; |
| 843 | } |
| 844 | } |
| 845 | |
| 846 | static int ssa_work(hb_filter_object_t *filter, |
| 847 | hb_buffer_t **buf_in, |
no test coverage detected