| 1831 | } |
| 1832 | |
| 1833 | static int vcr2_init_sequence(AVCodecContext *avctx) |
| 1834 | { |
| 1835 | Mpeg1Context *s1 = avctx->priv_data; |
| 1836 | MPVContext *const s = &s1->slice.c; |
| 1837 | int i, v, ret; |
| 1838 | |
| 1839 | /* start new MPEG-1 context decoding */ |
| 1840 | if (s->context_initialized) |
| 1841 | ff_mpv_common_end(s); |
| 1842 | |
| 1843 | s->width = avctx->coded_width; |
| 1844 | s->height = avctx->coded_height; |
| 1845 | avctx->has_b_frames = 0; // true? |
| 1846 | s->low_delay = 1; |
| 1847 | |
| 1848 | avctx->pix_fmt = mpeg_get_pixelformat(avctx); |
| 1849 | |
| 1850 | if ((ret = ff_mpv_common_init(s)) < 0) |
| 1851 | return ret; |
| 1852 | if (!s->avctx->lowres) |
| 1853 | for (int i = 0; i < s->slice_context_count; i++) |
| 1854 | ff_mpv_framesize_disable(&s->thread_context[i]->sc); |
| 1855 | |
| 1856 | for (i = 0; i < 64; i++) { |
| 1857 | int j = s->idsp.idct_permutation[i]; |
| 1858 | v = ff_mpeg1_default_intra_matrix[i]; |
| 1859 | s->intra_matrix[j] = v; |
| 1860 | s->chroma_intra_matrix[j] = v; |
| 1861 | |
| 1862 | v = ff_mpeg1_default_non_intra_matrix[i]; |
| 1863 | s->inter_matrix[j] = v; |
| 1864 | s->chroma_inter_matrix[j] = v; |
| 1865 | } |
| 1866 | |
| 1867 | s->progressive_sequence = 1; |
| 1868 | s->progressive_frame = 1; |
| 1869 | s->picture_structure = PICT_FRAME; |
| 1870 | s->first_field = 0; |
| 1871 | s->frame_pred_frame_dct = 1; |
| 1872 | s->chroma_format = CHROMA_420; |
| 1873 | if (s->codec_tag == AV_RL32("BW10")) { |
| 1874 | s->codec_id = s->avctx->codec_id = AV_CODEC_ID_MPEG1VIDEO; |
| 1875 | } else { |
| 1876 | s->codec_id = s->avctx->codec_id = AV_CODEC_ID_MPEG2VIDEO; |
| 1877 | } |
| 1878 | s1->save_progressive_seq = s->progressive_sequence; |
| 1879 | s1->save_chroma_format = s->chroma_format; |
| 1880 | return 0; |
| 1881 | } |
| 1882 | |
| 1883 | static void mpeg_set_cc_format(AVCodecContext *avctx, enum Mpeg2ClosedCaptionsFormat format, |
| 1884 | const char *label) |
no test coverage detected