Commit d552f616 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge remote-tracking branch 'qatar/master'

* qatar/master: (28 commits)
  Remove some non-compiling debug messages.
  ffplay: Fix non-compiling debug printf and replace it by av_dlog.
  H264: x86 predict init cosmetics.
  ac3enc: Fix linking of AC-3 encoder without the E-AC-3 encoder.
  Move E-AC-3 encoder functions to a separate eac3enc.c file.
  ac3enc: remove convenience macro, #define DEBUG
  ac3enc: remove unused #define
  vc1: re-initialize tables after width/height change.
  APIchanges: fill-in git commit hash for av_get_bytes_per_sample() addition
  samplefmt: add av_get_bytes_per_sample()
  iirfilter: fix biquad filter coefficients.
  swscale: remove duplicate conversion routine in swScale().
  swscale: add yuv2planar/packed function typedefs.
  swscale: integrate yuv2nv12X_C into yuv2yuvX() function pointers.
  swscale: reindent x86 init code.
  swscale: extract SWS_FULL_CHR_H_INT conditional into init code.
  swscale: cosmetics.
  swscale: remove alp/chr/lumSrcOffset.
  swscale: un-special-case yuv2yuvX16_c().
  shorten: Remove stray DEBUG #define and corresponding av_dlog statement.
  ...

Conflicts:
	doc/APIchanges
	libavcodec/ac3enc.c
	libavutil/avutil.h
	libavutil/samplefmt.c
	libswscale/swscale.c
	libswscale/swscale_internal.h
	libswscale/x86/swscale_template.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 7d89f7cb ac4a8548
......@@ -107,7 +107,7 @@ Configuration options:
--disable-mdct disable MDCT code
--disable-rdft disable RDFT code
--enable-vaapi enable VAAPI code
--disable-vdpau disable VDPAU code
--enable-vdpau enable VDPAU code
--disable-dxva2 disable DXVA2 code
--enable-runtime-cpudetect detect cpu capabilities at runtime (bigger binary)
--enable-hardcoded-tables use hardcoded tables instead of runtime generation
......
......@@ -50,6 +50,10 @@ API changes, most recent first:
2011-05-XX - XXXXXX - lavfi 2.6.0 - avcodec.h
Add avfilter_get_video_buffer_ref_from_frame() to libavfilter/avcodec.h.
2011-06-07 - a6703fa - lavu 51.4.0 - av_get_bytes_per_sample()
Add av_get_bytes_per_sample() in libavutil/samplefmt.h.
Deprecate av_get_bits_per_sample_fmt().
2011-06-xx - xxxxxxx - lavu 51.3.0 - opt.h
Add av_opt_free convenience function.
......
......@@ -54,9 +54,6 @@
const char program_name[] = "ffplay";
const int program_birth_year = 2003;
//#define DEBUG
//#define DEBUG_SYNC
#define MAX_QUEUE_SIZE (15 * 1024 * 1024)
#define MIN_AUDIOQ_SIZE (20 * 16 * 1024)
#define MIN_FRAMES 5
......@@ -1052,10 +1049,9 @@ static double compute_target_time(double frame_current_pts, VideoState *is)
}
}
is->frame_timer += delay;
#if defined(DEBUG_SYNC)
printf("video: delay=%0.3f actual_delay=%0.3f pts=%0.3f A-V=%f\n",
delay, actual_delay, frame_current_pts, -diff);
#endif
av_dlog(NULL, "video: delay=%0.3f pts=%0.3f A-V=%f\n",
delay, frame_current_pts, -diff);
return is->frame_timer;
}
......@@ -2033,7 +2029,7 @@ static int audio_decode_frame(VideoState *is, double *pts_ptr)
n = 2 * dec->channels;
is->audio_clock += (double)data_size /
(double)(n * dec->sample_rate);
#if defined(DEBUG_SYNC)
#ifdef DEBUG
{
static double last_clock;
printf("audio: delay=%0.3f clock=%0.3f pts=%0.3f\n",
......
......@@ -127,7 +127,8 @@ OBJS-$(CONFIG_DVVIDEO_DECODER) += dv.o dvdata.o
OBJS-$(CONFIG_DVVIDEO_ENCODER) += dv.o dvdata.o
OBJS-$(CONFIG_DXA_DECODER) += dxa.o
OBJS-$(CONFIG_EAC3_DECODER) += eac3dec.o eac3dec_data.o
OBJS-$(CONFIG_EAC3_ENCODER) += ac3enc_float.o ac3tab.o ac3.o kbdwin.o
OBJS-$(CONFIG_EAC3_ENCODER) += eac3enc.o ac3enc_float.o ac3tab.o \
ac3.o kbdwin.o
OBJS-$(CONFIG_EACMV_DECODER) += eacmv.o
OBJS-$(CONFIG_EAMAD_DECODER) += eamad.o eaidct.o mpeg12.o \
mpeg12data.o mpegvideo.o \
......
......@@ -29,7 +29,7 @@
#include "libavcodec/aac_tables.h"
#else
#include "libavutil/mathematics.h"
#include "libavcodec/aac.h"
#include "aac.h"
float ff_aac_pow2sf_tab[428];
void ff_aac_tableinit(void)
......
......@@ -164,7 +164,6 @@ typedef struct AC3EncOptions {
int cpl_start;
} AC3EncOptions;
void ff_ac3_common_init(void);
extern const int64_t ff_ac3_channel_layouts[];
......
This diff is collapsed.
This diff is collapsed.
......@@ -83,8 +83,6 @@ void ff_copy_bits(PutBitContext *pb, const uint8_t *src, int length)
/* VLC decoding */
//#define DEBUG_VLC
#define GET_DATA(v, table, i, wrap, size) \
{\
const uint8_t *ptr = (const uint8_t *)table + i * wrap;\
......@@ -164,10 +162,7 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes,
table_size = 1 << table_nb_bits;
table_index = alloc_table(vlc, table_size, flags & INIT_VLC_USE_NEW_STATIC);
#ifdef DEBUG_VLC
av_log(NULL,AV_LOG_DEBUG,"new table index=%d size=%d\n",
table_index, table_size);
#endif
av_dlog(NULL, "new table index=%d size=%d\n", table_index, table_size);
if (table_index < 0)
return -1;
table = &vlc->table[table_index];
......@@ -182,9 +177,7 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes,
n = codes[i].bits;
code = codes[i].code;
symbol = codes[i].symbol;
#if defined(DEBUG_VLC) && 0
av_log(NULL,AV_LOG_DEBUG,"i=%d n=%d code=0x%x\n", i, n, code);
#endif
av_dlog(NULL, "i=%d n=%d code=0x%x\n", i, n, code);
if (n <= table_nb_bits) {
/* no need to add another table */
j = code >> (32 - table_nb_bits);
......@@ -195,10 +188,7 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes,
inc = 1 << n;
}
for (k = 0; k < nb; k++) {
#ifdef DEBUG_VLC
av_log(NULL, AV_LOG_DEBUG, "%4x: code=%d n=%d\n",
j, i, n);
#endif
av_dlog(NULL, "%4x: code=%d n=%d\n", j, i, n);
if (table[j][1] /*bits*/ != 0) {
av_log(NULL, AV_LOG_ERROR, "incorrect codes\n");
return -1;
......@@ -228,10 +218,8 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes,
subtable_bits = FFMIN(subtable_bits, table_nb_bits);
j = (flags & INIT_VLC_LE) ? bitswap_32(code_prefix) >> (32 - table_nb_bits) : code_prefix;
table[j][1] = -subtable_bits;
#ifdef DEBUG_VLC
av_log(NULL,AV_LOG_DEBUG,"%4x: n=%d (subtable)\n",
j, codes[i].bits + table_nb_bits);
#endif
av_dlog(NULL, "%4x: n=%d (subtable)\n",
j, codes[i].bits + table_nb_bits);
index = build_table(vlc, subtable_bits, k-i, codes+i, flags);
if (index < 0)
return -1;
......@@ -293,9 +281,7 @@ int init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes,
vlc->table_size = 0;
}
#ifdef DEBUG_VLC
av_log(NULL,AV_LOG_DEBUG,"build table nb_codes=%d\n", nb_codes);
#endif
av_dlog(NULL, "build table nb_codes=%d\n", nb_codes);
buf = av_malloc((nb_codes+1)*sizeof(VLCcode));
......
......@@ -25,8 +25,9 @@
#define AVCODEC_DNXHDENC_H
#include <stdint.h>
#include "libavcodec/mpegvideo.h"
#include "libavcodec/dnxhddata.h"
#include "mpegvideo.h"
#include "dnxhddata.h"
typedef struct {
uint16_t mb;
......
......@@ -358,9 +358,6 @@ static av_cold int dvvideo_init_encoder(AVCodecContext *avctx)
return dvvideo_init(avctx);
}
// #define VLC_DEBUG
// #define printf(...) av_log(NULL, AV_LOG_ERROR, __VA_ARGS__)
typedef struct BlockInfo {
const uint32_t *factor_table;
const uint8_t *scan_table;
......@@ -404,9 +401,8 @@ static void dv_decode_ac(GetBitContext *gb, BlockInfo *mb, DCTELEM *block)
/* get the AC coefficients until last_index is reached */
for (;;) {
#ifdef VLC_DEBUG
printf("%2d: bits=%04x index=%d\n", pos, SHOW_UBITS(re, gb, 16), re_index);
#endif
av_dlog(NULL, "%2d: bits=%04x index=%d\n", pos, SHOW_UBITS(re, gb, 16),
re_index);
/* our own optimized GET_RL_VLC */
index = NEG_USR32(re_cache, TEX_VLC_BITS);
vlc_len = dv_rl_vlc[index].len;
......@@ -427,9 +423,7 @@ static void dv_decode_ac(GetBitContext *gb, BlockInfo *mb, DCTELEM *block)
}
re_index += vlc_len;
#ifdef VLC_DEBUG
printf("run=%d level=%d\n", run, level);
#endif
av_dlog(NULL, "run=%d level=%d\n", run, level);
pos += run;
if (pos >= 64)
break;
......@@ -533,9 +527,7 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg)
mb->pos = 0;
mb->partial_bit_count = 0;
#ifdef VLC_DEBUG
printf("MB block: %d, %d ", mb_index, j);
#endif
av_dlog(avctx, "MB block: %d, %d ", mb_index, j);
dv_decode_ac(&gb, mb, block);
/* write the remaining bits in a new buffer only if the
......@@ -548,9 +540,7 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg)
}
/* pass 2 : we can do it just after */
#ifdef VLC_DEBUG
printf("***pass 2 size=%d MB#=%d\n", put_bits_count(&pb), mb_index);
#endif
av_dlog(avctx, "***pass 2 size=%d MB#=%d\n", put_bits_count(&pb), mb_index);
block = block1;
mb = mb1;
init_get_bits(&gb, mb_bit_buffer, put_bits_count(&pb));
......@@ -570,9 +560,7 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg)
}
/* we need a pass other the whole video segment */
#ifdef VLC_DEBUG
printf("***pass 3 size=%d\n", put_bits_count(&vs_pb));
#endif
av_dlog(avctx, "***pass 3 size=%d\n", put_bits_count(&vs_pb));
block = &sblock[0][0];
mb = mb_data;
init_get_bits(&gb, vs_bit_buffer, put_bits_count(&vs_pb));
......@@ -580,9 +568,7 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg)
for (mb_index = 0; mb_index < 5; mb_index++) {
for (j = 0; j < s->sys->bpm; j++) {
if (mb->pos < 64) {
#ifdef VLC_DEBUG
printf("start %d:%d\n", mb_index, j);
#endif
av_dlog(avctx, "start %d:%d\n", mb_index, j);
dv_decode_ac(&gb, mb, block);
}
if (mb->pos >= 64 && mb->pos < 127)
......
......@@ -22,9 +22,6 @@
#include "dsputil.h"
#include "get_bits.h"
//#define DEBUG
//#define DEBUG_PACKET_CONTENTS
/* Parser (mostly) copied from dvdsub.c */
#define PARSE_BUF_SIZE (65536)
......@@ -53,25 +50,20 @@ static int dvbsub_parse(AVCodecParserContext *s,
{
DVBSubParseContext *pc = s->priv_data;
uint8_t *p, *p_end;
int len, buf_pos = 0;
int i, len, buf_pos = 0;
av_dlog(avctx, "DVB parse packet pts=%"PRIx64", lpts=%"PRIx64", cpts=%"PRIx64":\n",
s->pts, s->last_pts, s->cur_frame_pts[s->cur_frame_start_index]);
#ifdef DEBUG_PACKET_CONTENTS
int i;
for (i=0; i < buf_size; i++)
{
av_log(avctx, AV_LOG_INFO, "%02x ", buf[i]);
av_dlog(avctx, "%02x ", buf[i]);
if (i % 16 == 15)
av_log(avctx, AV_LOG_INFO, "\n");
av_dlog(avctx, "\n");
}
if (i % 16 != 0)
av_log(avctx, AV_LOG_INFO, "\n");
#endif
av_dlog(avctx, "\n");
*poutbuf = NULL;
*poutbuf_size = 0;
......
......@@ -24,10 +24,6 @@
#include "bytestream.h"
#include "libavutil/colorspace.h"
//#define DEBUG
//#define DEBUG_PACKET_CONTENTS
//#define DEBUG_SAVE_IMAGES
#define DVBSUB_PAGE_SEGMENT 0x10
#define DVBSUB_REGION_SEGMENT 0x11
#define DVBSUB_CLUT_SEGMENT 0x12
......@@ -37,7 +33,7 @@
#define cm (ff_cropTbl + MAX_NEG_CROP)
#ifdef DEBUG_SAVE_IMAGES
#ifdef DEBUG
#undef fprintf
#if 0
static void png_save(const char *filename, uint8_t *bitmap, int w, int h,
......@@ -768,20 +764,17 @@ static void dvbsub_parse_pixel_data_block(AVCodecContext *avctx, DVBSubObjectDis
av_dlog(avctx, "DVB pixel block size %d, %s field:\n", buf_size,
top_bottom ? "bottom" : "top");
#ifdef DEBUG_PACKET_CONTENTS
for (i = 0; i < buf_size; i++) {
if (i % 16 == 0)
av_log(avctx, AV_LOG_INFO, "0x%08p: ", buf+i);
av_dlog(avctx, "0x%8p: ", buf+i);
av_log(avctx, AV_LOG_INFO, "%02x ", buf[i]);
av_dlog(avctx, "%02x ", buf[i]);
if (i % 16 == 15)
av_log(avctx, AV_LOG_INFO, "\n");
av_dlog(avctx, "\n");
}
if (i % 16)
av_log(avctx, AV_LOG_INFO, "\n");
#endif
av_dlog(avctx, "\n");
if (region == 0)
return;
......@@ -930,27 +923,22 @@ static void dvbsub_parse_clut_segment(AVCodecContext *avctx,
DVBSubContext *ctx = avctx->priv_data;
const uint8_t *buf_end = buf + buf_size;
int clut_id;
int i, clut_id;
DVBSubCLUT *clut;
int entry_id, depth , full_range;
int y, cr, cb, alpha;
int r, g, b, r_add, g_add, b_add;
#ifdef DEBUG_PACKET_CONTENTS
int i;
av_log(avctx, AV_LOG_INFO, "DVB clut packet:\n");
av_dlog(avctx, "DVB clut packet:\n");
for (i=0; i < buf_size; i++) {
av_log(avctx, AV_LOG_INFO, "%02x ", buf[i]);
av_dlog(avctx, "%02x ", buf[i]);
if (i % 16 == 15)
av_log(avctx, AV_LOG_INFO, "\n");
av_dlog(avctx, "\n");
}
if (i % 16)
av_log(avctx, AV_LOG_INFO, "\n");
#endif
av_dlog(avctx, "\n");
clut_id = *buf++;
buf += 1;
......@@ -1194,7 +1182,7 @@ static void dvbsub_parse_page_segment(AVCodecContext *avctx,
}
#ifdef DEBUG_SAVE_IMAGES
#ifdef DEBUG
static void save_display_set(DVBSubContext *ctx)
{
DVBSubRegion *region;
......@@ -1404,7 +1392,7 @@ static int dvbsub_display_end_segment(AVCodecContext *avctx, const uint8_t *buf,
sub->num_rects = i;
#ifdef DEBUG_SAVE_IMAGES
#ifdef DEBUG
save_display_set(ctx);
#endif
......@@ -1423,22 +1411,18 @@ static int dvbsub_decode(AVCodecContext *avctx,
int segment_type;
int page_id;
int segment_length;
#ifdef DEBUG_PACKET_CONTENTS
int i;
av_log(avctx, AV_LOG_INFO, "DVB sub packet:\n");
av_dlog(avctx, "DVB sub packet:\n");
for (i=0; i < buf_size; i++) {
av_log(avctx, AV_LOG_INFO, "%02x ", buf[i]);
av_dlog(avctx, "%02x ", buf[i]);
if (i % 16 == 15)
av_log(avctx, AV_LOG_INFO, "\n");
av_dlog(avctx, "\n");
}
if (i % 16)
av_log(avctx, AV_LOG_INFO, "\n");
#endif
av_dlog(avctx, "\n");
if (buf_size <= 6 || *buf != 0x0f) {
av_dlog(avctx, "incomplete or broken packet");
......
/*
* E-AC-3 encoder
* Copyright (c) 2011 Justin Ruggles <justin.ruggles@gmail.com>
*
* This file is part of Libav.
*
* Libav is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* Libav 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* E-AC-3 encoder
*/
#define CONFIG_AC3ENC_FLOAT 1
#include "ac3enc.h"
#include "eac3enc.h"
void ff_eac3_set_cpl_states(AC3EncodeContext *s)
{
int ch, blk;
int first_cpl_coords[AC3_MAX_CHANNELS];
/* set first cpl coords */
for (ch = 1; ch <= s->fbw_channels; ch++)
first_cpl_coords[ch] = 1;
for (blk = 0; blk < AC3_MAX_BLOCKS; blk++) {
AC3Block *block = &s->blocks[blk];
for (ch = 1; ch <= s->fbw_channels; ch++) {
if (block->channel_in_cpl[ch]) {
if (first_cpl_coords[ch]) {
block->new_cpl_coords = 2;
first_cpl_coords[ch] = 0;
}
} else {
first_cpl_coords[ch] = 1;
}
}
}
/* set first cpl leak */
for (blk = 0; blk < AC3_MAX_BLOCKS; blk++) {
AC3Block *block = &s->blocks[blk];
if (block->cpl_in_use) {
block->new_cpl_leak = 2;
break;
}
}
}
void ff_eac3_output_frame_header(AC3EncodeContext *s)
{
int blk, ch;
AC3EncOptions *opt = &s->options;
put_bits(&s->pb, 16, 0x0b77); /* sync word */
/* BSI header */
put_bits(&s->pb, 2, 0); /* stream type = independent */
put_bits(&s->pb, 3, 0); /* substream id = 0 */
put_bits(&s->pb, 11, (s->frame_size / 2) - 1); /* frame size */
if (s->bit_alloc.sr_shift) {
put_bits(&s->pb, 2, 0x3); /* fscod2 */
put_bits(&s->pb, 2, s->bit_alloc.sr_code); /* sample rate code */
} else {
put_bits(&s->pb, 2, s->bit_alloc.sr_code); /* sample rate code */
put_bits(&s->pb, 2, 0x3); /* number of blocks = 6 */
}
put_bits(&s->pb, 3, s->channel_mode); /* audio coding mode */
put_bits(&s->pb, 1, s->lfe_on); /* LFE channel indicator */
put_bits(&s->pb, 5, s->bitstream_id); /* bitstream id (EAC3=16) */
put_bits(&s->pb, 5, -opt->dialogue_level); /* dialogue normalization level */
put_bits(&s->pb, 1, 0); /* no compression gain */
put_bits(&s->pb, 1, 0); /* no mixing metadata */
/* TODO: mixing metadata */
put_bits(&s->pb, 1, 0); /* no info metadata */
/* TODO: info metadata */
put_bits(&s->pb, 1, 0); /* no additional bit stream info */
/* frame header */
put_bits(&s->pb, 1, 1); /* exponent strategy syntax = each block */
put_bits(&s->pb, 1, 0); /* aht enabled = no */
put_bits(&s->pb, 2, 0); /* snr offset strategy = 1 */
put_bits(&s->pb, 1, 0); /* transient pre-noise processing enabled = no */
put_bits(&s->pb, 1, 0); /* block switch syntax enabled = no */
put_bits(&s->pb, 1, 0); /* dither flag syntax enabled = no */
put_bits(&s->pb, 1, 0); /* bit allocation model syntax enabled = no */
put_bits(&s->pb, 1, 0); /* fast gain codes enabled = no */
put_bits(&s->pb, 1, 0); /* dba syntax enabled = no */
put_bits(&s->pb, 1, 0); /* skip field syntax enabled = no */
put_bits(&s->pb, 1, 0); /* spx enabled = no */
/* coupling strategy use flags */
if (s->channel_mode > AC3_CHMODE_MONO) {
put_bits(&s->pb, 1, s->blocks[0].cpl_in_use);
for (blk = 1; blk < AC3_MAX_BLOCKS; blk++) {
AC3Block *block = &s->blocks[blk];
put_bits(&s->pb, 1, block->new_cpl_strategy);
if (block->new_cpl_strategy)
put_bits(&s->pb, 1, block->cpl_in_use);
}
}
/* exponent strategy */
for (blk = 0; blk < AC3_MAX_BLOCKS; blk++)
for (ch = !s->blocks[blk].cpl_in_use; ch <= s->fbw_channels; ch++)
put_bits(&s->pb, 2, s->exp_strategy[ch][blk]);
if (s->lfe_on) {
for (blk = 0; blk < AC3_MAX_BLOCKS; blk++)
put_bits(&s->pb, 1, s->exp_strategy[s->lfe_channel][blk]);
}
/* E-AC-3 to AC-3 converter exponent strategy (unfortunately not optional...) */
for (ch = 1; ch <= s->fbw_channels; ch++)
put_bits(&s->pb, 5, 0);
/* snr offsets */
put_bits(&s->pb, 6, s->coarse_snr_offset);
put_bits(&s->pb, 4, s->fine_snr_offset[1]);
/* block start info */
put_bits(&s->pb, 1, 0);
}
/*
* E-AC-3 encoder
* Copyright (c) 2011 Justin Ruggles <justin.ruggles@gmail.com>
*
* This file is part of Libav.
*
* Libav is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* Libav 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* E-AC-3 encoder
*/
#ifndef AVCODEC_EAC3ENC_H
#define AVCODEC_EAC3ENC_H
#include "ac3enc.h"
/**
* Set coupling states.
* This determines whether certain flags must be written to the bitstream or
* whether they will be implicitly already known by the decoder.
*/
void ff_eac3_set_cpl_states(AC3EncodeContext *s);
/**
* Write the E-AC-3 frame header to the output bitstream.
*/
void ff_eac3_output_frame_header(AC3EncodeContext *s);
#endif /* AVCODEC_EAC3ENC_H */
......@@ -151,8 +151,6 @@ static int biquad_init_coeffs(void *avc, struct FFIIRFilterCoeffs *c,
// during filtering, the delay state will include the gain multiplication
c->cx[0] = lrintf(x0 / c->gain);
c->cx[1] = lrintf(x1 / c->gain);
c->cy[0] /= c->gain;
c->cy[1] /= c->gain;
return 0;
}
......
......@@ -19,8 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavcodec/mlp.h"
#include "dsputil.h"
#include "mlp.h"
static void ff_mlp_filter_channel(int32_t *state, const int32_t *coeff,
int firorder, int iirorder,
......
......@@ -30,8 +30,6 @@
#include "libavutil/colorspace.h"
#include "libavutil/imgutils.h"
//#define DEBUG_PACKET_CONTENTS
#define RGBA(r,g,b,a) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b))
enum SegmentType {
......@@ -403,21 +401,18 @@ static int decode(AVCodecContext *avctx, void *data, int *data_size,
const uint8_t *buf_end;
uint8_t segment_type;
int segment_length;
#ifdef DEBUG_PACKET_CONTENTS
int i;
av_log(avctx, AV_LOG_INFO, "PGS sub packet:\n");
av_dlog(avctx, "PGS sub packet:\n");
for (i = 0; i < buf_size; i++) {
av_log(avctx, AV_LOG_INFO, "%02x ", buf[i]);
av_dlog(avctx, "%02x ", buf[i]);
if (i % 16 == 15)
av_log(avctx, AV_LOG_INFO, "\n");
av_dlog(avctx, "\n");
}
if (i & 15)
av_log(avctx, AV_LOG_INFO, "\n");
#endif
av_dlog(avctx, "\n");
*data_size = 0;
......
......@@ -18,8 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
//#define DEBUG_ALIGNMENT
#ifdef DEBUG_ALIGNMENT
#ifdef DEBUG
#define ASSERT_ALIGNED(ptr) assert(((unsigned long)ptr&0x0000000F));
#else
#define ASSERT_ALIGNED(ptr) ;
......
......@@ -26,7 +26,6 @@
*
*/
#define DEBUG
#include <limits.h>
#include "avcodec.h"
#include "get_bits.h"
......@@ -304,7 +303,6 @@ static int shorten_decode_frame(AVCodecContext *avctx,
s->bitstream_size= buf_size;
if(buf_size < s->max_framesize){
//av_dlog(avctx, "wanna more data ... %d\n", buf_size);
*data_size = 0;
return input_buf_size;
}
......
......@@ -22,7 +22,7 @@
*/
#include "avcodec.h"
#include "libavcodec/bytestream.h"
#include "bytestream.h"
static av_cold int encode_init(AVCodecContext *avctx)
{
......
......@@ -3398,7 +3398,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
VC1Context *v = avctx->priv_data;
MpegEncContext *s = &v->s;
GetBitContext gb;
int i;
int i, cur_width, cur_height;
if (!avctx->extradata_size || !avctx->extradata) return -1;
if (!(avctx->flags & CODEC_FLAG_GRAY))
......@@ -3419,8 +3419,8 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
if (vc1_init_common(v) < 0) return -1;
ff_vc1dsp_init(&v->vc1dsp);
avctx->coded_width = avctx->width;
avctx->coded_height = avctx->height;
cur_width = avctx->coded_width = avctx->width;
cur_height = avctx->coded_height = avctx->height;
if (avctx->codec_id == CODEC_ID_WMV3)
{
int count = 0;
......@@ -3491,6 +3491,19 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
}
v->res_sprite = (avctx->codec_tag == MKTAG('W','V','P','2'));
}
// Sequence header information may not have been parsed
// yet when ff_msmpeg4_decode_init was called the fist time
// above. If sequence information changes, we need to call
// it again.
if (cur_width != avctx->width ||
cur_height != avctx->height) {
MPV_common_end(s);
if(ff_msmpeg4_decode_init(avctx) < 0)
return -1;
avctx->coded_width = avctx->width;
avctx->coded_height = avctx->height;
}
avctx->profile = v->profile;
if (v->profile == PROFILE_ADVANCED)
avctx->level = v->level;
......
......@@ -20,6 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <inttypes.h>
#include <math.h>
#define ALT_BITSTREAM_READER_LE
......@@ -1089,6 +1090,9 @@ static int vorbis_floor0_decode(vorbis_context *vc,
for (i = 0; i < order; i++)
lsp[i] = 2.0f * cos(lsp[i]);
av_dlog(NULL, "floor0 synth: map_size = %"PRIu32"; m = %d; wstep = %f\n",
vf->map_size[blockflag], order, wstep);
i = 0;
while (i < vf->map_size[blockflag]) {
int j, iter_cond = vf->map[blockflag][i];
......
This diff is collapsed.
......@@ -1254,7 +1254,7 @@ static int avi_load_index(AVFormatContext *s)
if (avio_seek(pb, avi->movi_end, SEEK_SET) < 0)
goto the_end; // maybe truncated file
#ifdef DEBUG_SEEK
printf("movi_end=0x%"PRIx64"\n", avi->movi_end);
av_log(s, AV_LOG_DEBUG, "movi_end=0x%"PRIx64"\n", avi->movi_end);
#endif
for(;;) {
if (url_feof(pb))
......@@ -1262,7 +1262,7 @@ static int avi_load_index(AVFormatContext *s)
tag = avio_rl32(pb);
size = avio_rl32(pb);
#ifdef DEBUG_SEEK
printf("tag=%c%c%c%c size=0x%x\n",
av_log(s, AV_LOG_DEBUG, "tag=%c%c%c%c size=0x%x\n",
tag & 0xff,
(tag >> 8) & 0xff,
(tag >> 16) & 0xff,
......
......@@ -28,7 +28,7 @@
#include <string.h>
#include "libavutil/intreadwrite.h"
#include "libavutil/avstring.h"
#include "libavformat/internal.h"
#include "internal.h"
#include "mms.h"
#include "asf.h"
#include "http.h"
......
......@@ -23,7 +23,6 @@
#include <limits.h>
//#define DEBUG
//#define DEBUG_METADATA
//#define MOV_EXPORT_ALL_METADATA
#include "libavutil/intreadwrite.h"
......@@ -215,11 +214,9 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
av_metadata_set2(&c->fc->metadata, key2, str, 0);
}
}
#ifdef DEBUG_METADATA
av_log(c->fc, AV_LOG_DEBUG, "lang \"%3s\" ", language);
av_log(c->fc, AV_LOG_DEBUG, "tag \"%s\" value \"%s\" atom \"%.4s\" %d %lld\n",
key, str, (char*)&atom.type, str_size, atom.size);
#endif
av_dlog(c->fc, "lang \"%3s\" ", language);
av_dlog(c->fc, "tag \"%s\" value \"%s\" atom \"%.4s\" %d %"PRId64"\n",
key, str, (char*)&atom.type, str_size, atom.size);
return 0;
}
......
......@@ -586,9 +586,6 @@ static int64_t mpegps_read_dts(AVFormatContext *s, int stream_index,
int64_t pos, pts, dts;
pos = *ppos;
#ifdef DEBUG_SEEK
printf("read_dts: pos=0x%"PRIx64" next=%d -> ", pos, find_next);
#endif
if (avio_seek(s->pb, pos, SEEK_SET) < 0)
return AV_NOPTS_VALUE;
......@@ -596,7 +593,7 @@ static int64_t mpegps_read_dts(AVFormatContext *s, int stream_index,
len = mpegps_read_pes_header(s, &pos, &startcode, &pts, &dts);
if (len < 0) {
#ifdef DEBUG_SEEK
printf("none (ret=%d)\n", len);
av_log(s, AV_LOG_DEBUG, "none (ret=%d)\n", len);
#endif
return AV_NOPTS_VALUE;
}
......@@ -607,7 +604,8 @@ static int64_t mpegps_read_dts(AVFormatContext *s, int stream_index,
avio_skip(s->pb, len);
}
#ifdef DEBUG_SEEK
printf("pos=0x%"PRIx64" dts=0x%"PRIx64" %0.3f\n", pos, dts, dts / 90000.0);
av_log(s, AV_LOG_DEBUG, "pos=0x%"PRIx64" dts=0x%"PRIx64" %0.3f\n",
pos, dts, dts / 90000.0);
#endif
*ppos = pos;
return dts;
......
......@@ -31,9 +31,6 @@
#include "rdt.h"
#include "url.h"
//#define DEBUG
//#define DEBUG_RTP_TCP
static int rtsp_read_play(AVFormatContext *s)
{
RTSPState *rt = s->priv_data;
......@@ -191,9 +188,7 @@ int ff_rtsp_tcp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
int id, len, i, ret;
RTSPStream *rtsp_st;
#ifdef DEBUG_RTP_TCP
av_dlog(s, "tcp_read_packet:\n");
#endif
redo:
for (;;) {
RTSPMessageHeader reply;
......@@ -212,9 +207,7 @@ redo:
return -1;
id = buf[0];
len = AV_RB16(buf + 1);
#ifdef DEBUG_RTP_TCP
av_dlog(s, "id=%d len=%d\n", id, len);
#endif
if (len > buf_size || len < 12)
goto redo;
/* get the data */
......
......@@ -23,8 +23,8 @@
* audio conversion routines
*/
#include "libavutil/avutil.h"
#include "libavutil/avstring.h"
#include "avstring.h"
#include "avutil.h"
#include "audioconvert.h"
static const char * const channel_names[] = {
......
......@@ -40,8 +40,8 @@
#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
#define LIBAVUTIL_VERSION_MAJOR 51
#define LIBAVUTIL_VERSION_MINOR 6
#define LIBAVUTIL_VERSION_MICRO 1
#define LIBAVUTIL_VERSION_MINOR 7
#define LIBAVUTIL_VERSION_MICRO 0
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
LIBAVUTIL_VERSION_MINOR, \
......@@ -60,6 +60,9 @@
#ifndef FF_API_OLD_EVAL_NAMES
#define FF_API_OLD_EVAL_NAMES (LIBAVUTIL_VERSION_MAJOR < 52)
#endif
#ifndef FF_API_GET_BITS_PER_SAMPLE_FMT
#define FF_API_GET_BITS_PER_SAMPLE_FMT (LIBAVUTIL_VERSION_MAJOR < 52)
#endif
/**
* Return the LIBAVUTIL_VERSION_INT constant.
......
......@@ -26,7 +26,7 @@
* see http://joe.hotchkiss.com/programming/eval/eval.html
*/
#include "libavutil/avutil.h"
#include "avutil.h"
#include "eval.h"
typedef struct Parser {
......
......@@ -23,7 +23,7 @@
#include "imgutils.h"
#include "internal.h"
#include "libavutil/pixdesc.h"
#include "pixdesc.h"
void av_image_fill_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4],
const AVPixFmtDescriptor *pixdesc)
......
......@@ -24,8 +24,8 @@
* misc image utilities
*/
#include "libavutil/pixdesc.h"
#include "avutil.h"
#include "pixdesc.h"
/**
* Compute the max pixel step for each plane of an image with a
......
......@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/intmath.h"
#include <stdint.h>
/* a*inverse[b]>>32 == a/b for all 0<=a<=16909558 && 2<=b<=256
* for a>16909558, is an overestimate by less than 1 part in 1<<24 */
......
......@@ -24,11 +24,12 @@
#include <strings.h>
#include <sys/time.h>
#include <time.h>
#include "avstring.h"
#include "avutil.h"
#include "eval.h"
#include "random_seed.h"
#include "parseutils.h"
#include "libavutil/avutil.h"
#include "libavutil/eval.h"
#include "libavutil/avstring.h"
#include "libavutil/random_seed.h"
typedef struct {
const char *abbr;
......
......@@ -19,7 +19,7 @@
#ifndef AVUTIL_PARSEUTILS_H
#define AVUTIL_PARSEUTILS_H
#include "libavutil/rational.h"
#include "rational.h"
/**
* @file
......
......@@ -66,11 +66,19 @@ char *av_get_sample_fmt_string (char *buf, int buf_size, enum AVSampleFormat sam
return buf;
}
int av_get_bytes_per_sample(enum AVSampleFormat sample_fmt)
{
return sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB ?
0 : sample_fmt_info[sample_fmt].bits >> 3;
}
#if FF_API_GET_BITS_PER_SAMPLE_FMT
int av_get_bits_per_sample_fmt(enum AVSampleFormat sample_fmt)
{
return sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB ?
0 : sample_fmt_info[sample_fmt].bits;
}
#endif
int av_samples_fill_arrays(uint8_t *pointers[8], int linesizes[8],
uint8_t *buf, int nb_channels, int nb_samples,
......
......@@ -60,14 +60,22 @@ enum AVSampleFormat av_get_sample_fmt(const char *name);
*/
char *av_get_sample_fmt_string(char *buf, int buf_size, enum AVSampleFormat sample_fmt);
#if FF_API_GET_BITS_PER_SAMPLE_FMT
/**
* Return sample format bits per sample.
* @deprecated Use av_get_bytes_per_sample() instead.
*/
attribute_deprecated
int av_get_bits_per_sample_fmt(enum AVSampleFormat sample_fmt);
#endif
/**
* Return number of bytes per sample.
*
* @param sample_fmt the sample format
* @return number of bits per sample or zero if unknown for the given
* @return number of bytes per sample or zero if unknown for the given
* sample format
*/
int av_get_bits_per_sample_fmt(enum AVSampleFormat sample_fmt);
int av_get_bytes_per_sample(enum AVSampleFormat sample_fmt);
/**
* Fill channel data pointers and linesizes for samples with sample
......
......@@ -403,15 +403,19 @@ static void hScale_altivec_real(int16_t *dst, int dstW,
void ff_sws_init_swScale_altivec(SwsContext *c)
{
enum PixelFormat dstFormat = c->dstFormat;
if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC))
return;
c->hScale = hScale_altivec_real;
c->yuv2yuvX = yuv2yuvX_altivec_real;
if (!is16BPS(dstFormat) && !is9_OR_10BPS(dstFormat)) {
c->yuv2yuvX = yuv2yuvX_altivec_real;
}
/* The following list of supported dstFormat values should
* match what's found in the body of ff_yuv2packedX_altivec() */
if (!(c->flags & SWS_BITEXACT) && !c->alpPixBuf &&
if (!(c->flags & (SWS_BITEXACT | SWS_FULL_CHR_H_INT)) && !c->alpPixBuf &&
(c->dstFormat==PIX_FMT_ABGR || c->dstFormat==PIX_FMT_BGRA ||
c->dstFormat==PIX_FMT_BGR24 || c->dstFormat==PIX_FMT_RGB24 ||
c->dstFormat==PIX_FMT_RGBA || c->dstFormat==PIX_FMT_ARGB)) {
......
This diff is collapsed.
......@@ -59,6 +59,41 @@ typedef int (*SwsFunc)(struct SwsContext *context, const uint8_t* src[],
int srcStride[], int srcSliceY, int srcSliceH,
uint8_t* dst[], int dstStride[]);
typedef void (*yuv2planar1_fn) (struct SwsContext *c,
const int16_t *lumSrc, const int16_t *chrUSrc,
const int16_t *chrVSrc, const int16_t *alpSrc,
uint8_t *dest,
uint8_t *uDest, uint8_t *vDest, uint8_t *aDest,
int dstW, int chrDstW, const uint8_t *lumDither, const uint8_t *chrDither);
typedef void (*yuv2planarX_fn) (struct SwsContext *c,
const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize,
const int16_t *chrFilter, const int16_t **chrUSrc,
const int16_t **chrVSrc, int chrFilterSize,
const int16_t **alpSrc,
uint8_t *dest,
uint8_t *uDest, uint8_t *vDest, uint8_t *aDest,
int dstW, int chrDstW, const uint8_t *lumDither, const uint8_t *chrDither);
typedef void (*yuv2packed1_fn) (struct SwsContext *c,
const uint16_t *buf0,
const uint16_t *ubuf0, const uint16_t *ubuf1,
const uint16_t *vbuf0, const uint16_t *vbuf1,
const uint16_t *abuf0,
uint8_t *dest,
int dstW, int uvalpha, int dstFormat, int flags, int y);
typedef void (*yuv2packed2_fn) (struct SwsContext *c,
const uint16_t *buf0, const uint16_t *buf1,
const uint16_t *ubuf0, const uint16_t *ubuf1,
const uint16_t *vbuf0, const uint16_t *vbuf1,
const uint16_t *abuf0, const uint16_t *abuf1,
uint8_t *dest,
int dstW, int yalpha, int uvalpha, int y);
typedef void (*yuv2packedX_fn) (struct SwsContext *c,
const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize,
const int16_t *chrFilter, const int16_t **chrUSrc,
const int16_t **chrVSrc, int chrFilterSize,
const int16_t **alpSrc, uint8_t *dest,
int dstW, int dstY);
/* This struct should be aligned on at least a 32-byte boundary. */
typedef struct SwsContext {
/**
......@@ -256,46 +291,11 @@ typedef struct SwsContext {
#endif
/* function pointers for swScale() */
void (*yuv2nv12X )(struct SwsContext *c,
const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize,
const int16_t *chrFilter, const int16_t **chrUSrc,
const int16_t **chrVSrc, int chrFilterSize,
uint8_t *dest, uint8_t *uDest,
int dstW, int chrDstW, int dstFormat, const uint8_t *lumDither, const uint8_t *chrDither);
void (*yuv2yuv1 )(struct SwsContext *c,
const int16_t *lumSrc, const int16_t *chrUSrc,
const int16_t *chrVSrc, const int16_t *alpSrc,
uint8_t *dest,
uint8_t *uDest, uint8_t *vDest, uint8_t *aDest,
int dstW, int chrDstW, const uint8_t *lumDither, const uint8_t *chrDither);
void (*yuv2yuvX )(struct SwsContext *c,
const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize,
const int16_t *chrFilter, const int16_t **chrUSrc,
const int16_t **chrVSrc, int chrFilterSize,
const int16_t **alpSrc,
uint8_t *dest,
uint8_t *uDest, uint8_t *vDest, uint8_t *aDest,
int dstW, int chrDstW, const uint8_t *lumDither, const uint8_t *chrDither);
void (*yuv2packed1)(struct SwsContext *c,
const uint16_t *buf0,
const uint16_t *ubuf0, const uint16_t *ubuf1,
const uint16_t *vbuf0, const uint16_t *vbuf1,
const uint16_t *abuf0,
uint8_t *dest,
int dstW, int uvalpha, int dstFormat, int flags, int y);
void (*yuv2packed2)(struct SwsContext *c,
const uint16_t *buf0, const uint16_t *buf1,
const uint16_t *ubuf0, const uint16_t *ubuf1,
const uint16_t *vbuf0, const uint16_t *vbuf1,
const uint16_t *abuf0, const uint16_t *abuf1,
uint8_t *dest,
int dstW, int yalpha, int uvalpha, int y);
void (*yuv2packedX)(struct SwsContext *c,
const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize,
const int16_t *chrFilter, const int16_t **chrUSrc,
const int16_t **chrVSrc, int chrFilterSize,
const int16_t **alpSrc, uint8_t *dest,
int dstW, int dstY);
yuv2planar1_fn yuv2yuv1;
yuv2planarX_fn yuv2yuvX;
yuv2packed1_fn yuv2packed1;
yuv2packed2_fn yuv2packed2;
yuv2packedX_fn yuv2packedX;
void (*lumToYV12)(uint8_t *dst, const uint8_t *src,
int width, uint32_t *pal); ///< Unscaled conversion of luma plane to YV12 for horizontal scaler.
......@@ -323,10 +323,6 @@ typedef struct SwsContext {
void (*lumConvertRange)(int16_t *dst, int width); ///< Color range conversion function for luma plane if needed.
void (*chrConvertRange)(int16_t *dst1, int16_t *dst2, int width); ///< Color range conversion function for chroma planes if needed.
int lumSrcOffset; ///< Offset given to luma src pointers passed to horizontal input functions.
int chrSrcOffset; ///< Offset given to chroma src pointers passed to horizontal input functions.
int alpSrcOffset; ///< Offset given to alpha src pointers passed to horizontal input functions.
int needs_hcscale; ///< Set if there are chroma planes to be converted.
} SwsContext;
......
......@@ -2351,56 +2351,64 @@ static inline void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst1, int16_t *d
static void RENAME(sws_init_swScale)(SwsContext *c)
{
enum PixelFormat srcFormat = c->srcFormat;
if (!(c->flags & SWS_BITEXACT)) {
if (c->flags & SWS_ACCURATE_RND) {
c->yuv2yuv1 = RENAME(yuv2yuv1_ar );
c->yuv2yuvX = RENAME(yuv2yuvX_ar );
switch (c->dstFormat) {
case PIX_FMT_RGB32: c->yuv2packedX = RENAME(yuv2rgb32_X_ar); break;
case PIX_FMT_BGR24: c->yuv2packedX = RENAME(yuv2bgr24_X_ar); break;
case PIX_FMT_RGB555: c->yuv2packedX = RENAME(yuv2rgb555_X_ar); break;
case PIX_FMT_RGB565: c->yuv2packedX = RENAME(yuv2rgb565_X_ar); break;
case PIX_FMT_YUYV422: c->yuv2packedX = RENAME(yuv2yuyv422_X_ar); break;
default: break;
enum PixelFormat srcFormat = c->srcFormat,
dstFormat = c->dstFormat;
if (!is16BPS(dstFormat) && !is9_OR_10BPS(dstFormat) && dstFormat != PIX_FMT_NV12
&& dstFormat != PIX_FMT_NV21 && !(c->flags & SWS_BITEXACT)) {
if (c->flags & SWS_ACCURATE_RND) {
c->yuv2yuv1 = RENAME(yuv2yuv1_ar );
c->yuv2yuvX = RENAME(yuv2yuvX_ar );
if (!(c->flags & SWS_FULL_CHR_H_INT)) {
switch (c->dstFormat) {
case PIX_FMT_RGB32: c->yuv2packedX = RENAME(yuv2rgb32_X_ar); break;
case PIX_FMT_BGR24: c->yuv2packedX = RENAME(yuv2bgr24_X_ar); break;
case PIX_FMT_RGB555: c->yuv2packedX = RENAME(yuv2rgb555_X_ar); break;
case PIX_FMT_RGB565: c->yuv2packedX = RENAME(yuv2rgb565_X_ar); break;
case PIX_FMT_YUYV422: c->yuv2packedX = RENAME(yuv2yuyv422_X_ar); break;
default: break;
}
}
} else {
int should_dither= isNBPS(c->srcFormat) || is16BPS(c->srcFormat);
c->yuv2yuv1 = should_dither ? RENAME(yuv2yuv1_ar ) : RENAME(yuv2yuv1 );
c->yuv2yuvX = RENAME(yuv2yuvX );
if (!(c->flags & SWS_FULL_CHR_H_INT)) {
switch (c->dstFormat) {
case PIX_FMT_RGB32: c->yuv2packedX = RENAME(yuv2rgb32_X); break;
case PIX_FMT_BGR24: c->yuv2packedX = RENAME(yuv2bgr24_X); break;
case PIX_FMT_RGB555: c->yuv2packedX = RENAME(yuv2rgb555_X); break;
case PIX_FMT_RGB565: c->yuv2packedX = RENAME(yuv2rgb565_X); break;
case PIX_FMT_YUYV422: c->yuv2packedX = RENAME(yuv2yuyv422_X); break;
default: break;
}
}
}
} else {
int should_dither= isNBPS(c->srcFormat) || is16BPS(c->srcFormat);
c->yuv2yuv1 = should_dither ? RENAME(yuv2yuv1_ar ) : RENAME(yuv2yuv1 );
c->yuv2yuvX = RENAME(yuv2yuvX );
if (!(c->flags & SWS_FULL_CHR_H_INT)) {
switch (c->dstFormat) {
case PIX_FMT_RGB32: c->yuv2packedX = RENAME(yuv2rgb32_X); break;
case PIX_FMT_BGR24: c->yuv2packedX = RENAME(yuv2bgr24_X); break;
case PIX_FMT_RGB555: c->yuv2packedX = RENAME(yuv2rgb555_X); break;
case PIX_FMT_RGB565: c->yuv2packedX = RENAME(yuv2rgb565_X); break;
case PIX_FMT_YUYV422: c->yuv2packedX = RENAME(yuv2yuyv422_X); break;
default: break;
}
}
switch (c->dstFormat) {
case PIX_FMT_RGB32:
case PIX_FMT_RGB32:
c->yuv2packed1 = RENAME(yuv2rgb32_1);
c->yuv2packed2 = RENAME(yuv2rgb32_2);
break;
case PIX_FMT_BGR24:
case PIX_FMT_BGR24:
c->yuv2packed1 = RENAME(yuv2bgr24_1);
c->yuv2packed2 = RENAME(yuv2bgr24_2);
break;
case PIX_FMT_RGB555:
case PIX_FMT_RGB555:
c->yuv2packed1 = RENAME(yuv2rgb555_1);
c->yuv2packed2 = RENAME(yuv2rgb555_2);
break;
case PIX_FMT_RGB565:
case PIX_FMT_RGB565:
c->yuv2packed1 = RENAME(yuv2rgb565_1);
c->yuv2packed2 = RENAME(yuv2rgb565_2);
break;
case PIX_FMT_YUYV422:
case PIX_FMT_YUYV422:
c->yuv2packed1 = RENAME(yuv2yuyv422_1);
c->yuv2packed2 = RENAME(yuv2yuyv422_2);
break;
default:
default:
break;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment