label
int64
0
1
func1
stringlengths
23
97k
id
int64
0
27.3k
0
static int init_file(AVFormatContext *s, OutputStream *os, int64_t start_ts) { int ret, i; ret = avio_open2(&os->out, os->temp_filename, AVIO_FLAG_WRITE, &s->interrupt_callback, NULL); if (ret < 0) return ret; avio_wb32(os->out, 0); avio_wl32(os->out, MKTAG('m','d','a','t')); for (i = 0; i < os->nb_extra_packets; i++) ...
12,219
0
static inline void log_input_change(void *ctx, AVFilterLink *link, AVFilterBufferRef *ref) { char old_layout_str[16], new_layout_str[16]; av_get_channel_layout_string(old_layout_str, sizeof(old_layout_str), -1, link->channel_layout); av_get_channel_layout_string(new_layout_str, sizeof(new_layout_str), -1, ref->audio->c...
12,220
1
static int decode_mime_header(AMRWBContext *ctx, const uint8_t *buf) { /* Decode frame header (1st octet) */ ctx->fr_cur_mode = buf[0] >> 3 & 0x0F; ctx->fr_quality = (buf[0] & 0x4) != 0x4; return 1; }
12,221
1
static void init_entropy_decoder(APEContext *ctx) { /* Read the CRC */ ctx->CRC = bytestream_get_be32(&ctx->ptr); /* Read the frame flags if they exist */ ctx->frameflags = 0; if ((ctx->fileversion > 3820) && (ctx->CRC & 0x80000000)) { ctx->CRC &= ~0x80000000; ctx->frameflags = bytestream_get_be32(&ctx->ptr); } /* Keep...
12,222
1
static gboolean qio_channel_yield_enter(QIOChannel *ioc, GIOCondition condition, gpointer opaque) { QIOChannelYieldData *data = opaque; qemu_coroutine_enter(data->co, NULL); return FALSE; }
12,223
1
void usb_ehci_realize(EHCIState *s, DeviceState *dev, Error **errp) { int i; if (s->portnr > NB_PORTS) { error_setg(errp, "Too many ports! Max. port number is %d.", NB_PORTS); usb_bus_new(&s->bus, sizeof(s->bus), s->companion_enable ? &ehci_bus_ops_companion : &ehci_bus_ops_standalone, dev); for (i = 0; i < s->portnr; ...
12,224
1
void qemu_system_guest_panicked(void) { qapi_event_send_guest_panicked(GUEST_PANIC_ACTION_PAUSE, &error_abort); vm_stop(RUN_STATE_GUEST_PANICKED);
12,226
1
static void get_sub_picture(CinepakEncContext *s, int x, int y, AVPicture *in, AVPicture *out) { out->data[0] = in->data[0] + x + y * in->linesize[0]; out->linesize[0] = in->linesize[0]; if(s->pix_fmt == AV_PIX_FMT_YUV420P) { out->data[1] = in->data[1] + (x >> 1) + (y >> 1) * in->linesize[1]; out->linesize[1] = in->lin...
12,227
1
int attribute_align_arg avcodec_open2(AVCodecContext *avctx, AVCodec *codec, AVDictionary **options) { int ret = 0; AVDictionary *tmp = NULL; if (avctx->extradata_size < 0 || avctx->extradata_size >= FF_MAX_EXTRADATA_SIZE) return AVERROR(EINVAL); if (options) av_dict_copy(&tmp, *options, 0); /* If there is a user-suppl...
12,228
1
static void cpu_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); CPUClass *k = CPU_CLASS(klass); k->class_by_name = cpu_common_class_by_name; k->reset = cpu_common_reset; k->get_arch_id = cpu_common_get_arch_id; k->get_paging_enabled = cpu_common_get_paging_enabled; k->get_memory_mapp...
12,229
1
static int fill_note_info(struct elf_note_info *info, long signr, const CPUArchState *env) { #define NUMNOTES 3 CPUState *cpu = ENV_GET_CPU((CPUArchState *)env); TaskState *ts = (TaskState *)cpu->opaque; int i; info->notes = g_malloc0(NUMNOTES * sizeof (struct memelfnote)); if (info->notes == NULL) return (-ENOMEM); in...
12,230
1
static uint16List **host_memory_append_node(uint16List **node, unsigned long value) { *node = g_malloc0(sizeof(**node)); (*node)->value = value; return &(*node)->next; }
12,232
1
static int e1000_post_load(void *opaque, int version_id) { E1000State *s = opaque; NetClientState *nc = qemu_get_queue(s->nic); /* nc.link_down can't be migrated, so infer link_down according * to link status bit in mac_reg[STATUS] */ nc->link_down = (s->mac_reg[STATUS] & E1000_STATUS_LU) == 0; return 0; }
12,233
1
bdrv_acct_start(BlockDriverState *bs, BlockAcctCookie *cookie, int64_t bytes, enum BlockAcctType type) { assert(type < BDRV_MAX_IOTYPE); cookie->bytes = bytes; cookie->start_time_ns = get_clock(); cookie->type = type; }
12,234
1
static int tcp_open(URLContext *h, const char *uri, int flags) { struct sockaddr_in dest_addr; int port, fd = -1; TCPContext *s = NULL; fd_set wfds; int fd_max, ret; struct timeval tv; socklen_t optlen; char hostname[1024],proto[1024],path[1024],tmp[1024],*q; if(!ff_network_init()) return AVERROR(EIO); url_split(proto,...
12,235
1
static av_always_inline int even(uint64_t layout) { return (!layout || (layout & (layout - 1))); }
12,236
1
static int xen_host_pci_get_value(XenHostPCIDevice *d, const char *name, unsigned int *pvalue, int base) { char path[PATH_MAX]; char buf[XEN_HOST_PCI_GET_VALUE_BUFFER_SIZE]; int fd, rc; unsigned long value; char *endptr; rc = xen_host_pci_sysfs_path(d, name, path, sizeof (path)); if (rc) { return rc; } fd = open(path, ...
12,237
1
static int64_t mkv_write_seekhead(AVIOContext *pb, mkv_seekhead *seekhead) { ebml_master metaseek, seekentry; int64_t currentpos; int i; currentpos = avio_tell(pb); if (seekhead->reserved_size > 0) if (avio_seek(pb, seekhead->filepos, SEEK_SET) < 0) return -1; metaseek = start_ebml_master(pb, MATROSKA_ID_SEEKHEAD, seek...
12,238
1
static int wavpack_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { WavpackContext *s = avctx->priv_data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; int frame_size; int samplecount = 0; s->block = 0; s->samples_left = 0; s->ch_offset = 0; if(s->mkv_mode){ s->samples ...
12,239
1
static int get_bits(J2kDecoderContext *s, int n) { int res = 0; if (s->buf_end - s->buf < ((n - s->bit_index) >> 8)) return AVERROR(EINVAL); while (--n >= 0){ res <<= 1; if (s->bit_index == 0){ s->bit_index = 7 + (*s->buf != 0xff); s->buf++; } s->bit_index--; res |= (*s->buf >> s->bit_index) & 1; } return res; }
12,240
1
static uint32_t drc_set_usable(sPAPRDRConnector *drc) { /* if there's no resource/device associated with the DRC, there's * no way for us to put it in an allocation state consistent with * being 'USABLE'. PAPR 2.7, 13.5.3.4 documents that this should * result in an RTAS return code of -3 / "no such indicator" */ if (!d...
12,241
1
static ssize_t qcow2_crypto_hdr_init_func(QCryptoBlock *block, size_t headerlen, void *opaque, Error **errp) { BlockDriverState *bs = opaque; BDRVQcow2State *s = bs->opaque; int64_t ret; int64_t clusterlen; ret = qcow2_alloc_clusters(bs, headerlen); if (ret < 0) { error_setg_errno(errp, -ret, "Cannot allocate cluster f...
12,242
1
static int get_cookies(HTTPContext *s, char **cookies, const char *path, const char *domain) { // cookie strings will look like Set-Cookie header field values. Multiple // Set-Cookie fields will result in multiple values delimited by a newline int ret = 0; char *next, *cookie, *set_cookies = av_strdup(s->cookies), *cse...
12,244
1
static inline void xan_wc3_copy_pixel_run(XanContext *s, int x, int y, int pixel_count, int motion_x, int motion_y) { int stride; int line_inc; int curframe_index, prevframe_index; int curframe_x, prevframe_x; int width = s->avctx->width; unsigned char *palette_plane, *prev_palette_plane; palette_plane = s->current_fra...
12,246
1
pixman_format_code_t qemu_default_pixman_format(int bpp, bool native_endian) { if (native_endian) { switch (bpp) { case 15: return PIXMAN_x1r5g5b5; case 16: return PIXMAN_r5g6b5; case 24: return PIXMAN_r8g8b8; case 32: return PIXMAN_x8r8g8b8; } } else { switch (bpp) { case 24: return PIXMAN_b8g8r8; case 32: return PIXM...
12,247
1
static ssize_t handle_aiocb_rw_linear(RawPosixAIOData *aiocb, char *buf) { ssize_t offset = 0; ssize_t len; while (offset < aiocb->aio_nbytes) { if (aiocb->aio_type & QEMU_AIO_WRITE) { len = pwrite(aiocb->aio_fildes, (const char *)buf + offset, aiocb->aio_nbytes - offset, aiocb->aio_offset + offset); } else { len = pre...
12,248
1
static inline int get_block(GetBitContext *gb, DCTELEM *block, const uint8_t *scan, const uint32_t *quant) { int coeff, i, n; int8_t ac; uint8_t dc = get_bits(gb, 8); // block not coded if (dc == 255) // number of non-zero coefficients coeff = get_bits(gb, 6); // normally we would only need to clear the (63 - coeff) la...
12,249
1
vcard_emul_find_vreader_from_slot(PK11SlotInfo *slot) { VReaderList *reader_list = vreader_get_reader_list(); VReaderListEntry *current_entry = NULL; if (reader_list == NULL) { return NULL; } for (current_entry = vreader_list_get_first(reader_list); current_entry; current_entry = vreader_list_get_next(current_entry)) {...
12,250
0
static int can_merge_formats(AVFilterFormats *a_arg, AVFilterFormats *b_arg, enum AVMediaType type, int is_sample_rate) { AVFilterFormats *a, *b, *ret; if (a == b) return 1; a = clone_filter_formats(a_arg); b = clone_filter_formats(b_arg); if (is_sample_rate) { ret = ff_merge_samplerates(a, b); } else { ret = ff_merge_...
12,251
1
static int mxf_write_partition(AVFormatContext *s, int bodysid, int indexsid, const uint8_t *key, int write_metadata) { MXFContext *mxf = s->priv_data; AVIOContext *pb = s->pb; int64_t header_byte_count_offset; unsigned index_byte_count = 0; uint64_t partition_offset = avio_tell(pb); int err; if (!mxf->edit_unit_byte_c...
12,252
1
void virtio_config_writew(VirtIODevice *vdev, uint32_t addr, uint32_t data) { VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev); uint16_t val = data; if (addr > (vdev->config_len - sizeof(val))) return; stw_p(vdev->config + addr, val); if (k->set_config) { k->set_config(vdev, vdev->config); } }
12,253
1
static uint8_t get_sot(J2kDecoderContext *s) { if (s->buf_end - s->buf < 4) return AVERROR(EINVAL); s->curtileno = bytestream_get_be16(&s->buf); ///< Isot if((unsigned)s->curtileno >= s->numXtiles * s->numYtiles){ s->curtileno=0; return AVERROR(EINVAL); } s->buf += 4; ///< Psot (ignored) if (!bytestream_get_byte(&s->bu...
12,254
1
static void i6300esb_pc_init(PCIBus *pci_bus) { I6300State *d; uint8_t *pci_conf; if (!pci_bus) { fprintf(stderr, "wdt_i6300esb: no PCI bus in this machine\n"); return; } d = (I6300State *) pci_register_device (pci_bus, "i6300esb_wdt", sizeof (I6300State), -1, i6300esb_config_read, i6300esb_config_write); d->reboot_ena...
12,256
1
static inline void cpu_loop_exec_tb(CPUState *cpu, TranslationBlock *tb, TranslationBlock **last_tb, int *tb_exit, SyncClocks *sc) { uintptr_t ret; if (unlikely(atomic_read(&cpu->exit_request))) { return; } trace_exec_tb(tb, tb->pc); ret = cpu_tb_exec(cpu, tb); *last_tb = (TranslationBlock *)(ret & ~TB_EXIT_MASK); *tb_...
12,258
1
static void vnc_dpy_update(DisplayState *ds, int x, int y, int w, int h) { VncState *vs = ds->opaque; int i; h += y; /* round x down to ensure the loop only spans one 16-pixel block per, iteration. otherwise, if (x % 16) != 0, the last iteration may span two 16-pixel blocks but we only mark the first as dirty */ w += (...
12,260
1
static void musb_async_cancel_device(MUSBState *s, USBDevice *dev) { int ep, dir; for (ep = 0; ep < 16; ep++) { for (dir = 0; dir < 2; dir++) { if (s->ep[ep].packey[dir].p.owner == NULL || s->ep[ep].packey[dir].p.owner->dev != dev) { continue; } usb_cancel_packet(&s->ep[ep].packey[dir].p); /* status updates needed here...
12,261
1
int qemu_reset_requested_get(void) { return reset_requested; }
12,262
1
static void select_input_picture(MpegEncContext *s){ int i; for(i=1; i<MAX_PICTURE_COUNT; i++) s->reordered_input_picture[i-1]= s->reordered_input_picture[i]; s->reordered_input_picture[MAX_PICTURE_COUNT-1]= NULL; /* set next picture type & ordering */ if(s->reordered_input_picture[0]==NULL && s->input_picture[0]){ if(...
12,263
1
static int local_chown(FsContext *fs_ctx, const char *path, FsCred *credp) { if ((credp->fc_uid == -1 && credp->fc_gid == -1) || (fs_ctx->fs_sm == SM_PASSTHROUGH)) { return lchown(rpath(fs_ctx, path), credp->fc_uid, credp->fc_gid); } else if (fs_ctx->fs_sm == SM_MAPPED) { return local_set_xattr(rpath(fs_ctx, path), cre...
12,264
1
static void encode_mb(MpegEncContext *s, int motion_x, int motion_y) { const int mb_x= s->mb_x; const int mb_y= s->mb_y; int i; #if 0 if (s->interlaced_dct) { dct_linesize = s->linesize * 2; dct_offset = s->linesize; } else { dct_linesize = s->linesize; dct_offset = s->linesize * 8; } #endif if (s->mb_intra) { UINT8 *p...
12,265
1
static int acpi_load_old(QEMUFile *f, void *opaque, int version_id) { PIIX4PMState *s = opaque; int ret, i; uint16_t temp; ret = pci_device_load(&s->dev, f); if (ret < 0) { return ret; } qemu_get_be16s(f, &s->ar.pm1.evt.sts); qemu_get_be16s(f, &s->ar.pm1.evt.en); qemu_get_be16s(f, &s->ar.pm1.cnt.cnt); ret = vmstate_loa...
12,266
1
static int debugcon_parse(const char *devname) { QemuOpts *opts; if (!qemu_chr_new("debugcon", devname, NULL)) { exit(1); } opts = qemu_opts_create(qemu_find_opts("device"), "debugcon", 1); if (!opts) { fprintf(stderr, "qemu: already have a debugcon device\n"); exit(1); } qemu_opt_set(opts, "driver", "isa-debugcon"); q...
12,267
1
static CCIDBus *ccid_bus_new(DeviceState *dev) { CCIDBus *bus; bus = FROM_QBUS(CCIDBus, qbus_create(&ccid_bus_info, dev, NULL)); bus->qbus.allow_hotplug = 1; return bus; }
12,268
1
bool bitmap_test_and_clear_atomic(unsigned long *map, long start, long nr) { unsigned long *p = map + BIT_WORD(start); const long size = start + nr; int bits_to_clear = BITS_PER_LONG - (start % BITS_PER_LONG); unsigned long mask_to_clear = BITMAP_FIRST_WORD_MASK(start); unsigned long dirty = 0; unsigned long old_bits; ...
12,269
1
int ff_dca_lbr_parse(DCALbrDecoder *s, uint8_t *data, DCAExssAsset *asset) { struct { LBRChunk lfe; LBRChunk tonal; LBRChunk tonal_grp[5]; LBRChunk grid1[DCA_LBR_CHANNELS / 2]; LBRChunk hr_grid[DCA_LBR_CHANNELS / 2]; LBRChunk ts1[DCA_LBR_CHANNELS / 2]; LBRChunk ts2[DCA_LBR_CHANNELS / 2]; } chunk = { 0 }; GetByteContext...
12,270
1
static int blk_mig_save_bulked_block(Monitor *mon, QEMUFile *f) { int64_t completed_sector_sum = 0; BlkMigDevState *bmds; int progress; int ret = 0; QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) { if (bmds->bulk_completed == 0) { if (mig_save_device_bulk(mon, f, bmds) == 1) { /* completed bulk section for t...
12,271
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 *downscript = NULL; const char *vhostfdname...
12,272
1
static int get_qcc(Jpeg2000DecoderContext *s, int n, Jpeg2000QuantStyle *q, uint8_t *properties) { int compno; if (bytestream2_get_bytes_left(&s->g) < 1) return AVERROR_INVALIDDATA; compno = bytestream2_get_byteu(&s->g); properties[compno] |= HAD_QCC; return get_qcx(s, n - 1, q + compno); }
12,274
1
static void vfio_pci_load_rom(VFIODevice *vdev) { struct vfio_region_info reg_info = { .argsz = sizeof(reg_info), .index = VFIO_PCI_ROM_REGION_INDEX }; uint64_t size; off_t off = 0; size_t bytes; if (ioctl(vdev->fd, VFIO_DEVICE_GET_REGION_INFO, &reg_info)) { error_report("vfio: Error getting ROM info: %m"); return; } D...
12,275
1
static void tcg_out_op (TCGContext *s, TCGOpcode opc, const TCGArg *args, const int *const_args) { int c; switch (opc) { case INDEX_op_exit_tb: tcg_out_movi (s, TCG_TYPE_I64, TCG_REG_R3, args[0]); tcg_out_b (s, 0, (tcg_target_long) tb_ret_addr); break; case INDEX_op_goto_tb: if (s->tb_jmp_offset) { /* direct jump metho...
12,276
1
static int fdctrl_init_common(FDCtrl *fdctrl) { int i, j; static int command_tables_inited = 0; /* Fill 'command_to_handler' lookup table */ if (!command_tables_inited) { command_tables_inited = 1; for (i = ARRAY_SIZE(handlers) - 1; i >= 0; i--) { for (j = 0; j < sizeof(command_to_handler); j++) { if ((j & handlers[i]....
12,277
1
static int32_t scsi_send_command(SCSIRequest *req, uint8_t *cmd) { SCSIGenericState *s = DO_UPCAST(SCSIGenericState, qdev, req->dev); SCSIGenericReq *r = DO_UPCAST(SCSIGenericReq, req, req); int ret; scsi_req_enqueue(req); if (cmd[0] != REQUEST_SENSE && (req->lun != s->lun || (cmd[1] >> 5) != s->lun)) { DPRINTF("Unimpl...
12,279
1
static void vfio_probe_ati_bar2_quirk(VFIOPCIDevice *vdev, int nr) { VFIOQuirk *quirk; VFIOConfigMirrorQuirk *mirror; /* Only enable on newer devices where BAR2 is 64bit */ if (!vfio_pci_is(vdev, PCI_VENDOR_ID_ATI, PCI_ANY_ID) || !vdev->has_vga || nr != 2 || !vdev->bars[2].mem64) { return; } quirk = g_malloc0(sizeof(*q...
12,280
1
static int copy_packet_data(AVPacket *pkt, const AVPacket *src, int dup) { pkt->data = NULL; pkt->side_data = NULL; if (pkt->buf) { AVBufferRef *ref = av_buffer_ref(src->buf); if (!ref) return AVERROR(ENOMEM); pkt->buf = ref; pkt->data = ref->data; } else { DUP_DATA(pkt->data, src->data, pkt->size, 1, ALLOC_BUF); } if ...
12,282
1
static void ffm_seek1(AVFormatContext *s, int64_t pos1) { FFMContext *ffm = s->priv_data; AVIOContext *pb = s->pb; int64_t pos; pos = FFMIN(pos1, ffm->file_size - FFM_PACKET_SIZE); pos = FFMAX(pos, FFM_PACKET_SIZE); av_dlog(s, "seek to %"PRIx64" -> %"PRIx64"\n", pos1, pos); avio_seek(pb, pos, SEEK_SET); }
12,283
1
int ff_h264_decode_ref_pic_list_reordering(H264Context *h, H264SliceContext *sl) { int list, index, pic_structure; print_short_term(h); print_long_term(h); h264_initialise_ref_list(h, sl); for (list = 0; list < sl->list_count; list++) { if (get_bits1(&sl->gb)) { // ref_pic_list_modification_flag_l[01] int pred = h->cur...
12,284
1
static inline void dxt5_block_internal(uint8_t *dst, ptrdiff_t stride, const uint8_t *block) { int x, y; uint32_t colors[4]; uint8_t alpha_indices[16]; uint16_t color0 = AV_RL16(block + 8); uint16_t color1 = AV_RL16(block + 10); uint32_t code = AV_RL32(block + 12); uint8_t alpha0 = *(block); uint8_t alpha1 = *(block + ...
12,285
1
void OPPROTO op_POWER_sre (void) { T1 &= 0x1FUL; env->spr[SPR_MQ] = rotl32(T0, 32 - T1); T0 = Ts0 >> T1; RETURN(); }
12,286
1
static int h263_decode_block(MpegEncContext * s, int16_t * block, int n, int coded) { int level, i, j, run; RLTable *rl = &ff_h263_rl_inter; const uint8_t *scan_table; GetBitContext gb= s->gb; scan_table = s->intra_scantable.permutated; if (s->h263_aic && s->mb_intra) { rl = &ff_rl_intra_aic; i = 0; if (s->ac_pred) { i...
12,287
1
void bdrv_op_block(BlockDriverState *bs, BlockOpType op, Error *reason) { BdrvOpBlocker *blocker; assert((int) op >= 0 && op < BLOCK_OP_TYPE_MAX); blocker = g_malloc0(sizeof(BdrvOpBlocker)); blocker->reason = reason; QLIST_INSERT_HEAD(&bs->op_blockers[op], blocker, list); }
12,288
1
TraceEvent *trace_event_iter_next(TraceEventIter *iter) { while (iter->event < TRACE_EVENT_COUNT) { TraceEvent *ev = &(trace_events[iter->event]); iter->event++; if (!iter->pattern || pattern_glob(iter->pattern, trace_event_get_name(ev))) { return ev; } } return NULL; }
12,289
1
static av_cold int ape_decode_init(AVCodecContext *avctx) { APEContext *s = avctx->priv_data; int i; if (avctx->extradata_size != 6) { av_log(avctx, AV_LOG_ERROR, "Incorrect extradata\n"); return AVERROR(EINVAL); } if (avctx->channels > 2) { av_log(avctx, AV_LOG_ERROR, "Only mono and stereo is supported\n"); return AVE...
12,290
1
static double lfo_get_value(SimpleLFO *lfo) { double phs = FFMIN(100, lfo->phase / FFMIN(1.99, FFMAX(0.01, lfo->pwidth)) + lfo->offset); double val; if (phs > 1) phs = fmod(phs, 1.); switch (lfo->mode) { case SINE: val = sin(phs * 2 * M_PI); break; case TRIANGLE: if (phs > 0.75) val = (phs - 0.75) * 4 - 1; else if (phs...
12,291
1
static int srt_get_duration(uint8_t **buf) { int i, duration = 0; for (i=0; i<2 && !duration; i++) { int s_hour, s_min, s_sec, s_hsec, e_hour, e_min, e_sec, e_hsec; if (sscanf(*buf, "%d:%2d:%2d%*1[,.]%3d --> %d:%2d:%2d%*1[,.]%3d", &s_hour, &s_min, &s_sec, &s_hsec, &e_hour, &e_min, &e_sec, &e_hsec) == 8) { s_min += 60*s...
12,292
0
static int vaapi_encode_mjpeg_init_picture_params(AVCodecContext *avctx, VAAPIEncodePicture *pic) { VAAPIEncodeContext *ctx = avctx->priv_data; VAEncPictureParameterBufferJPEG *vpic = pic->codec_picture_params; VAAPIEncodeMJPEGContext *priv = ctx->priv_data; vpic->reconstructed_picture = pic->recon_surface; vpic->coded...
12,293
0
static int hdcd_scan(HDCDContext *ctx, hdcd_state_t *state, const int32_t *samples, int max, int stride) { int cdt_active = 0; /* code detect timer */ int result; if (state->sustain > 0) { cdt_active = 1; if (state->sustain <= max) { state->control = 0; max = state->sustain; } state->sustain -= max; } result = 0; while...
12,294
0
static int swf_write_audio(AVFormatContext *s, AVCodecContext *enc, const uint8_t *buf, int size) { SWFContext *swf = s->priv_data; int c = 0; /* Flash Player limit */ if ( swf->swf_frame_number >= 16000 ) { return 0; } if (enc->codec_id == CODEC_ID_MP3 ) { for (c=0; c<size; c++) { swf->audio_fifo[(swf->audio_out_pos+c...
12,295
0
static int64_t mp3_sync(AVFormatContext *s, int64_t target_pos, int flags) { int dir = (flags&AVSEEK_FLAG_BACKWARD) ? -1 : 1; int64_t best_pos; int best_score, i, j; int64_t ret; avio_seek(s->pb, FFMAX(target_pos - SEEK_WINDOW, 0), SEEK_SET); ret = avio_seek(s->pb, target_pos, SEEK_SET); if (ret < 0) return ret; #defin...
12,296
0
void test_segs(void) { struct modify_ldt_ldt_s ldt; long long ldt_table[3]; int res, res2; char tmp; struct { uint32_t offset; uint16_t seg; } __attribute__((packed)) segoff; ldt.entry_number = 1; ldt.base_addr = (unsigned long)&seg_data1; ldt.limit = (sizeof(seg_data1) + 0xfff) >> 12; ldt.seg_32bit = 1; ldt.contents =...
12,297
0
static void cpu_notify_map_clients(void) { MapClient *client; while (!LIST_EMPTY(&map_client_list)) { client = LIST_FIRST(&map_client_list); client->callback(client->opaque); cpu_unregister_map_client(client); } }
12,299
0
vcard_free(VCard *vcard) { VCardApplet *current_applet = NULL; VCardApplet *next_applet = NULL; if (vcard == NULL) { return; } vcard->reference_count--; if (vcard->reference_count != 0) { return; } if (vcard->vcard_private_free) { (*vcard->vcard_private_free)(vcard->vcard_private); vcard->vcard_private_free = 0; vcard-...
12,300
0
static inline bool valid_ptex(PowerPCCPU *cpu, target_ulong ptex) { /* * hash value/pteg group index is normalized by htab_mask */ if (((ptex & ~7ULL) / HPTES_PER_GROUP) & ~cpu->env.htab_mask) { return false; } return true; }
12,301
0
gen_intermediate_code_internal(SuperHCPU *cpu, TranslationBlock *tb, bool search_pc) { CPUState *cs = CPU(cpu); CPUSH4State *env = &cpu->env; DisasContext ctx; target_ulong pc_start; static uint16_t *gen_opc_end; CPUBreakpoint *bp; int i, ii; int num_insns; int max_insns; pc_start = tb->pc; gen_opc_end = tcg_ctx.gen_op...
12,302
0
static uint32_t get_level1_table_address(CPUARMState *env, uint32_t address) { uint32_t table; if (address & env->cp15.c2_mask) table = env->cp15.ttbr1_el1 & 0xffffc000; else table = env->cp15.ttbr0_el1 & env->cp15.c2_base_mask; table |= (address >> 18) & 0x3ffc; return table; }
12,303
0
static int do_setcontext(struct target_ucontext *ucp, CPUPPCState *env, int sig) { struct target_mcontext *mcp; target_ulong mcp_addr; sigset_t blocked; target_sigset_t set; if (copy_from_user(&set, h2g(ucp) + offsetof(struct target_ucontext, tuc_sigmask), sizeof (set))) return 1; #if defined(TARGET_PPC64) fprintf (std...
12,304
0
static void bdrv_co_drain_bh_cb(void *opaque) { BdrvCoDrainData *data = opaque; Coroutine *co = data->co; BlockDriverState *bs = data->bs; bdrv_dec_in_flight(bs); bdrv_drain_poll(bs); data->done = true; qemu_coroutine_enter(co); }
12,306
0
QEMUTimerList *timerlist_new(QEMUClockType type, QEMUTimerListNotifyCB *cb, void *opaque) { QEMUTimerList *timer_list; QEMUClock *clock = qemu_clock_ptr(type); timer_list = g_malloc0(sizeof(QEMUTimerList)); qemu_event_init(&timer_list->timers_done_ev, true); timer_list->clock = clock; timer_list->notify_cb = cb; timer_...
12,309
0
void cpu_check_irqs(CPUSPARCState *env) { uint32_t pil = env->pil_in | (env->softint & ~(SOFTINT_TIMER | SOFTINT_STIMER)); /* check if TM or SM in SOFTINT are set setting these also causes interrupt 14 */ if (env->softint & (SOFTINT_TIMER | SOFTINT_STIMER)) { pil |= 1 << 14; } /* The bit corresponding to psrpil is (1<<...
12,311
0
static void *qemu_kvm_cpu_thread_fn(void *arg) { CPUState *env = arg; int r; qemu_mutex_lock(&qemu_global_mutex); qemu_thread_self(env->thread); r = kvm_init_vcpu(env); if (r < 0) { fprintf(stderr, "kvm_init_vcpu failed: %s\n", strerror(-r)); exit(1); } qemu_kvm_init_cpu_signals(env); /* signal CPU creation */ env->cre...
12,312
0
static long do_sigreturn_v2(CPUARMState *env) { abi_ulong frame_addr; struct sigframe_v2 *frame = NULL; /* * Since we stacked the signal on a 64-bit boundary, * then 'sp' should be word aligned here. If it's * not, then the user is trying to mess with us. */ frame_addr = env->regs[13]; trace_user_do_sigreturn(env, fram...
12,313
0
static int v9fs_synth_open(FsContext *ctx, V9fsPath *fs_path, int flags, V9fsFidOpenState *fs) { V9fsSynthOpenState *synth_open; V9fsSynthNode *node = *(V9fsSynthNode **)fs_path->data; synth_open = g_malloc(sizeof(*synth_open)); synth_open->node = node; node->open_count++; fs->private = synth_open; return 0; }
12,315
0
static void filter_mb_edgecv( H264Context *h, uint8_t *pix, int stride, int bS[4], int qp ) { int i, d; const int index_a = clip( qp + h->slice_alpha_c0_offset, 0, 51 ); const int alpha = alpha_table[index_a]; const int beta = beta_table[clip( qp + h->slice_beta_offset, 0, 51 )]; for( i = 0; i < 4; i++ ) { if( bS[i] ==...
12,316
0
static void rtl8139_transfer_frame(RTL8139State *s, const uint8_t *buf, int size, int do_interrupt) { if (!size) { DEBUG_PRINT(("RTL8139: +++ empty ethernet frame\n")); return; } if (TxLoopBack == (s->TxConfig & TxLoopBack)) { DEBUG_PRINT(("RTL8139: +++ transmit loopback mode\n")); rtl8139_do_receive(s, buf, size, do_i...
12,318
0
static void sclp_execute(SCCB *sccb, uint64_t code) { S390SCLPDevice *sdev = get_event_facility(); switch (code & SCLP_CMD_CODE_MASK) { case SCLP_CMDW_READ_SCP_INFO: case SCLP_CMDW_READ_SCP_INFO_FORCED: read_SCP_info(sccb); break; case SCLP_CMDW_READ_CPU_INFO: sclp_read_cpu_info(sccb); break; default: sdev->sclp_comman...
12,319
0
static int blk_prw(BlockBackend *blk, int64_t offset, uint8_t *buf, int64_t bytes, CoroutineEntry co_entry, BdrvRequestFlags flags) { AioContext *aio_context; QEMUIOVector qiov; struct iovec iov; Coroutine *co; BlkRwCo rwco; iov = (struct iovec) { .iov_base = buf, .iov_len = bytes, }; qemu_iovec_init_external(&qiov, &i...
12,321
0
static int unix_listen_saddr(UnixSocketAddress *saddr, bool update_addr, Error **errp) { struct sockaddr_un un; int sock, fd; sock = qemu_socket(PF_UNIX, SOCK_STREAM, 0); if (sock < 0) { error_setg_errno(errp, errno, "Failed to create Unix socket"); return -1; } memset(&un, 0, sizeof(un)); un.sun_family = AF_UNIX; if (...
12,323
0
static void mirror_start_job(const char *job_id, BlockDriverState *bs, BlockDriverState *target, const char *replaces, int64_t speed, uint32_t granularity, int64_t buf_size, BlockMirrorBackingMode backing_mode, BlockdevOnError on_source_error, BlockdevOnError on_target_error, bool unmap, BlockCompletionFunc *cb, void *...
12,324
0
int RENAME(swri_resample)(ResampleContext *c, DELEM *dst, const DELEM *src, int *consumed, int src_size, int dst_size, int update_ctx){ int dst_index, i; int index= c->index; int frac= c->frac; int dst_incr_frac= c->dst_incr % c->src_incr; int dst_incr= c->dst_incr / c->src_incr; av_assert1(c->filter_shift == FILTER_SH...
12,327
0
static uint32_t gic_dist_readb(void *opaque, hwaddr offset) { GICState *s = (GICState *)opaque; uint32_t res; int irq; int i; int cpu; int cm; int mask; cpu = gic_get_current_cpu(s); cm = 1 << cpu; if (offset < 0x100) { if (offset == 0) return s->enabled; if (offset == 4) return ((s->num_irq / 32) - 1) | ((NUM_CPU(s) -...
12,328
0
MemoryRegionSection memory_region_find(MemoryRegion *mr, hwaddr addr, uint64_t size) { MemoryRegionSection ret = { .mr = NULL }; MemoryRegion *root; AddressSpace *as; AddrRange range; FlatView *view; FlatRange *fr; addr += mr->addr; for (root = mr; root->parent; ) { root = root->parent; addr += root->addr; } as = memor...
12,330
0
static void omap_tcmi_write(void *opaque, target_phys_addr_t addr, uint64_t value, unsigned size) { struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque; if (size != 4) { return omap_badwidth_write32(opaque, addr, value); } switch (addr) { case 0x00: /* IMIF_PRIO */ case 0x04: /* EMIFS_PRIO */ case 0x08: /* ...
12,331
0
static av_cold int xbm_encode_init(AVCodecContext *avctx) { avctx->coded_frame = av_frame_alloc(); if (!avctx->coded_frame) return AVERROR(ENOMEM); avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I; return 0; }
12,332
0
static inline void RENAME(yuvPlanartoyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, long width, long height, long lumStride, long chromStride, long dstStride, long vertLumPerChroma) { long y; const x86_reg chromWidth= width>>1; for (y=0; y<height; y++) { #if COMPILE_TEMPLATE_MMX //FI...
12,333
0
DECL_IMDCT_BLOCKS(sse,sse) #endif DECL_IMDCT_BLOCKS(sse2,sse) DECL_IMDCT_BLOCKS(sse3,sse) DECL_IMDCT_BLOCKS(ssse3,sse) #endif #if HAVE_AVX_EXTERNAL DECL_IMDCT_BLOCKS(avx,avx) #endif #endif /* HAVE_YASM */ av_cold void ff_mpadsp_init_x86(MPADSPContext *s) { int cpu_flags = av_get_cpu_flags(); int i, j; for (j = 0; j < 4...
12,334
1
static void dirac_unpack_block_motion_data(DiracContext *s) { GetBitContext *gb = &s->gb; uint8_t *sbsplit = s->sbsplit; int i, x, y, q, p; DiracArith arith[8]; align_get_bits(gb); /* [DIRAC_STD] 11.2.4 and 12.2.1 Number of blocks and superblocks */ s->sbwidth = DIVRNDUP(s->source.width, 4*s->plane[0].xbsep); s->sbheig...
12,335
1
static void add_bytes_c(uint8_t *dst, uint8_t *src, int w){ long i; for(i=0; i<=w-sizeof(long); i+=sizeof(long)){ long a = *(long*)(src+i); long b = *(long*)(dst+i); *(long*)(dst+i) = ((a&pb_7f) + (b&pb_7f)) ^ ((a^b)&pb_80); } for(; i<w; i++) dst[i+0] += src[i+0]; }
12,336
1
static int write_f(BlockBackend *blk, int argc, char **argv) { struct timeval t1, t2; bool Cflag = false, qflag = false, bflag = false; bool Pflag = false, zflag = false, cflag = false; int flags = 0; int c, cnt; char *buf = NULL; int64_t offset; int64_t count; /* Some compilers get confused and warn if this is not ini...
12,337
1
static int parse_audio(DBEContext *s, int start, int end, int seg_id) { int ch, ret, key = parse_key(s); for (ch = start; ch < end; ch++) { if (!s->ch_size[ch]) { s->channels[seg_id][ch].nb_groups = 0; continue; } if ((ret = convert_input(s, s->ch_size[ch], key)) < 0) return ret; if ((ret = parse_channel(s, ch, seg_id)...
12,338
1
static void qemu_input_queue_process(void *opaque) { struct QemuInputEventQueueHead *queue = opaque; QemuInputEventQueue *item; g_assert(!QTAILQ_EMPTY(queue)); item = QTAILQ_FIRST(queue); g_assert(item->type == QEMU_INPUT_QUEUE_DELAY); QTAILQ_REMOVE(queue, item, node); g_free(item); while (!QTAILQ_EMPTY(queue)) { item ...
12,339
1
static void vhost_scsi_unrealize(DeviceState *dev, Error **errp) { VirtIODevice *vdev = VIRTIO_DEVICE(dev); VHostSCSI *s = VHOST_SCSI(dev); migrate_del_blocker(s->migration_blocker); error_free(s->migration_blocker); /* This will stop vhost backend. */ vhost_scsi_set_status(vdev, 0); g_free(s->dev.vqs); virtio_scsi_com...
12,340