mirror of https://git.ffmpeg.org/ffmpeg.git
svq1enc: use hpeldsp instead of dsputil for half-pel functions.
This commit is contained in:
parent
771ba8f206
commit
b42d594c85
|
@ -1805,7 +1805,7 @@ sonic_decoder_select="golomb"
|
||||||
sonic_encoder_select="golomb"
|
sonic_encoder_select="golomb"
|
||||||
sonic_ls_encoder_select="golomb"
|
sonic_ls_encoder_select="golomb"
|
||||||
svq1_decoder_select="hpeldsp"
|
svq1_decoder_select="hpeldsp"
|
||||||
svq1_encoder_select="aandcttables dsputil mpegvideoenc"
|
svq1_encoder_select="aandcttables dsputil hpeldsp mpegvideoenc"
|
||||||
svq3_decoder_select="dsputil error_resilience golomb h264chroma h264dsp h264pred h264qpel mpegvideo videodsp"
|
svq3_decoder_select="dsputil error_resilience golomb h264chroma h264dsp h264pred h264qpel mpegvideo videodsp"
|
||||||
svq3_decoder_suggest="zlib"
|
svq3_decoder_suggest="zlib"
|
||||||
tak_decoder_select="dsputil"
|
tak_decoder_select="dsputil"
|
||||||
|
|
|
@ -27,6 +27,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "avcodec.h"
|
#include "avcodec.h"
|
||||||
|
#include "dsputil.h"
|
||||||
|
#include "hpeldsp.h"
|
||||||
#include "mpegvideo.h"
|
#include "mpegvideo.h"
|
||||||
#include "h263.h"
|
#include "h263.h"
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
|
@ -42,6 +44,7 @@ typedef struct SVQ1Context {
|
||||||
MpegEncContext m;
|
MpegEncContext m;
|
||||||
AVCodecContext *avctx;
|
AVCodecContext *avctx;
|
||||||
DSPContext dsp;
|
DSPContext dsp;
|
||||||
|
HpelDSPContext hdsp;
|
||||||
AVFrame picture;
|
AVFrame picture;
|
||||||
AVFrame current_picture;
|
AVFrame current_picture;
|
||||||
AVFrame last_picture;
|
AVFrame last_picture;
|
||||||
|
@ -443,7 +446,7 @@ static int svq1_encode_plane(SVQ1Context *s, int plane,
|
||||||
|
|
||||||
dxy = (mx & 1) + 2 * (my & 1);
|
dxy = (mx & 1) + 2 * (my & 1);
|
||||||
|
|
||||||
s->dsp.put_pixels_tab[0][dxy](temp + 16,
|
s->hdsp.put_pixels_tab[0][dxy](temp + 16,
|
||||||
ref + (mx >> 1) +
|
ref + (mx >> 1) +
|
||||||
stride * (my >> 1),
|
stride * (my >> 1),
|
||||||
stride, 16);
|
stride, 16);
|
||||||
|
@ -458,7 +461,7 @@ static int svq1_encode_plane(SVQ1Context *s, int plane,
|
||||||
score[2] += vlc[1] * lambda;
|
score[2] += vlc[1] * lambda;
|
||||||
if (score[2] < score[best] && mx == 0 && my == 0) {
|
if (score[2] < score[best] && mx == 0 && my == 0) {
|
||||||
best = 2;
|
best = 2;
|
||||||
s->dsp.put_pixels_tab[0][0](decoded, ref, stride, 16);
|
s->hdsp.put_pixels_tab[0][0](decoded, ref, stride, 16);
|
||||||
for (i = 0; i < 6; i++)
|
for (i = 0; i < 6; i++)
|
||||||
count[2][i] = 0;
|
count[2][i] = 0;
|
||||||
put_bits(&s->pb, vlc[1], vlc[0]);
|
put_bits(&s->pb, vlc[1], vlc[0]);
|
||||||
|
@ -488,7 +491,7 @@ static int svq1_encode_plane(SVQ1Context *s, int plane,
|
||||||
avpriv_copy_bits(&s->pb, reorder_buffer[best][i],
|
avpriv_copy_bits(&s->pb, reorder_buffer[best][i],
|
||||||
count[best][i]);
|
count[best][i]);
|
||||||
if (best == 0)
|
if (best == 0)
|
||||||
s->dsp.put_pixels_tab[0][0](decoded, temp, stride, 16);
|
s->hdsp.put_pixels_tab[0][0](decoded, temp, stride, 16);
|
||||||
}
|
}
|
||||||
s->m.first_slice_line = 0;
|
s->m.first_slice_line = 0;
|
||||||
}
|
}
|
||||||
|
@ -500,6 +503,7 @@ static av_cold int svq1_encode_init(AVCodecContext *avctx)
|
||||||
SVQ1Context *const s = avctx->priv_data;
|
SVQ1Context *const s = avctx->priv_data;
|
||||||
|
|
||||||
ff_dsputil_init(&s->dsp, avctx);
|
ff_dsputil_init(&s->dsp, avctx);
|
||||||
|
ff_hpeldsp_init(&s->hdsp, avctx->flags);
|
||||||
avctx->coded_frame = &s->picture;
|
avctx->coded_frame = &s->picture;
|
||||||
|
|
||||||
s->frame_width = avctx->width;
|
s->frame_width = avctx->width;
|
||||||
|
|
Loading…
Reference in New Issue