project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
FFmpeg | a99c273a3f91c3fd616b718c34a5848411ce0258 | 1 | static int dnxhd_init_vlc(DNXHDContext *ctx, int cid)
{
if (cid != ctx->cid) {
int index;
if ((index = ff_dnxhd_get_cid_table(cid)) < 0) {
av_log(ctx->avctx, AV_LOG_ERROR, "unsupported cid %d\n", cid);
return -1;
}
if (ff_dnxhd_cid_table[index].bit_d... | 13,216 |
FFmpeg | c4ce8709676a6f0b41761093b0da08de72799ba9 | 1 | static int flv_set_video_codec(AVFormatContext *s, AVStream *vstream, int flv_codecid) {
AVCodecContext *vcodec = vstream->codec;
switch(flv_codecid) {
case FLV_CODECID_H263 : vcodec->codec_id = CODEC_ID_FLV1 ; break;
case FLV_CODECID_REALH263: vcodec->codec_id = CODEC_ID_H263 ; break; //... | 13,217 |
FFmpeg | a70c27e813346a11e5fff3d329ecba82fb76826a | 1 | static void vc1_mspel_mc(uint8_t *dst, const uint8_t *src, int stride, int mode, int rnd)
{
int i, j;
uint8_t tmp[8*11], *tptr;
int m, r;
m = (mode & 3);
r = rnd;
src -= stride;
tptr = tmp;
for(j = 0; j < 11; j++) {
for(i = 0; i < 8; i++)
tptr[i] = vc1_ms... | 13,218 |
FFmpeg | 1a3d142f1f1e65f554cba84d8a515684ecb390d0 | 1 | static av_cold int bfi_decode_init(AVCodecContext *avctx)
{
BFIContext *bfi = avctx->priv_data;
avctx->pix_fmt = AV_PIX_FMT_PAL8;
bfi->dst = av_mallocz(avctx->width * avctx->height);
return 0;
} | 13,219 |
qemu | c508277335e3b6b20cf18e6ea3a35c1fa835c64a | 1 | static void vmxnet3_set_events(VMXNET3State *s, uint32_t val)
{
uint32_t events;
VMW_CBPRN("Setting events: 0x%x", val);
events = VMXNET3_READ_DRV_SHARED32(s->drv_shmem, ecr) | val;
VMXNET3_WRITE_DRV_SHARED32(s->drv_shmem, ecr, events);
}
| 13,220 |
qemu | e04fb07fd1676e9facd7f3f878c1bbe03bccd26b | 1 | static int qemu_rbd_send_pipe(BDRVRBDState *s, RADOSCB *rcb)
{
int ret = 0;
while (1) {
fd_set wfd;
int fd = s->fds[RBD_FD_WRITE];
/* send the op pointer to the qemu thread that is responsible
for the aio/op completion. Must do it in a qemu thread context */
... | 13,221 |
qemu | e23a1b33b53d25510320b26d9f154e19c6c99725 | 1 | static void tcx_init(target_phys_addr_t addr, int vram_size, int width,
int height, int depth)
{
DeviceState *dev;
SysBusDevice *s;
dev = qdev_create(NULL, "SUNW,tcx");
qdev_prop_set_taddr(dev, "addr", addr);
qdev_prop_set_uint32(dev, "vram_size", vram_size);
qdev_... | 13,222 |
qemu | 94a8d39afd8ccfdbf578af04c3385fdb5f545af1 | 1 | int kvm_init_vcpu(CPUState *env)
{
KVMState *s = kvm_state;
long mmap_size;
int ret;
DPRINTF("kvm_init_vcpu\n");
ret = kvm_vm_ioctl(s, KVM_CREATE_VCPU, env->cpu_index);
if (ret < 0) {
DPRINTF("kvm_create_vcpu failed\n");
goto err;
}
env->kvm_fd = ret;
... | 13,224 |
FFmpeg | c3ab0004ae4dffc32494ae84dd15cfaa909a7884 | 1 | static inline void RENAME(rgb24ToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *unused)
{
#if COMPILE_TEMPLATE_MMX
assert(src1==src2);
RENAME(bgr24ToUV_mmx)(dstU, dstV, src1, width, PIX_FMT_RGB24);
#else
int i;
assert(src1==src2);
for (i=0; i... | 13,226 |
qemu | c87826a878be05208c3906eb9d5e1f37cff5e98e | 1 | int net_init_tap(const NetClientOptions *opts, const char *name,
NetClientState *peer)
{
const NetdevTapOptions *tap;
int fd, vnet_hdr = 0, i = 0, queues;
/* for the no-fd, no-helper case */
const char *script = NULL; /* suppress wrong "uninit'd use" gcc warning */
const char... | 13,227 |
qemu | c5a49c63fa26e8825ad101dfe86339ae4c216539 | 1 | static void spr_read_decr(DisasContext *ctx, int gprn, int sprn)
{
if (ctx->tb->cflags & CF_USE_ICOUNT) {
gen_io_start();
}
gen_helper_load_decr(cpu_gpr[gprn], cpu_env);
if (ctx->tb->cflags & CF_USE_ICOUNT) {
gen_io_end();
gen_stop_exception(ctx);
}
}
| 13,228 |
FFmpeg | 0852648301ad968bc7d79d000400e2b973bbb59a | 1 | static double get_scene_score(AVFilterContext *ctx, AVFilterBufferRef *picref)
{
double ret = 0;
SelectContext *select = ctx->priv;
AVFilterBufferRef *prev_picref = select->prev_picref;
if (prev_picref &&
picref->video->h == prev_picref->video->h &&
picref->video->w == pre... | 13,229 |
qemu | 0b8b8753e4d94901627b3e86431230f2319215c4 | 1 | static int do_req(int sockfd, AioContext *aio_context, SheepdogReq *hdr,
void *data, unsigned int *wlen, unsigned int *rlen)
{
Coroutine *co;
SheepdogReqCo srco = {
.sockfd = sockfd,
.aio_context = aio_context,
.hdr = hdr,
.data = data,
.wlen = ... | 13,231 |
qemu | 9b2fadda3e0196ffd485adde4fe9cdd6fae35300 | 1 | static void gen_mtsrin(DisasContext *ctx)
{
#if defined(CONFIG_USER_ONLY)
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);
#else
TCGv t0;
if (unlikely(ctx->pr)) {
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);
return;
}
t0 = tcg_temp_new();
tcg_gen_shri_tl(t0, cpu_gp... | 13,232 |
qemu | f7c40aa1e7feb50bc4d4bc171fa811bdd9a93e51 | 1 | void s390_pci_iommu_enable(S390PCIBusDevice *pbdev)
{
uint64_t size = pbdev->pal - pbdev->pba + 1;
memory_region_init_iommu(&pbdev->iommu_mr, OBJECT(&pbdev->mr),
&s390_iommu_ops, "iommu-s390", size);
memory_region_add_subregion(&pbdev->mr, pbdev->pba, &pbdev->iommu_mr);
... | 13,233 |
qemu | 2fd5d864099dd38b43b595e9e3375dad2f76049b | 1 | strdup(str)
const char *str;
{
char *bptr;
bptr = (char *)malloc(strlen(str)+1);
strcpy(bptr, str);
return bptr;
}
| 13,234 |
qemu | 9b2fadda3e0196ffd485adde4fe9cdd6fae35300 | 1 | static void gen_tlbli_6xx(DisasContext *ctx)
{
#if defined(CONFIG_USER_ONLY)
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);
#else
if (unlikely(ctx->pr)) {
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);
return;
}
gen_helper_6xx_tlbi(cpu_env, cpu_gpr[rB(ctx->opcode)]);
#endif... | 13,235 |
qemu | d510c5cf343eabd4d3a301f5730af724747b7055 | 1 | QemuOpts *qemu_opts_parse(QemuOptsList *list, const char *params,
int permit_abbrev)
{
const char *firstname;
char value[1024], *id = NULL;
const char *p;
QemuOpts *opts;
assert(!permit_abbrev || list->implied_opt_name);
firstname = permit_abbrev ? list->impli... | 13,237 |
qemu | 6f2d8978728c48ca46f5c01835438508aace5c64 | 1 | static always_inline int get_segment (CPUState *env, mmu_ctx_t *ctx,
target_ulong eaddr, int rw, int type)
{
target_phys_addr_t sdr, hash, mask, sdr_mask, htab_mask;
target_ulong sr, vsid, vsid_mask, pgidx, page_mask;
#if defined(TARGET_PPC64)
int attr;
#endif
... | 13,238 |
FFmpeg | 5a4eb6aa275e4c1b80e1e125a7901903e35219f2 | 1 | AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_frame(const AVFrame *frame,
int perms)
{
AVFilterBufferRef *samplesref =
avfilter_get_audio_buffer_ref_from_arrays((uint8_t **)frame->data, frame->linesize[0], perms,
... | 13,239 |
FFmpeg | 65e0a7c473f23f1833538ffecf53c81fe500b5e4 | 1 | int ff_wmv2_decode_secondary_picture_header(MpegEncContext *s)
{
Wmv2Context *const w = (Wmv2Context *) s;
if (s->pict_type == AV_PICTURE_TYPE_I) {
if (w->j_type_bit)
w->j_type = get_bits1(&s->gb);
else
w->j_type = 0; // FIXME check
if (!w->j_type) {
... | 13,240 |
FFmpeg | bfa0f96586fe2c257cfa574ffb991da493a54da1 | 1 | static void vp8_decode_flush_impl(AVCodecContext *avctx, int force, int is_close)
{
VP8Context *s = avctx->priv_data;
int i;
if (!avctx->is_copy || force) {
for (i = 0; i < 5; i++)
if (s->frames[i].data[0])
vp8_release_frame(s, &s->frames[i], is_close);
}
... | 13,241 |
qemu | ab51b1d568e02c80b1abf9016bda3a86dc1db389 | 1 | static CharDriverState *qemu_chr_open_stdio(QemuOpts *opts)
{
CharDriverState *chr;
if (stdio_nb_clients >= STDIO_MAX_CLIENTS) {
if (stdio_nb_clients == 0) {
old_fd0_flags = fcntl(0, F_GETFL);
tcgetattr (0, &oldtty);
fcntl(0, F_SETFL, O_NONBLOCK);
atexit(term_... | 13,242 |
FFmpeg | c31b81216619e6b3d986ce63c82357993e10e8e9 | 1 | static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size)
{
LclContext * const c = (LclContext *)avctx->priv_data;
unsigned char *encoded = (unsigned char *)buf;
int pixel_ptr;
int row, col;
unsigned char *outptr;
unsigned int width = avctx->width; /... | 13,243 |
qemu | 1eb3fc0a0b61b5d22adee2a9add3162a6c03a47e | 1 | static int ram_save_host_page(RAMState *rs, PageSearchStatus *pss,
bool last_stage)
{
int tmppages, pages = 0;
size_t pagesize_bits =
qemu_ram_pagesize(pss->block) >> TARGET_PAGE_BITS;
do {
tmppages = ram_save_target_page(rs, pss, last_stage);
... | 13,244 |
qemu | 60fe637bf0e4d7989e21e50f52526444765c63b4 | 1 | static int qemu_rdma_exchange_recv(RDMAContext *rdma, RDMAControlHeader *head,
int expecting)
{
RDMAControlHeader ready = {
.len = 0,
.type = RDMA_CONTROL_READY,
.repeat = 1,
... | 13,245 |
qemu | 48f4ba671bbb3dd212002d57b72a23375f51619b | 1 | static int qxl_track_command(PCIQXLDevice *qxl, struct QXLCommandExt *ext)
{
switch (le32_to_cpu(ext->cmd.type)) {
case QXL_CMD_SURFACE:
{
QXLSurfaceCmd *cmd = qxl_phys2virt(qxl, ext->cmd.data, ext->group_id);
if (!cmd) {
uint32_t id = le32_to_cpu(cmd->surface_id);
... | 13,246 |
qemu | 40ff6d7e8dceca227e7f8a3e8e0d58b2c66d19b4 | 1 | int tcp_fconnect(struct socket *so)
{
Slirp *slirp = so->slirp;
int ret=0;
DEBUG_CALL("tcp_fconnect");
DEBUG_ARG("so = %lx", (long )so);
if( (ret=so->s=socket(AF_INET,SOCK_STREAM,0)) >= 0) {
int opt, s=so->s;
struct sockaddr_in addr;
fd_nonblock(s);
opt = 1;
setsockopt(s,S... | 13,247 |
qemu | 42d43d35d907579179a39c924d169da924786f65 | 1 | static void cloop_close(BlockDriverState *bs)
{
BDRVCloopState *s = bs->opaque;
if (s->n_blocks > 0) {
g_free(s->offsets);
}
g_free(s->compressed_block);
g_free(s->uncompressed_block);
inflateEnd(&s->zstream);
}
| 13,249 |
FFmpeg | c16e99e3b3c02edcf33245468731d414eab97dac | 0 | PROTO4(_pack_2ch_)
PROTO4(_pack_6ch_)
PROTO4(_pack_8ch_)
PROTO4(_unpack_2ch_)
PROTO4(_unpack_6ch_)
av_cold void swri_audio_convert_init_x86(struct AudioConvert *ac,
enum AVSampleFormat out_fmt,
enum AVSampleFormat in_fmt,
... | 13,251 |
FFmpeg | fd542b6f2026f1aa163882ee0283958598a97c31 | 0 | int ff_unlock_avcodec(const AVCodec *codec)
{
_Bool exp = 1;
if (codec->caps_internal & FF_CODEC_CAP_INIT_THREADSAFE || !codec->init)
return 0;
av_assert0(atomic_compare_exchange_strong(&ff_avcodec_locked, &exp, 0));
atomic_fetch_add(&entangled_thread_counter, -1);
if (lockmgr_cb) {... | 13,252 |
FFmpeg | 25a6666f6c07c6ac8449a63d7fbce0dfd29c54cd | 0 | static int ivi_decode_coded_blocks(GetBitContext *gb, IVIBandDesc *band,
ivi_mc_func mc, int mv_x, int mv_y,
int *prev_dc, int is_intra, int mc_type,
uint32_t quant, int offs,
... | 13,253 |
qemu | b72981b910097b31f4d0b9c111a2d2cfd9ee585b | 1 | static void continue_send(IPMIBmcExtern *ibe)
{
if (ibe->outlen == 0) {
goto check_reset;
}
send:
ibe->outpos += qemu_chr_fe_write(ibe->chr, ibe->outbuf + ibe->outpos,
ibe->outlen - ibe->outpos);
if (ibe->outpos < ibe->outlen) {
/* Not fully... | 13,254 |
qemu | 8be487d8f184f2f721cabeac559fb7a6cba18c95 | 1 | static void sdhci_do_adma(SDHCIState *s)
{
unsigned int n, begin, length;
const uint16_t block_size = s->blksize & 0x0fff;
ADMADescr dscr;
int i;
for (i = 0; i < SDHC_ADMA_DESCS_PER_DELAY; ++i) {
s->admaerr &= ~SDHC_ADMAERR_LENGTH_MISMATCH;
get_adma_description(s, &dscr);... | 13,255 |
qemu | aef4acb6616ab7fb5c105660aa8a2cee4e250e75 | 1 | static int copy_sectors(BlockDriverState *bs, uint64_t start_sect,
uint64_t cluster_offset, int n_start, int n_end)
{
BDRVQcowState *s = bs->opaque;
int n, ret;
void *buf;
/*
* If this is the last cluster and it is only partially used, we must only
* copy unti... | 13,256 |
qemu | 3b39d734141a71296d08af3d4c32f872fafd782e | 1 | void arm_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr,
vaddr addr, unsigned size,
MMUAccessType access_type,
int mmu_idx, MemTxAttrs attrs,
MemTxResult response, uin... | 13,257 |
FFmpeg | 2240e2078d53d3cfce8ff1dda64e58fa72038602 | 1 | static int truemotion1_decode_header(TrueMotion1Context *s)
{
int i, ret;
int width_shift = 0;
int new_pix_fmt;
struct frame_header header;
uint8_t header_buffer[128] = { 0 }; /* logical maximum size of the header */
const uint8_t *sel_vector_table;
header.header_size = ((s->buf[0] >> 5) | ... | 13,258 |
FFmpeg | 4de4308d2aa3bfaa286ab566caf087d523cf9a85 | 1 | static av_always_inline void RENAME(decode_line)(FFV1Context *s, int w,
TYPE *sample[2],
int plane_index, int bits)
{
PlaneContext *const p = &s->plane[plane_index];
RangeCoder *const c = &s->c;
int x;
... | 13,259 |
qemu | 5b7d7dfd198f06ec5edd0c857291c5035c5c060f | 1 | static int bochs_open(BlockDriverState *bs, int flags)
{
BDRVBochsState *s = bs->opaque;
int i;
struct bochs_header bochs;
struct bochs_header_v1 header_v1;
bs->read_only = 1; // no write support yet
if (bdrv_pread(bs->file, 0, &bochs, sizeof(bochs)) != sizeof(bochs)) {
goto ... | 13,260 |
qemu | 868d585aced5457218b3443398d08594d9c3ba6d | 1 | static void set_alarm (m48t59_t *NVRAM, struct tm *tm)
{
NVRAM->alarm = mktime(tm);
if (NVRAM->alrm_timer != NULL) {
qemu_del_timer(NVRAM->alrm_timer);
NVRAM->alrm_timer = NULL;
}
if (NVRAM->alarm - time(NULL) > 0)
qemu_mod_timer(NVRAM->alrm_timer, NVRAM->alarm * 1000);
}
| 13,261 |
qemu | bf8d492405feaee2c1685b3b9d5e03228ed3e47f | 1 | static void i440fx_pcihost_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
PCIHostBridgeClass *hc = PCI_HOST_BRIDGE_CLASS(klass);
hc->root_bus_path = i440fx_pcihost_root_bus_path;
dc->realize = i440fx_pcihost_realize;
dc->fw_name = "pci";
dc->props = ... | 13,262 |
FFmpeg | 636ced8e1dc8248a1353b416240b93d70ad03edb | 1 | static void init_parse_context(OptionParseContext *octx,
const OptionGroupDef *groups, int nb_groups)
{
static const OptionGroupDef global_group = { "global" };
int i;
memset(octx, 0, sizeof(*octx));
octx->nb_groups = nb_groups;
octx->groups = av_mallocz(... | 13,263 |
FFmpeg | 9afb7061f938831248942050cfdb449e014ed427 | 1 | int ff_mov_read_chan(AVFormatContext *s, AVStream *st, int64_t size)
{
AVIOContext *pb = s->pb;
uint32_t layout_tag, bitmap, num_descr, label_mask;
int i;
if (size < 12)
return AVERROR_INVALIDDATA;
layout_tag = avio_rb32(pb);
bitmap = avio_rb32(pb);
num_descr = avio... | 13,264 |
qemu | e5bfd64050e81774b6bf71ab5dd064f7bcef0c4c | 1 | void microblaze_load_kernel(MicroBlazeCPU *cpu, hwaddr ddr_base,
uint32_t ramsize,
const char *initrd_filename,
const char *dtb_filename,
void (*machine_cpu_reset)(MicroBlazeCPU *))
{
QemuOpts *mach... | 13,265 |
qemu | 92e926e1e37aea7e1632535b6611ed4f62414af1 | 1 | static int kvm_ppc_register_host_cpu_type(void)
{
TypeInfo type_info = {
.name = TYPE_HOST_POWERPC_CPU,
.class_init = kvmppc_host_cpu_class_init,
};
PowerPCCPUClass *pvr_pcc;
DeviceClass *dc;
int i;
pvr_pcc = kvm_ppc_get_host_cpu_class();
if (pvr_pcc == NULL) {
... | 13,266 |
FFmpeg | bd0739804640939fea4fb6f1f625b82432d46947 | 1 | static int av_encode(AVFormatContext **output_files,
int nb_output_files,
AVFormatContext **input_files,
int nb_input_files,
AVStreamMap *stream_maps, int nb_stream_maps)
{
int ret, i, j, k, n, nb_istreams = 0, nb_ostreams = 0, pts_... | 13,267 |
FFmpeg | d62030ffcaf14dd801918fe26e670d68fdc21984 | 1 | static void RENAME(mix8to2)(SAMPLE **out, const SAMPLE **in, COEFF *coeffp, integer len){
int i;
for(i=0; i<len; i++) {
INTER t = in[2][i]*coeffp[0*8+2] + in[3][i]*coeffp[0*8+3];
out[0][i] = R(t + in[0][i]*(INTER)coeffp[0*8+0] + in[4][i]*(INTER)coeffp[0*8+4] + in[6][i]*(INTER)coeffp[0*8+6]... | 13,269 |
qemu | 27ef9cb0e77eda46618ea084adffa63ebde5be80 | 1 | static CharDriverState *qemu_chr_open_pp_fd(int fd,
ChardevCommon *backend,
Error **errp)
{
CharDriverState *chr;
ParallelCharDriver *drv;
if (ioctl(fd, PPCLAIM) < 0) {
error_setg_errno(errp, errno, "not... | 13,271 |
qemu | 069d89b8a8dc5a9af4733bca14763b45bbb2546f | 1 | static void pprint_data(V9fsPDU *pdu, int rx, size_t *offsetp, const char *name)
{
struct iovec *sg = get_sg(pdu, rx);
size_t offset = *offsetp;
unsigned int count;
int32_t size;
int total, i, j;
ssize_t len;
if (rx) {
count = pdu->elem.in_num;
} else
count =... | 13,272 |
FFmpeg | 50833c9f7b4e1922197a8955669f8ab3589c8cef | 1 | static void put_audio_specific_config(AVCodecContext *avctx)
{
PutBitContext pb;
AACEncContext *s = avctx->priv_data;
init_put_bits(&pb, avctx->extradata, avctx->extradata_size*8);
put_bits(&pb, 5, 2); //object type - AAC-LC
put_bits(&pb, 4, s->samplerate_index); //sample rate index
put... | 13,274 |
qemu | 1e9b65bb1bad51735cab6c861c29b592dccabf0e | 1 | static void error_setv(Error **errp, ErrorClass err_class,
const char *fmt, va_list ap)
{
Error *err;
int saved_errno = errno;
if (errp == NULL) {
return;
}
assert(*errp == NULL);
err = g_malloc0(sizeof(*err));
err->msg = g_strdup_vprintf(fmt, ap)... | 13,275 |
qemu | b25f23e7dbc6bc0dcda010222a4f178669d1aedc | 1 | static QObject *qdict_get_obj(const QDict *qdict, const char *key, QType type)
{
QObject *obj;
obj = qdict_get(qdict, key);
assert(obj != NULL);
assert(qobject_type(obj) == type);
return obj;
}
| 13,276 |
FFmpeg | 220b24c7c97dc033ceab1510549f66d0e7b52ef1 | 1 | static av_cold int libschroedinger_encode_init(AVCodecContext *avctx)
{
SchroEncoderParams *p_schro_params = avctx->priv_data;
SchroVideoFormatEnum preset;
/* Initialize the libraries that libschroedinger depends on. */
schro_init();
/* Create an encoder object. */
p_schro_params->enc... | 13,277 |
FFmpeg | 02d6d053396626ff5b3390e48a9933e0d4164b28 | 1 | static int dca_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
int channel_mask;
int channel_layout;
int lfe_samples;
int num_core_channels = 0;
int i, re... | 13,279 |
FFmpeg | 9c2216976907336dfae0e8e38a4d70ca2465a92c | 1 | static int tiff_unpack_strip(TiffContext *s, uint8_t *dst, int stride,
const uint8_t *src, int size, int lines)
{
int c, line, pixels, code, ret;
const uint8_t *ssrc = src;
int width = ((s->width * s->bpp) + 7) >> 3;
if (size <= 0)
return AVERROR_I... | 13,280 |
FFmpeg | e7d4a2a721ae863488f6a3814f9dcdbc6e8f5166 | 1 | AVBitStreamFilterContext *av_bitstream_filter_init(const char *name){
AVBitStreamFilter *bsf= first_bitstream_filter;
while(bsf){
if(!strcmp(name, bsf->name)){
AVBitStreamFilterContext *bsfc= av_mallocz(sizeof(AVBitStreamFilterContext));
bsfc->filter= bsf;
bsf... | 13,281 |
FFmpeg | 1181d93231e9b807965724587d363c1cfd5a1d0d | 0 | void ff_avg_h264_qpel8_mc22_msa(uint8_t *dst, const uint8_t *src,
ptrdiff_t stride)
{
avc_luma_mid_and_aver_dst_8w_msa(src - (2 * stride) - 2,
stride, dst, stride, 8);
}
| 13,283 |
FFmpeg | 0058584580b87feb47898e60e4b80c7f425882ad | 0 | static int ac3_decode_init(AVCodecContext *avctx)
{
AC3DecodeContext *ctx = avctx->priv_data;
ac3_common_init();
ff_mdct_init(&ctx->imdct_ctx_256, 8, 1);
ff_mdct_init(&ctx->imdct_ctx_512, 9, 1);
ctx->samples = av_mallocz(6 * 256 * sizeof (float));
if (!ctx->samples) {
av_log(... | 13,284 |
FFmpeg | d6604b29ef544793479d7fb4e05ef6622bb3e534 | 0 | static av_cold int flashsv_encode_init(AVCodecContext *avctx)
{
FlashSVContext *s = avctx->priv_data;
s->avctx = avctx;
if (avctx->width > 4095 || avctx->height > 4095) {
av_log(avctx, AV_LOG_ERROR,
"Input dimensions too large, input must be max 4096x4096 !\n");
ret... | 13,285 |
FFmpeg | 03037a4aad8b92c00ef2f115605ad20fc4410fe5 | 0 | static int subtitle_thread(void *arg)
{
VideoState *is = arg;
Frame *sp;
int got_subtitle;
double pts;
int i;
for (;;) {
if (!(sp = frame_queue_peek_writable(&is->subpq)))
return 0;
if ((got_subtitle = decoder_decode_frame(&is->subdec, NULL, &sp->sub)) <... | 13,286 |
FFmpeg | 57835fc1aeaf0b3bbc0816b123a931ea39de758b | 0 | static int vb_decode_framedata(VBDecContext *c, const uint8_t *buf, int offset)
{
uint8_t *prev, *cur;
int blk, blocks, t, blk2;
int blocktypes = 0;
int x, y, a, b;
int pattype, pattern;
const int width = c->avctx->width;
uint8_t *pstart = c->prev_frame;
uint8_t *pend = c->prev_... | 13,287 |
FFmpeg | 5e53486545726987ab4482321d4dcf7e23e7652f | 0 | static void pre_calc_cosmod(DCAContext * s)
{
int i, j, k;
static int cosmod_inited = 0;
if(cosmod_inited) return;
for (j = 0, k = 0; k < 16; k++)
for (i = 0; i < 16; i++)
cos_mod[j++] = cos((2 * i + 1) * (2 * k + 1) * M_PI / 64);
for (k = 0; k < 16; k++)
for... | 13,288 |
FFmpeg | d04fdff1617dd2bc1e24b940b6ed590d3188522b | 0 | static int RENAME(dct_quantize)(MpegEncContext *s,
DCTELEM *block, int n,
int qscale, int *overflow)
{
int level=0, last_non_zero_p1, q; //=0 is cuz gcc says uninitalized ...
const uint16_t *qmat, *bias;
static __align8 int16_t temp_block[64];
... | 13,289 |
FFmpeg | c23acbaed40101c677dfcfbbfe0d2c230a8e8f44 | 1 | void ff_put_pixels_clamped_c(const DCTELEM *block, uint8_t *restrict pixels,
int line_size)
{
int i;
uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
/* read the pixels */
for(i=0;i<8;i++) {
pixels[0] = cm[block[0]];
pixels[1] = cm[block[1]];
pixel... | 13,290 |
FFmpeg | b8659d94b76c9b90c0aff3c5c01bfd2be6324e93 | 1 | int has_altivec(void)
{
#ifdef __AMIGAOS4__
ULONG result = 0;
extern struct ExecIFace *IExec;
IExec->GetCPUInfoTags(GCIT_VectorUnit, &result, TAG_DONE);
if (result == VECTORTYPE_ALTIVEC) return 1;
#elif __APPLE__
int sels[2] = {CTL_HW, HW_VECTORUNIT};
int has_vu = 0;
size_t len ... | 13,292 |
FFmpeg | 889afca369ef3a939c68592ef2b1a1756667ce21 | 1 | static int aac_adtstoasc_filter(AVBitStreamFilterContext *bsfc,
AVCodecContext *avctx, const char *args,
uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size,
int k... | 13,294 |
FFmpeg | 09302a897d1990b1338f049fcd29638d736b8823 | 1 | static int tgv_decode_inter(TgvContext * s, const uint8_t *buf, const uint8_t *buf_end){
unsigned char *frame0_end = s->last_frame.data[0] + s->avctx->width*s->last_frame.linesize[0];
int num_mvs;
int num_blocks_raw;
int num_blocks_packed;
int vector_bits;
int i,j,x,y;
GetBitContext g... | 13,295 |
qemu | 6516367fc0803d079384e0ad370856ac328bef30 | 1 | static void generic_loader_realize(DeviceState *dev, Error **errp)
{
GenericLoaderState *s = GENERIC_LOADER(dev);
hwaddr entry;
int big_endian;
int size = 0;
s->set_pc = false;
/* Perform some error checking on the user's options */
if (s->data || s->data_len || s->data_be) {
... | 13,296 |
FFmpeg | d1adad3cca407f493c3637e20ecd4f7124e69212 | 0 | static inline void RENAME(nvXXtoUV)(uint8_t *dst1, uint8_t *dst2,
const uint8_t *src, long width)
{
#if COMPILE_TEMPLATE_MMX
__asm__ volatile(
"movq "MANGLE(bm01010101)", %%mm4 \n\t"
"mov %0, %%"REG_a" \n\t"
"1: ... | 13,297 |
FFmpeg | 5e53486545726987ab4482321d4dcf7e23e7652f | 0 | static int mpc7_decode_init(AVCodecContext * avctx)
{
int i, j;
MPCContext *c = avctx->priv_data;
GetBitContext gb;
uint8_t buf[16];
static int vlc_inited = 0;
if(avctx->extradata_size < 16){
av_log(avctx, AV_LOG_ERROR, "Too small extradata size (%i)!\n", avctx->extradata_size)... | 13,298 |
FFmpeg | 28f9ab7029bd1a02f659995919f899f84ee7361b | 0 | void ff_vp3_idct_altivec(DCTELEM block[64])
{
IDCT_START
IDCT_1D(NOP, NOP)
TRANSPOSE8(b0, b1, b2, b3, b4, b5, b6, b7);
IDCT_1D(ADD8, SHIFT4)
vec_st(b0, 0x00, block);
vec_st(b1, 0x10, block);
vec_st(b2, 0x20, block);
vec_st(b3, 0x30, block);
vec_st(b4, 0x40, block);
... | 13,299 |
FFmpeg | 2d015d3bf9fed59c65a3819a35fedbb8b7dde623 | 0 | static int mov_read_ctts(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
AVStream *st;
MOVStreamContext *sc;
unsigned int i, j, entries, ctts_count = 0;
if (c->fc->nb_streams < 1)
return 0;
st = c->fc->streams[c->fc->nb_streams-1];
sc = st->priv_data;
avio_r8(pb); /* ver... | 13,300 |
qemu | 9b2fadda3e0196ffd485adde4fe9cdd6fae35300 | 1 | static void gen_mfsrin(DisasContext *ctx)
{
#if defined(CONFIG_USER_ONLY)
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);
#else
TCGv t0;
if (unlikely(ctx->pr)) {
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);
return;
}
t0 = tcg_temp_new();
tcg_gen_shri_tl(t0, cpu_gp... | 13,301 |
qemu | 79761c6681f0d1cc1c027116fcb4382d41ed3ece | 1 | void qemu_sem_wait(QemuSemaphore *sem)
{
#if defined(__APPLE__) || defined(__NetBSD__)
pthread_mutex_lock(&sem->lock);
--sem->count;
while (sem->count < 0) {
pthread_cond_wait(&sem->cond, &sem->lock);
}
pthread_mutex_unlock(&sem->lock);
#else
int rc;
do {
rc = s... | 13,304 |
FFmpeg | c5f4c0fd5c791ba97eb266cc30ae2172c10feb20 | 0 | static void ff_id3v2_parse(AVFormatContext *s, int len, uint8_t version, uint8_t flags)
{
int isv34, tlen, unsync;
char tag[5];
int64_t next, end = avio_tell(s->pb) + len;
int taghdrlen;
const char *reason = NULL;
AVIOContext pb;
unsigned char *buffer = NULL;
int buffer_size = 0... | 13,305 |
FFmpeg | 6e42e6c4b410dbef8b593c2d796a5dad95f89ee4 | 1 | void palette8torgb24(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette)
{
long i;
/*
writes 1 byte o much and might cause alignment issues on some architectures?
for(i=0; i<num_pixels; i++)
((unsigned *)(&dst[i*3])) = ((unsigned *)palette)[ src[i] ];
*/
for(i=0; i<num_pixels; i++)
... | 13,306 |
qemu | c485cf9c9277ca9b3d5227c99a13c374e812f42b | 1 | static int m25p80_init(SSISlave *ss)
{
DriveInfo *dinfo;
Flash *s = M25P80(ss);
M25P80Class *mc = M25P80_GET_CLASS(s);
s->pi = mc->pi;
s->size = s->pi->sector_size * s->pi->n_sectors;
s->dirty_page = -1;
s->storage = blk_blockalign(s->blk, s->size);
/* FIXME use a qdev dri... | 13,308 |
qemu | a15fcc3cf69ee3d408f60d6cc316488d2b0249b4 | 1 | void visit_start_list(Visitor *v, const char *name, GenericList **list,
size_t size, Error **errp)
{
Error *err = NULL;
assert(!list || size >= sizeof(GenericList));
v->start_list(v, name, list, size, &err);
if (list && v->type == VISITOR_INPUT) {
assert(!(err && *... | 13,309 |
qemu | 403e633126b7a781ecd48a29e3355770d46bbf1a | 1 | static unsigned __stdcall win32_start_routine(void *arg)
{
struct QemuThreadData data = *(struct QemuThreadData *) arg;
QemuThread *thread = data.thread;
free(arg);
TlsSetValue(qemu_thread_tls_index, thread);
/*
* Use DuplicateHandle instead of assigning thread->thread in the
*... | 13,310 |
FFmpeg | 6a63ff19b6a7fe3bc32c7fb4a62fca8f65786432 | 0 | static int mov_read_stss(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
{
AVStream *st = c->fc->streams[c->fc->nb_streams-1];
MOVStreamContext *sc = st->priv_data;
unsigned int i, entries;
get_byte(pb); /* version */
get_be24(pb); /* flags */
entries = get_be32(pb);
dprintf(c-... | 13,312 |
FFmpeg | 6e0723470bea258ceb72ee4c4916cf8f80337f92 | 1 | static float pvq_band_cost(CeltPVQ *pvq, CeltFrame *f, OpusRangeCoder *rc, int band,
float *bits, float lambda)
{
int i, b = 0;
uint32_t cm[2] = { (1 << f->blocks) - 1, (1 << f->blocks) - 1 };
const int band_size = ff_celt_freq_range[band] << f->size;
float buf[176 * 2],... | 13,313 |
FFmpeg | c7b08bc0a71f9e54e0d5036a8195648b41bd3933 | 1 | static int r3d_seek(AVFormatContext *s, int stream_index, int64_t sample_time, int flags)
{
AVStream *st = s->streams[0]; // video stream
R3DContext *r3d = s->priv_data;
int frame_num;
if (!st->codec->time_base.num || !st->time_base.den)
return -1;
frame_num = sample_time*st->code... | 13,314 |
qemu | e23a1b33b53d25510320b26d9f154e19c6c99725 | 1 | m48t59_t *m48t59_init (qemu_irq IRQ, target_phys_addr_t mem_base,
uint32_t io_base, uint16_t size,
int type)
{
DeviceState *dev;
SysBusDevice *s;
M48t59SysBusState *d;
dev = qdev_create(NULL, "m48t59");
qdev_prop_set_uint32(dev, "type", type);
... | 13,315 |
FFmpeg | c871244306f92fecaaed8a97f47ba54d46eb0cd5 | 1 | static int decode_frame_header(ProresContext *ctx, const uint8_t *buf,
const int data_size, AVCodecContext *avctx)
{
int hdr_size, width, height, flags;
int version;
const uint8_t *ptr;
hdr_size = AV_RB16(buf);
av_dlog(avctx, "header size %d\n", hdr_size);
... | 13,317 |
FFmpeg | 0b54f3c0878a3acaa9142e4f24942e762d97e350 | 1 | static inline int GetCode(GifState * s)
{
int c, sizbuf;
uint8_t *ptr;
while (s->bbits < s->cursize) {
ptr = s->pbuf;
if (ptr >= s->ebuf) {
if (!s->eob_reached) {
sizbuf = get_byte(s->f);
s->ebuf = s->buf + sizbuf;
s->pb... | 13,318 |
FFmpeg | 1ac5abb1d062b6ca983d494068bb9fd30390a941 | 1 | static void filter(SPPContext *p, uint8_t *dst, uint8_t *src,
int dst_linesize, int src_linesize, int width, int height,
const uint8_t *qp_table, int qp_stride, int is_luma, int sample_bytes)
{
int x, y, i;
const int count = 1 << p->log2_count;
const int linesize ... | 13,319 |
FFmpeg | bfa0f96586fe2c257cfa574ffb991da493a54da1 | 1 | static int vp8_alloc_frame(VP8Context *s, AVFrame *f)
{
int ret;
if ((ret = ff_thread_get_buffer(s->avctx, f)) < 0)
return ret;
if (!s->maps_are_invalid && s->num_maps_to_be_freed) {
f->ref_index[0] = s->segmentation_maps[--s->num_maps_to_be_freed];
} else if (!(f->ref_index[0] = ... | 13,320 |
FFmpeg | 99a520000d376d60cd30fae97bfaaf13d50ee26c | 1 | static int64_t read_ts(const char *s)
{
int hh, mm, ss, ms;
if (sscanf(s, "%u:%u:%u.%u", &hh, &mm, &ss, &ms) == 4) return (hh*3600 + mm*60 + ss) * 1000 + ms;
if (sscanf(s, "%u:%u.%u", &mm, &ss, &ms) == 3) return ( mm*60 + ss) * 1000 + ms;
return AV_NOPTS_VALUE;
}
| 13,321 |
qemu | 049a9f7b946fe1d3ff97127f8905881dbb78cb00 | 1 | static void i82374_init(I82374State *s)
{
DMA_init(1, NULL);
memset(s->commands, 0, sizeof(s->commands));
}
| 13,322 |
qemu | 17268d54be2e15b0d8ccfc4102bc48c84299b027 | 1 | static void qxl_destroy_primary(PCIQXLDevice *d)
{
if (d->mode == QXL_MODE_UNDEFINED) {
return;
}
dprint(d, 1, "%s\n", __FUNCTION__);
d->mode = QXL_MODE_UNDEFINED;
d->ssd.worker->destroy_primary_surface(d->ssd.worker, 0);
} | 13,323 |
qemu | e23a1b33b53d25510320b26d9f154e19c6c99725 | 1 | void isa_ne2000_init(int base, int irq, NICInfo *nd)
{
ISADevice *dev;
qemu_check_nic_model(nd, "ne2k_isa");
dev = isa_create("ne2k_isa");
dev->qdev.nd = nd; /* hack alert */
qdev_prop_set_uint32(&dev->qdev, "iobase", base);
qdev_prop_set_uint32(&dev->qdev, "irq", irq);
qdev_i... | 13,325 |
FFmpeg | 2d15588124ab1d4c0612cab66f02a716f1509211 | 1 | static int allocate_buffers(ShortenContext *s)
{
int i, chan, err;
for (chan = 0; chan < s->channels; chan++) {
if (FFMAX(1, s->nmean) >= UINT_MAX / sizeof(int32_t)) {
av_log(s->avctx, AV_LOG_ERROR, "nmean too large\n");
return AVERROR_INVALIDDATA;
}
if ... | 13,326 |
FFmpeg | 3ab9a2a5577d445252724af4067d2a7c8a378efa | 1 | static av_always_inline int rv40_loop_filter_strength(uint8_t *src,
int step, int stride,
int beta, int beta2,
int edge,
... | 13,327 |
FFmpeg | 32be264cea542b4dc721b10092bf1dfe511a28ee | 1 | static void encode_window_bands_info(AACEncContext *s, SingleChannelElement *sce,
int win, int group_len, const float lambda)
{
BandCodingPath path[120][CB_TOT_ALL];
int w, swb, cb, start, size;
int i, j;
const int max_sfb = sce->ics.max_sfb;
const int ru... | 13,328 |
FFmpeg | 773eb74babe07bc5c97c32aa564efc40e2d4b00c | 1 | callback(void *priv_data, int index, uint8_t *buf, int buf_size, int64_t time)
{
AVFormatContext *s = priv_data;
struct dshow_ctx *ctx = s->priv_data;
AVPacketList **ppktl, *pktl_next;
// dump_videohdr(s, vdhdr);
WaitForSingleObject(ctx->mutex, INFINITE);
if(shall_we_drop(s, index))
... | 13,329 |
qemu | 089da572b956ef0f8f5b8d5917358e07892a77c2 | 1 | void fw_cfg_add_string(FWCfgState *s, uint16_t key, const char *value)
{
size_t sz = strlen(value) + 1;
return fw_cfg_add_bytes(s, key, (uint8_t *)g_memdup(value, sz), sz);
}
| 13,330 |
qemu | 4da97120d51a4383aa96d741a2b837f8c4bbcd0b | 1 | static void ide_flush_cache(IDEState *s)
{
if (s->blk == NULL) {
ide_flush_cb(s, 0);
return;
}
s->status |= BUSY_STAT;
ide_set_retry(s);
block_acct_start(blk_get_stats(s->blk), &s->acct, 0, BLOCK_ACCT_FLUSH);
s->pio_aiocb = blk_aio_flush(s->blk, ide_flush_cb, s);
}
| 13,331 |
qemu | 2aae2b8e0abd58e76d616bcbe93c6966d06d0188 | 1 | void helper_st_asi(target_ulong addr, target_ulong val, int asi, int size)
{
#ifdef DEBUG_ASI
dump_asi("write", addr, asi, size, val);
#endif
asi &= 0xff;
if ((asi < 0x80 && (env->pstate & PS_PRIV) == 0)
|| ((env->def->features & CPU_FEATURE_HYPV)
&& asi >= 0x30 && asi < 0x80... | 13,332 |
FFmpeg | 55188278169c3a1838334d7aa47a1f7a40741690 | 1 | static int xan_decode_frame_type0(AVCodecContext *avctx, AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
XanContext *s = avctx->priv_data;
uint8_t *ybuf, *prev_buf, *src = s->scratch_buffer;
unsigned chroma_off, corr_off;
int cur, last, size;
int i, j;
int ret;
corr_off ... | 13,333 |
qemu | 2209401fa73e176ed093167b8f60aba797f25d49 | 1 | static void set_chr(Object *obj, Visitor *v, const char *name, void *opaque,
Error **errp)
{
DeviceState *dev = DEVICE(obj);
Error *local_err = NULL;
Property *prop = opaque;
CharBackend *be = qdev_get_prop_ptr(dev, prop);
CharDriverState *s;
char *str;
if (dev... | 13,335 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.