/* * H.265 video codec. * Copyright (c) 2015 struktur AG, Dirk Farin * * This file is part of libde265. * * libde265 is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * libde265 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with libde265. If not, see . */ #include "dct.h" // --- FDCT --- void DSPFunc_FDCT_Base::dump(int x,int y) { printf("-> "); for (int yy=0;yy(referenceImplementation()); for (int i=0;icoeffs[i]) return false; return true; } bool DSPFunc_FDCT_Base::prepareNextImage(std::shared_ptr img) { if (!curr_image) { curr_image = img; return false; } prev_image = curr_image; curr_image = img; int w = curr_image->get_width(0); int h = curr_image->get_height(0); if (residuals==NULL) { int align=16; stride = (w+align-1)/align*align; residuals = new int16_t[stride*h]; } int cstride = curr_image->get_luma_stride(); int pstride = prev_image->get_luma_stride(); const uint8_t* curr = curr_image->get_image_plane_at_pos(0,0,0); const uint8_t* prev = prev_image->get_image_plane_at_pos(0,0,0); for (int y=0;y(referenceImplementation()); for (int i=0;iout[i]) return false; return true; } bool DSPFunc_IDCT_Base::prepareNextImage(std::shared_ptr img) { // --- generate fake coefficients --- // difference between two frames if (!curr_image) { curr_image = img; return false; } prev_image = curr_image; curr_image = img; int w = curr_image->get_width(0); int h = curr_image->get_height(0); int align = blkSize; width = (w+align-1) / align * align; blksPerRow = w/blkSize; if (coeffs==NULL) { coeffs = new int16_t[width*h]; } int cstride = curr_image->get_luma_stride(); int pstride = prev_image->get_luma_stride(); const uint8_t* curr = curr_image->get_image_plane_at_pos(0,0,0); const uint8_t* prev = prev_image->get_image_plane_at_pos(0,0,0); for (int y=0;y