Unified · Split
| @@ -1805,6 +1805,37 @@ static int inter_data(VVCLocalContext *lc) · 1804 unmodified lines | ||
| 1805 | 1805 | return ret; |
| 1806 | 1806 | } |
| 1807 | 1807 | |
| 1808 | +static int intra_data(VVCLocalContext *lc) | |
| 1809 | +{ | |
| 1810 | + const VVCFrameContext *fc = lc->fc; | |
| 1811 | + const VVCSPS *sps = lc->fc->ps.sps; | |
| 1812 | + const CodingUnit *cu = lc->cu; | |
| 1813 | + const VVCTreeType tree_type = cu->tree_type; | |
| 1814 | + const bool pred_mode_plt_flag = cu->pred_mode == MODE_PLT; | |
| 1815 | + int ret = 0; | |
| 1816 | + | |
| 1817 | + if (tree_type == SINGLE_TREE || tree_type == DUAL_TREE_LUMA) { | |
| 1818 | + if (pred_mode_plt_flag) { | |
| 1819 | + avpriv_report_missing_feature(fc->log_ctx, "Palette"); | |
| 1820 | + return AVERROR_PATCHWELCOME; | |
| 1821 | + } else { | |
| 1822 | + intra_luma_pred_modes(lc); | |
| 1823 | + ff_vvc_set_intra_mvf(lc, false, PF_INTRA, cu->ciip_flag); | |
| 1824 | + } | |
| 1825 | + } | |
| 1826 | + if ((tree_type == SINGLE_TREE || tree_type == DUAL_TREE_CHROMA) && sps->r->sps_chroma_format_idc) { | |
| 1827 | + if (pred_mode_plt_flag && tree_type == DUAL_TREE_CHROMA) { | |
| 1828 | + avpriv_report_missing_feature(fc->log_ctx, "Palette"); | |
| 1829 | + return AVERROR_PATCHWELCOME; | |
| 1830 | + } else if (!pred_mode_plt_flag) { | |
| 1831 | + if (!cu->act_enabled_flag) | |
| 1832 | + intra_chroma_pred_modes(lc); | |
| 1833 | + } | |
| 1834 | + } | |
| 1835 | + | |
| 1836 | + return ret; | |
| 1837 | +} | |
| 1838 | + | |
| 1808 | 1839 | static int hls_coding_unit(VVCLocalContext *lc, int x0, int y0, int cb_width, int cb_height, |
| 1809 | 1840 | int cqt_depth, const VVCTreeType tree_type, VVCModeType mode_type) |
| 1810 | 1841 | { |
| @@ -1815,7 +1846,7 @@ static int hls_coding_unit(VVCLocalContext *lc, int x0, int y0, int cb_width, in · 4 unmodified lines | ||
| 1815 | 1846 | const int vs = sps->vshift[CHROMA]; |
| 1816 | 1847 | const int is_128 = cb_width > 64 || cb_height > 64; |
| 1817 | 1848 | int pred_mode_plt_flag = 0; |
| 1818 | − int ret; | |
| 1849 | + int ret = 0; | |
| 1819 | 1850 | |
| 1820 | 1851 | CodingUnit *cu = add_cu(lc, x0, y0, cb_width, cb_height, cqt_depth, tree_type); |
| 1821 | 1852 | |
| @@ -1842,29 +1873,14 @@ static int hls_coding_unit(VVCLocalContext *lc, int x0, int y0, int cb_width, in · 20 unmodified lines | ||
| 1842 | 1873 | avpriv_report_missing_feature(fc->log_ctx, "Adaptive Color Transform"); |
| 1843 | 1874 | return AVERROR_PATCHWELCOME; |
| 1844 | 1875 | } |
| 1845 | − if (cu->pred_mode == MODE_INTRA || cu->pred_mode == MODE_PLT) { | |
| 1846 | − if (tree_type == SINGLE_TREE || tree_type == DUAL_TREE_LUMA) { | |
| 1847 | − if (pred_mode_plt_flag) { | |
| 1848 | − avpriv_report_missing_feature(fc->log_ctx, "Palette"); | |
| 1849 | − return AVERROR_PATCHWELCOME; | |
| 1850 | − } else { | |
| 1851 | − intra_luma_pred_modes(lc); | |
| 1852 | − ff_vvc_set_intra_mvf(lc, false, PF_INTRA, cu->ciip_flag); | |
| 1853 | − } | |
| 1854 | − } | |
| 1855 | − if ((tree_type == SINGLE_TREE || tree_type == DUAL_TREE_CHROMA) && sps->r->sps_chroma_format_idc) { | |
| 1856 | − if (pred_mode_plt_flag && tree_type == DUAL_TREE_CHROMA) { | |
| 1857 | − avpriv_report_missing_feature(fc->log_ctx, "Palette"); | |
| 1858 | − return AVERROR_PATCHWELCOME; | |
| 1859 | − } else if (!pred_mode_plt_flag) { | |
| 1860 | − if (!cu->act_enabled_flag) | |
| 1861 | − intra_chroma_pred_modes(lc); | |
| 1862 | − } | |
| 1863 | − } | |
| 1864 | − } else if (tree_type != DUAL_TREE_CHROMA) { /* MODE_INTER or MODE_IBC */ | |
| 1865 | − if ((ret = inter_data(lc)) < 0) | |
| 1866 | − return ret; | |
| 1867 | − } | |
| 1876 | + if (cu->pred_mode == MODE_INTRA || cu->pred_mode == MODE_PLT) | |
| 1877 | + ret = intra_data(lc); | |
| 1878 | + else if (tree_type != DUAL_TREE_CHROMA) /* MODE_INTER or MODE_IBC */ | |
| 1879 | + ret = inter_data(lc); | |
| 1880 | + | |
| 1881 | + if (ret < 0) | |
| 1882 | + return ret; | |
| 1883 | + | |
| 1868 | 1884 | if (cu->pred_mode != MODE_INTRA && !pred_mode_plt_flag && !lc->cu->pu.general_merge_flag) |
| 1869 | 1885 | cu->coded_flag = ff_vvc_cu_coded_flag(lc); |
| 1870 | 1886 | else |