label
int64
0
1
func1
stringlengths
23
97k
id
int64
0
27.3k
0
static void do_help(int argc, const char **argv) { help_cmd(argv[1]); }
13,591
0
int main(int argc, char **argv, char **envp) { const char *gdbstub_dev = NULL; int i; int snapshot, linux_boot; const char *icount_option = NULL; const char *initrd_filename; const char *kernel_filename, *kernel_cmdline; char boot_devices[33] = "cad"; /* default to HD->floppy->CD-ROM */ DisplayState *ds; DisplayChangeL...
13,593
0
static int tcp_read(URLContext *h, uint8_t *buf, int size) { TCPContext *s = h->priv_data; int size1, len, fd_max; fd_set rfds; struct timeval tv; size1 = size; while (size > 0) { if (url_interrupt_cb()) return -EINTR; fd_max = s->fd; FD_ZERO(&rfds); FD_SET(s->fd, &rfds); tv.tv_sec = 0; tv.tv_usec = 100 * 1000; select(...
13,594
0
static int hda_codec_dev_exit(DeviceState *qdev) { HDACodecDevice *dev = HDA_CODEC_DEVICE(qdev); HDACodecDeviceClass *cdc = HDA_CODEC_DEVICE_GET_CLASS(dev); if (cdc->exit) { cdc->exit(dev); } return 0; }
13,596
0
static bool virtqueue_map_desc(VirtIODevice *vdev, unsigned int *p_num_sg, hwaddr *addr, struct iovec *iov, unsigned int max_num_sg, bool is_write, hwaddr pa, size_t sz) { bool ok = false; unsigned num_sg = *p_num_sg; assert(num_sg <= max_num_sg); if (!sz) { virtio_error(vdev, "virtio: zero sized buffers are not allowe...
13,597
0
void i8042_setup_a20_line(ISADevice *dev, qemu_irq *a20_out) { ISAKBDState *isa = I8042(dev); KBDState *s = &isa->kbd; s->a20_out = a20_out; }
13,598
0
static int swf_read_header(AVFormatContext *s, AVFormatParameters *ap) { SWFContext *swf = 0; ByteIOContext *pb = &s->pb; int nbits, len, frame_rate, tag, v; offset_t firstTagOff; AVStream *ast = 0; AVStream *vst = 0; swf = av_malloc(sizeof(SWFContext)); if (!swf) return -1; s->priv_data = swf; tag = get_be32(pb) & 0xf...
13,599
0
void ff_weight_h264_pixels16_8_msa(uint8_t *src, int stride, int height, int log2_denom, int weight_src, int offset) { avc_wgt_16width_msa(src, stride, height, log2_denom, weight_src, offset); }
13,600
0
static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header, const uint8_t *buf, int buf_size) { int cmd_pos, pos, cmd, x1, y1, x2, y2, offset1, offset2, next_cmd_pos; int big_offsets, offset_size, is_8bit = 0; const uint8_t *yuv_palette = 0; uint8_t colormap[4] = { 0 }, alpha[256] = { 0 }; int date; int...
13,601
0
static int format_name(char *buf, int buf_len, int index) { const char *proto, *dir; char *orig_buf_dup = NULL, *mod_buf_dup = NULL; int ret = 0; if (!av_stristr(buf, "%v")) return ret; orig_buf_dup = av_strdup(buf); if (!orig_buf_dup) { ret = AVERROR(ENOMEM); goto fail; } if (replace_int_data_in_filename(buf, buf_len,...
13,602
1
void cpu_reset(CPUSPARCState *env) { if (qemu_loglevel_mask(CPU_LOG_RESET)) { qemu_log("CPU Reset (CPU %d)\n", env->cpu_index); log_cpu_state(env, 0); } tlb_flush(env, 1); env->cwp = 0; #ifndef TARGET_SPARC64 env->wim = 1; #endif env->regwptr = env->regbase + (env->cwp * 16); #if defined(CONFIG_USER_ONLY) #ifdef TARGET...
13,603
1
net_rx_pkt_pull_data(struct NetRxPkt *pkt, const struct iovec *iov, int iovcnt, size_t ploff) { if (pkt->vlan_stripped) { net_rx_pkt_iovec_realloc(pkt, iovcnt + 1); pkt->vec[0].iov_base = pkt->ehdr_buf; pkt->vec[0].iov_len = sizeof(pkt->ehdr_buf); pkt->tot_len = iov_size(iov, iovcnt) - ploff + sizeof(struct eth_header)...
13,606
1
MigrationState *tcp_start_outgoing_migration(Monitor *mon, const char *host_port, int64_t bandwidth_limit, int detach, int blk, int inc) { struct sockaddr_in addr; FdMigrationState *s; int ret; if (parse_host_port(&addr, host_port) < 0) return NULL; s = qemu_mallocz(sizeof(*s)); s->get_error = socket_errno; s->write = ...
13,607
1
int main_loop(void *opaque) { struct pollfd ufds[2], *pf, *serial_ufd, *net_ufd, *gdb_ufd; int ret, n, timeout; uint8_t ch; CPUState *env = global_env; if (!term_inited) { /* initialize terminal only there so that the user has a chance to stop QEMU with Ctrl-C before the gdb connection is launched */ term_inited = 1; t...
13,608
1
static int ehci_state_executing(EHCIQueue *q) { EHCIPacket *p = QTAILQ_FIRST(&q->packets); assert(p != NULL); assert(p->qtdaddr == q->qtdaddr); ehci_execute_complete(q); // 4.10.3 if (!q->async) { int transactCtr = get_field(q->qh.epcap, QH_EPCAP_MULT); transactCtr--; set_field(&q->qh.epcap, transactCtr, QH_EPCAP_MULT)...
13,609
1
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe) { int y, x, plane, cur_row = 0; for(plane = 0; plane < 3; plane++) { const int is_chroma = !!plane; const int qscale = av_clip(10000-quality,is_chroma?1000:2000,10000)<<2; const int stride = ctx->flipped_ptrs[ctx->cur_index].linesize[plane...
13,610
1
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) { UnsharpContext *unsharp = ctx->priv; int lmsize_x = 5, cmsize_x = 0; int lmsize_y = 5, cmsize_y = 0; double lamount = 1.0f, camount = 0.0f; if (args) sscanf(args, "%d:%d:%lf:%d:%d:%lf", &lmsize_x, &lmsize_y, &lamount, &cmsize_x, &cmsize_y, ...
13,611
0
static int mxf_decrypt_triplet(AVFormatContext *s, AVPacket *pkt, KLVPacket *klv) { static const uint8_t checkv[16] = {0x43, 0x48, 0x55, 0x4b, 0x43, 0x48, 0x55, 0x4b, 0x43, 0x48, 0x55, 0x4b, 0x43, 0x48, 0x55, 0x4b}; MXFContext *mxf = s->priv_data; AVIOContext *pb = s->pb; int64_t end = avio_tell(pb) + klv->length; uint...
13,613
1
static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pic, int *got_packet) { libx265Context *ctx = avctx->priv_data; x265_picture x265pic; x265_picture x265pic_out = { { 0 } }; x265_nal *nal; uint8_t *dst; int payload = 0; int nnal; int ret; int i; if (pic) { for (i = 0; i < 3; i++) { x2...
13,614
1
static inline TCGv gen_ld16u(TCGv addr, int index) { TCGv tmp = new_tmp(); tcg_gen_qemu_ld16u(tmp, addr, index); return tmp; }
13,615
1
static int opus_decode_packet(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt) { OpusContext *c = avctx->priv_data; AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; int coded_samples = 0; int decoded_samples = 0; int i, ret; /* decode the header of the first su...
13,616
1
int page_check_range(target_ulong start, target_ulong len, int flags) { PageDesc *p; target_ulong end; target_ulong addr; /* This function should never be called with addresses outside the guest address space. If this assert fires, it probably indicates a missing call to h2g_valid. */ #if TARGET_ABI_BITS > L1_MAP_ADDR_...
13,617
1
static int add_file(AVFormatContext *avf, char *filename, ConcatFile **rfile, unsigned *nb_files_alloc) { ConcatContext *cat = avf->priv_data; ConcatFile *file; char *url; size_t url_len; if (cat->safe > 0 && !safe_filename(filename)) { av_log(avf, AV_LOG_ERROR, "Unsafe file name '%s'\n", filename); return AVERROR(EPER...
13,618
1
void avfilter_copy_buffer_ref_props(AVFilterBufferRef *dst, AVFilterBufferRef *src) { // copy common properties dst->pts = src->pts; dst->pos = src->pos; switch (src->type) { case AVMEDIA_TYPE_VIDEO: { if (dst->video->qp_table) av_freep(&dst->video->qp_table); copy_video_props(dst->video, src->video); break; } case AVM...
13,619
1
static void test_validate_fail_list(TestInputVisitorData *data, const void *unused) { UserDefOneList *head = NULL; Error *err = NULL; Visitor *v; v = validate_test_init(data, "[ { 'string': 'string0', 'integer': 42 }, { 'string': 'string1', 'integer': 43 }, { 'string': 'string2', 'integer': 44, 'extra': 'ggg' } ]"); vi...
13,620
1
int ff_find_unused_picture(MpegEncContext *s, int shared){ int i; if(shared){ for(i=0; i<MAX_PICTURE_COUNT; i++){ if(s->picture[i].data[0]==NULL && s->picture[i].type==0) return i; } }else{ for(i=0; i<MAX_PICTURE_COUNT; i++){ if(s->picture[i].data[0]==NULL && s->picture[i].type!=0) return i; //FIXME } for(i=0; i<MAX_PI...
13,621
1
static void audio_init (PCIBus *pci_bus, qemu_irq *pic) { struct soundhw *c; int audio_enabled = 0; for (c = soundhw; !audio_enabled && c->name; ++c) { audio_enabled = c->enabled; } if (audio_enabled) { AudioState *s; s = AUD_init (); if (s) { for (c = soundhw; c->name; ++c) { if (c->enabled) { if (c->isa) { c->init.in...
13,622
0
static void destroy_buffers(VADisplay display, VABufferID *buffers, unsigned int n_buffers) { unsigned int i; for (i = 0; i < n_buffers; i++) { if (buffers[i]) { vaDestroyBuffer(display, buffers[i]); buffers[i] = 0; } } }
13,624
1
static void vmxnet3_activate_device(VMXNET3State *s) { int i; static const uint32_t VMXNET3_DEF_TX_THRESHOLD = 1; hwaddr qdescr_table_pa; uint64_t pa; uint32_t size; /* Verify configuration consistency */ if (!vmxnet3_verify_driver_magic(s->drv_shmem)) { VMW_ERPRN("Device configuration received from driver is invalid")...
13,625
1
bool object_property_get_bool(Object *obj, const char *name, Error **errp) { QObject *ret = object_property_get_qobject(obj, name, errp); QBool *qbool; bool retval; if (!ret) { return false; } qbool = qobject_to_qbool(ret); if (!qbool) { error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name, "boolean"); retval = false; } ...
13,626
1
static void mpegts_insert_pcr_only(AVFormatContext *s, AVStream *st) { MpegTSWrite *ts = s->priv_data; MpegTSWriteStream *ts_st = st->priv_data; uint8_t *q; uint8_t buf[TS_PACKET_SIZE]; q = buf; *q++ = 0x47; *q++ = ts_st->pid >> 8; *q++ = ts_st->pid; *q++ = 0x20 | ts_st->cc; /* Adaptation only */ /* Continuity Count fi...
13,627
1
static void disas_extract(DisasContext *s, uint32_t insn) { unsupported_encoding(s, insn); }
13,628
1
static int dxva2_mpeg2_end_frame(AVCodecContext *avctx) { struct MpegEncContext *s = avctx->priv_data; struct dxva2_picture_context *ctx_pic = s->current_picture_ptr->hwaccel_picture_private; int ret; if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0) return -1; ret = ff_dxva2_common_end_frame(avctx, &s->cu...
13,629
1
static int au_read_header(AVFormatContext *s) { int size; unsigned int tag; AVIOContext *pb = s->pb; unsigned int id, channels, rate; int bps; enum AVCodecID codec; AVStream *st; /* check ".snd" header */ tag = avio_rl32(pb); if (tag != MKTAG('.', 's', 'n', 'd')) return -1; size = avio_rb32(pb); /* header size */ avio_...
13,630
1
static inline void bink_idct_col(DCTELEM *dest, const DCTELEM *src) { if ((src[8]|src[16]|src[24]|src[32]|src[40]|src[48]|src[56])==0) { dest[0] = dest[8] = dest[16] = dest[24] = dest[32] = dest[40] = dest[48] = dest[56] = src[0]; } else { IDCT_COL(dest, src); } }
13,631
1
static int decode_info_header(NUTContext *nut) { AVFormatContext *s = nut->avf; AVIOContext *bc = s->pb; uint64_t tmp, chapter_start, chapter_len; unsigned int stream_id_plus1, count; int chapter_id, i; int64_t value, end; char name[256], str_value[1024], type_str[256]; const char *type; int *event_flags; AVChapter *ch...
13,632
1
static void vhost_client_set_memory(CPUPhysMemoryClient *client, target_phys_addr_t start_addr, ram_addr_t size, ram_addr_t phys_offset, bool log_dirty) { struct vhost_dev *dev = container_of(client, struct vhost_dev, client); ram_addr_t flags = phys_offset & ~TARGET_PAGE_MASK; int s = offsetof(struct vhost_memory, reg...
13,633
1
static int quant_psnr8x8_c(MpegEncContext *s, uint8_t *src1, uint8_t *src2, ptrdiff_t stride, int h) { LOCAL_ALIGNED_16(int16_t, temp, [64 * 2]); int16_t *const bak = temp + 64; int sum = 0, i; av_assert2(h == 8); s->mb_intra = 0; s->pdsp.diff_pixels(temp, src1, src2, stride); memcpy(bak, temp, 64 * sizeof(int16_t)); s...
13,634
1
static int vhdx_parse_metadata(BlockDriverState *bs, BDRVVHDXState *s) { int ret = 0; uint8_t *buffer; int offset = 0; uint32_t i = 0; VHDXMetadataTableEntry md_entry; buffer = qemu_blockalign(bs, VHDX_METADATA_TABLE_MAX_SIZE); ret = bdrv_pread(bs->file, s->metadata_rt.file_offset, buffer, VHDX_METADATA_TABLE_MAX_SIZE)...
13,637
1
void virtio_scsi_handle_cmd_vq(VirtIOSCSI *s, VirtQueue *vq) { VirtIOSCSIReq *req, *next; QTAILQ_HEAD(, VirtIOSCSIReq) reqs = QTAILQ_HEAD_INITIALIZER(reqs); while ((req = virtio_scsi_pop_req(s, vq))) { if (virtio_scsi_handle_cmd_req_prepare(s, req)) { QTAILQ_INSERT_TAIL(&reqs, req, next); } } QTAILQ_FOREACH_SAFE(req, &...
13,638
1
static void mch_realize(PCIDevice *d, Error **errp) { int i; MCHPCIState *mch = MCH_PCI_DEVICE(d); /* setup pci memory mapping */ pc_pci_as_mapping_init(OBJECT(mch), mch->system_memory, mch->pci_address_space); /* smram */ cpu_smm_register(&mch_set_smm, mch); memory_region_init_alias(&mch->smram_region, OBJECT(mch), "s...
13,639
0
static uint64_t calc_rice_params(RiceContext *rc, int pmin, int pmax, int32_t *data, int n, int pred_order) { int i; uint64_t bits[MAX_PARTITION_ORDER+1]; int opt_porder; RiceContext tmp_rc; uint32_t *udata; uint64_t sums[MAX_PARTITION_ORDER + 1][MAX_PARTITIONS] = { { 0 } }; assert(pmin >= 0 && pmin <= MAX_PARTITION_OR...
13,640
1
static int handle_http(HTTPContext *c, long cur_time) { int len; switch(c->state) { case HTTPSTATE_WAIT_REQUEST: /* timeout ? */ if ((c->timeout - cur_time) < 0) return -1; if (c->poll_entry->revents & (POLLERR | POLLHUP)) return -1; /* no need to read if no events */ if (!(c->poll_entry->revents & POLLIN)) return 0; /...
13,641
1
static int bfi_read_header(AVFormatContext * s) { BFIContext *bfi = s->priv_data; AVIOContext *pb = s->pb; AVStream *vstream; AVStream *astream; int fps, chunk_header; /* Initialize the video codec... */ vstream = avformat_new_stream(s, NULL); if (!vstream) return AVERROR(ENOMEM); /* Initialize the audio codec... */ as...
13,642
1
static int event_qdev_init(DeviceState *qdev) { SCLPEvent *event = DO_UPCAST(SCLPEvent, qdev, qdev); SCLPEventClass *child = SCLP_EVENT_GET_CLASS(event); return child->init(event); }
13,643
1
static void gen_rfid(DisasContext *ctx) { #if defined(CONFIG_USER_ONLY) gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC); #else /* Restore CPU state */ if (unlikely(!ctx->mem_idx)) { gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC); return; } gen_helper_rfid(); gen_sync_exception(ctx); #endif }
13,644
1
static void vga_update_text(void *opaque, console_ch_t *chardata) { VGACommonState *s = opaque; int graphic_mode, i, cursor_offset, cursor_visible; int cw, cheight, width, height, size, c_min, c_max; uint32_t *src; console_ch_t *dst, val; char msg_buffer[80]; int full_update = 0; if (!(s->ar_index & 0x20)) { graphic_mo...
13,645
1
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *pkt) { SANMVideoContext *ctx = avctx->priv_data; int i, ret; bytestream2_init(&ctx->gb, pkt->data, pkt->size); if (ctx->output->data[0]) avctx->release_buffer(avctx, ctx->output); if (!ctx->version) { int to_store = 0; while (bytes...
13,646
1
static RAMBlock *unqueue_page(RAMState *rs, ram_addr_t *offset, ram_addr_t *ram_addr_abs) { RAMBlock *block = NULL; qemu_mutex_lock(&rs->src_page_req_mutex); if (!QSIMPLEQ_EMPTY(&rs->src_page_requests)) { struct RAMSrcPageRequest *entry = QSIMPLEQ_FIRST(&rs->src_page_requests); block = entry->rb; *offset = entry->offse...
13,647
0
static int bands_dist(OpusPsyContext *s, CeltFrame *f, float *total_dist) { int i, tdist = 0.0f; OpusRangeCoder dump; ff_opus_rc_enc_init(&dump); ff_celt_enc_bitalloc(f, &dump); for (i = 0; i < CELT_MAX_BANDS; i++) { float bits = 0.0f; float dist = f->pvq->band_cost(f->pvq, f, &dump, i, &bits, s->lambda); tdist += dist...
13,650
0
static inline void apply_motion_generic(RoqContext *ri, int x, int y, int deltax, int deltay, int sz) { int mx, my, cp; mx = x + deltax; my = y + deltay; /* check MV against frame boundaries */ if ((mx < 0) || (mx > ri->width - sz) || (my < 0) || (my > ri->height - sz)) { av_log(ri->avctx, AV_LOG_ERROR, "motion vector ...
13,651
1
QGuestAllocator *pc_alloc_init(void) { PCAlloc *s = g_malloc0(sizeof(*s)); uint64_t ram_size; QFWCFG *fw_cfg = pc_fw_cfg_init(); s->alloc.alloc = pc_alloc; s->alloc.free = pc_free; ram_size = qfw_cfg_get_u64(fw_cfg, FW_CFG_RAM_SIZE); /* Start at 1MB */ s->start = 1 << 20; /* Respect PCI hole */ s->end = MIN(ram_size, 0...
13,652
1
static int update_error_limit(WavpackFrameContext *ctx) { int i, br[2], sl[2]; for (i = 0; i <= ctx->stereo_in; i++) { if (ctx->ch[i].bitrate_acc > UINT_MAX - ctx->ch[i].bitrate_delta) return AVERROR_INVALIDDATA; ctx->ch[i].bitrate_acc += ctx->ch[i].bitrate_delta; br[i] = ctx->ch[i].bitrate_acc >> 16; sl[i] = LEVEL_DEC...
13,653
1
static void bdrv_co_io_em_complete(void *opaque, int ret) { CoroutineIOCompletion *co = opaque; co->ret = ret; qemu_coroutine_enter(co->coroutine, NULL); }
13,654
1
void HELPER(diag)(CPUS390XState *env, uint32_t r1, uint32_t r3, uint32_t num) { uint64_t r; switch (num) { case 0x500: /* KVM hypercall */ r = s390_virtio_hypercall(env); break; case 0x44: /* yield */ r = 0; break; case 0x308: /* ipl */ handle_diag_308(env, r1, r3); r = 0; break; case 0x288: /* time bomb (watchdog) */ ...
13,655
1
static uint32_t fdctrl_read_data (fdctrl_t *fdctrl) { fdrive_t *cur_drv; uint32_t retval = 0; int pos, len; cur_drv = get_cur_drv(fdctrl); fdctrl->state &= ~FD_CTRL_SLEEP; if (FD_STATE(fdctrl->data_state) == FD_STATE_CMD) { FLOPPY_ERROR("can't read data in CMD state\n"); return 0; } pos = fdctrl->data_pos; if (FD_STATE...
13,656
1
static void scsi_dma_complete(void *opaque, int ret) { SCSIDiskReq *r = (SCSIDiskReq *)opaque; SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev); if (r->req.aiocb != NULL) { r->req.aiocb = NULL; bdrv_acct_done(s->qdev.conf.bs, &r->acct); } if (ret < 0) { if (scsi_handle_rw_error(r, -ret)) { goto done; } } r...
13,657
1
static inline void validate_seg(int seg_reg, int cpl) { int dpl; uint32_t e2; e2 = env->segs[seg_reg].flags; dpl = (e2 >> DESC_DPL_SHIFT) & 3; if (!(e2 & DESC_CS_MASK) || !(e2 & DESC_C_MASK)) { /* data or non conforming code segment */ if (dpl < cpl) { cpu_x86_load_seg_cache(env, seg_reg, 0, 0, 0, 0); } } }
13,658
1
static void realize(DeviceState *d, Error **errp) { sPAPRDRConnector *drc = SPAPR_DR_CONNECTOR(d); sPAPRDRConnectorClass *drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc); Object *root_container; char link_name[256]; gchar *child_name; Error *err = NULL; DPRINTFN("drc realize: %x", drck->get_index(drc)); /* NOTE: we do this as...
13,659
1
connect_to_qemu( const char *host, const char *port ) { struct addrinfo hints; struct addrinfo *server; int ret, sock; sock = qemu_socket(AF_INET, SOCK_STREAM, 0); if (sock < 0) { /* Error */ fprintf(stderr, "Error opening socket!\n"); return -1; } memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = AF_UNSPEC...
13,661
1
void ff_init_block_index(MpegEncContext *s){ //FIXME maybe rename const int linesize = s->current_picture.f.linesize[0]; //not s->linesize as this would be wrong for field pics const int uvlinesize = s->current_picture.f.linesize[1]; const int mb_size= 4; s->block_index[0]= s->b8_stride*(s->mb_y*2 ) - 2 + s->mb_x*2; s-...
13,662
1
static void virtio_net_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); dc->exit = virtio_net_device_exit; dc->props = virtio_net_properties; set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); vdc->init = virtio_net_device_init; vdc-...
13,663
1
static int decode_tile(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile) { int compno, reslevelno, bandno; int x, y; uint8_t *line; Jpeg2000T1Context t1; /* Loop on tile components */ for (compno = 0; compno < s->ncomponents; compno++) { Jpeg2000Component *comp = tile->comp + compno; Jpeg2000CodingStyle *codsty = tile->co...
13,664
1
int bdrv_write_compressed(BlockDriverState *bs, int64_t sector_num, const uint8_t *buf, int nb_sectors) { BlockDriver *drv = bs->drv; if (!drv) return -ENOMEDIUM; if (!drv->bdrv_write_compressed) return -ENOTSUP; if (bdrv_check_request(bs, sector_num, nb_sectors)) return -EIO; if (bs->dirty_tracking) { set_dirty_bitmap...
13,665
1
static void moxie_cpu_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); CPUClass *cc = CPU_CLASS(oc); MoxieCPUClass *mcc = MOXIE_CPU_CLASS(oc); mcc->parent_realize = dc->realize; dc->realize = moxie_cpu_realizefn; mcc->parent_reset = cc->reset; cc->reset = moxie_cpu_reset; cc->class_by_name ...
13,666
1
static int vc1_decode_sprites(VC1Context *v, GetBitContext* gb) { int ret; MpegEncContext *s = &v->s; AVCodecContext *avctx = s->avctx; SpriteData sd; memset(&sd, 0, sizeof(sd)); ret = vc1_parse_sprites(v, gb, &sd); if (ret < 0) return ret; if (!s->current_picture.f->data[0]) { av_log(avctx, AV_LOG_ERROR, "Got no sprit...
13,668
1
yuv2yuvX_altivec_real(int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize, int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize, uint8_t *dest, uint8_t *uDest, uint8_t *vDest, int dstW, int chrDstW) { const vector signed int vini = {(1 << 18), (1 << 18), (1 << 18), (1 << 18)}; register int i, j; { int __attribut...
13,669
1
static void m5206_mbar_writeb(void *opaque, target_phys_addr_t offset, uint32_t value) { m5206_mbar_state *s = (m5206_mbar_state *)opaque; int width; offset &= 0x3ff; if (offset > 0x200) { hw_error("Bad MBAR write offset 0x%x", (int)offset); } width = m5206_mbar_width[offset >> 2]; if (width > 1) { uint32_t tmp; tmp = ...
13,670
1
static bool is_zero_sectors(BlockDriverState *bs, int64_t start, uint32_t count) { int nr; BlockDriverState *file; int64_t res; if (!count) { return true; res = bdrv_get_block_status_above(bs, NULL, start, count, &nr, &file); return res >= 0 && (res & BDRV_BLOCK_ZERO) && nr == count;
13,671
1
static void mxf_write_multi_descriptor(AVFormatContext *s) { MXFContext *mxf = s->priv_data; AVIOContext *pb = s->pb; const uint8_t *ul; int i; mxf_write_metadata_key(pb, 0x014400); PRINT_KEY(s, "multiple descriptor key", pb->buf_ptr - 16); klv_encode_ber_length(pb, 64 + 16 * s->nb_streams); mxf_write_local_tag(pb, 16,...
13,674
1
BlockDeviceInfo *bdrv_block_device_info(BlockDriverState *bs) { BlockDeviceInfo *info = g_malloc0(sizeof(*info)); info->file = g_strdup(bs->filename); info->ro = bs->read_only; info->drv = g_strdup(bs->drv->format_name); info->encrypted = bs->encrypted; info->encryption_key_missing = bdrv_key_required(bs); info->cache ...
13,675
1
void gtk_display_init(DisplayState *ds, bool full_screen, bool grab_on_hover) { GtkDisplayState *s = g_malloc0(sizeof(*s)); char *filename; gtk_init(NULL, NULL); s->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); #if GTK_CHECK_VERSION(3, 2, 0) s->vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); #else s->vbox = gtk_vbox_n...
13,676
0
static int analyze(const uint8_t *buf, int size, int packet_size, int probe) { int stat[TS_MAX_PACKET_SIZE]; int stat_all = 0; int i; int best_score = 0; memset(stat, 0, packet_size * sizeof(*stat)); for (i = 0; i < size - 3; i++) { if (buf[i] == 0x47 && (!probe || (buf[i + 3] & 0x30))) { int x = i % packet_size; stat[...
13,677
1
static void get_tree_codes(uint32_t *bits, int16_t *lens, uint8_t *xlat, Node *nodes, int node, uint32_t pfx, int pl, int *pos) { int s; s = nodes[node].sym; if (s != -1) { bits[*pos] = (~pfx) & ((1U << FFMAX(pl, 1)) - 1); lens[*pos] = FFMAX(pl, 1); xlat[*pos] = s + (pl == 0); (*pos)++; } else { pfx <<= 1; pl++; get_tr...
13,679
0
static int nprobe(AVFormatContext *s, uint8_t *enc_header, unsigned size, const uint8_t *n_val) { OMAContext *oc = s->priv_data; uint64_t pos; uint32_t taglen, datalen; struct AVDES av_des; if (!enc_header || !n_val || size < OMA_ENC_HEADER_SIZE + oc->k_size + 4) return -1; pos = OMA_ENC_HEADER_SIZE + oc->k_size; if (!...
13,680
0
static void fill_block(uint16_t *pdest, uint16_t color, int block_size, int pitch) { int x, y; pitch -= block_size; for (y = 0; y != block_size; y++, pdest += pitch) for (x = 0; x != block_size; x++) *pdest++ = color; }
13,681
0
static void ini_print_section_header(WriterContext *wctx) { INIContext *ini = wctx->priv; AVBPrint buf; int i; const struct section *section = wctx->section[wctx->level]; const struct section *parent_section = wctx->level ? wctx->section[wctx->level-1] : NULL; av_bprint_init(&buf, 1, AV_BPRINT_SIZE_UNLIMITED); if (wctx...
13,682
1
static int vtd_interrupt_remap_msi(IntelIOMMUState *iommu, MSIMessage *origin, MSIMessage *translated) { int ret = 0; VTD_IR_MSIAddress addr; uint16_t index; VTDIrq irq = {0}; assert(origin && translated); if (!iommu || !iommu->intr_enabled) { goto do_not_translate; } if (origin->address & VTD_MSI_ADDR_HI_MASK) { VTD_D...
13,684
1
static int decode_mb_cabac(H264Context *h) { MpegEncContext * const s = &h->s; const int mb_xy= s->mb_x + s->mb_y*s->mb_stride; int mb_type, partition_count, cbp = 0; int dct8x8_allowed= h->pps.transform_8x8_mode; s->dsp.clear_blocks(h->mb); //FIXME avoid if already clear (move after skip handlong?) tprintf(s->avctx, "...
13,685
0
static int mjpegb_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; MJpegDecodeContext *s = avctx->priv_data; const uint8_t *buf_end, *buf_ptr; AVFrame *picture = data; GetBitContext hgb; /* for the header */ uint32_t dqt_off...
13,686
1
static void test_ivshmem_single(void) { IVState state, *s; uint32_t data[1024]; int i; setup_vm(&state); s = &state; /* valid io */ out_reg(s, INTRMASK, 0); in_reg(s, INTRSTATUS); in_reg(s, IVPOSITION); out_reg(s, INTRMASK, 0xffffffff); g_assert_cmpuint(in_reg(s, INTRMASK), ==, 0xffffffff); out_reg(s, INTRSTATUS, 1); /...
13,687
1
static int mov_read_stsz(MOVContext *c, ByteIOContext *pb, MOVAtom atom) { AVStream *st; MOVStreamContext *sc; unsigned int i, entries, sample_size, field_size, num_bytes; GetBitContext gb; unsigned char* buf; if (c->fc->nb_streams < 1) return 0; st = c->fc->streams[c->fc->nb_streams-1]; sc = st->priv_data; get_byte(pb...
13,688
1
static void init_band_stepsize(AVCodecContext *avctx, Jpeg2000Band *band, Jpeg2000CodingStyle *codsty, Jpeg2000QuantStyle *qntsty, int bandno, int gbandno, int reslevelno, int cbps) { /* TODO: Implementation of quantization step not finished, * see ISO/IEC 15444-1:2002 E.1 and A.6.4. */ switch (qntsty->quantsty) { uint...
13,689
1
static int teletext_init_decoder(AVCodecContext *avctx) { TeletextContext *ctx = avctx->priv_data; unsigned int maj, min, rev; vbi_version(&maj, &min, &rev); if (!(maj > 0 || min > 2 || min == 2 && rev >= 26)) { av_log(avctx, AV_LOG_ERROR, "decoder needs zvbi version >= 0.2.26.\n"); return AVERROR_EXTERNAL; } if (ctx->...
13,690
1
static void block_job_ref(BlockJob *job) { ++job->refcnt; }
13,691
1
static void empty_input(void) { const char *empty = ""; QObject *obj = qobject_from_json(empty, NULL); g_assert(obj == NULL); }
13,692
1
static FlatRange *address_space_lookup(AddressSpace *as, AddrRange addr) { return bsearch(&addr, as->current_map.ranges, as->current_map.nr, sizeof(FlatRange), cmp_flatrange_addr); }
13,693
1
void ff_get_guid(AVIOContext *s, ff_asf_guid *g) { assert(sizeof(*g) == 16); avio_read(s, *g, sizeof(*g)); }
13,694
1
static int realloc_refcount_array(BDRVQcowState *s, uint16_t **array, int64_t *size, int64_t new_size) { size_t old_byte_size, new_byte_size; uint16_t *new_ptr; /* Round to clusters so the array can be directly written to disk */ old_byte_size = size_to_clusters(s, refcount_array_byte_size(s, *size)) * s->cluster_size;...
13,695
1
static void imdct36(int *out, int *buf, int *in, int *win) { int i, j, t0, t1, t2, t3, s0, s1, s2, s3; int tmp[18], *tmp1, *in1; for(i=17;i>=1;i--) in[i] += in[i-1]; for(i=17;i>=3;i-=2) in[i] += in[i-2]; for(j=0;j<2;j++) { tmp1 = tmp + j; in1 = in + j; #if 0 //more accurate but slower int64_t t0, t1, t2, t3; t2 = in1[2...
13,696
1
static void test_tco_second_timeout_none(void) { TestData td; const uint16_t ticks = TCO_SECS_TO_TICKS(256); QDict *ad; td.args = "-watchdog-action none"; td.noreboot = false; test_init(&td); stop_tco(&td); clear_tco_status(&td); reset_on_second_timeout(true); set_tco_timeout(&td, ticks); load_tco(&td); start_tco(&td);...
13,697
1
static void pcx_palette(const uint8_t **src, uint32_t *dst, unsigned int pallen) { unsigned int i; for (i = 0; i < pallen; i++) *dst++ = bytestream_get_be24(src); if (pallen < 256) memset(dst, 0, (256 - pallen) * sizeof(*dst)); }
13,698
1
int qemu_set_fd_handler2(int fd, IOCanReadHandler *fd_read_poll, IOHandler *fd_read, IOHandler *fd_write, void *opaque) { IOHandlerRecord *ioh; if (!fd_read && !fd_write) { QLIST_FOREACH(ioh, &io_handlers, next) { if (ioh->fd == fd) { ioh->deleted = 1; break; } } } else { QLIST_FOREACH(ioh, &io_handlers, next) { if (io...
13,699
1
static int bdrv_prwv_co(BdrvChild *child, int64_t offset, QEMUIOVector *qiov, bool is_write, BdrvRequestFlags flags) { Coroutine *co; RwCo rwco = { .child = child, .offset = offset, .qiov = qiov, .is_write = is_write, .ret = NOT_DONE, .flags = flags, }; if (qemu_in_coroutine()) { /* Fast-path if already in coroutine co...
13,700
1
static void setup_frame(int sig, struct target_sigaction *ka, target_sigset_t *set, CPUM68KState *env) { struct target_sigframe *frame; abi_ulong frame_addr; abi_ulong retcode_addr; abi_ulong sc_addr; int err = 0; int i; frame_addr = get_sigframe(ka, env, sizeof *frame); if (!lock_user_struct(VERIFY_WRITE, frame, frame...
13,701
1
static void openrisc_cpu_realizefn(DeviceState *dev, Error **errp) { OpenRISCCPU *cpu = OPENRISC_CPU(dev); OpenRISCCPUClass *occ = OPENRISC_CPU_GET_CLASS(dev); cpu_reset(CPU(cpu)); occ->parent_realize(dev, errp); }
13,702
1
void net_rx_pkt_attach_iovec(struct NetRxPkt *pkt, const struct iovec *iov, int iovcnt, size_t iovoff, bool strip_vlan) { uint16_t tci = 0; uint16_t ploff = iovoff; assert(pkt); pkt->vlan_stripped = false; if (strip_vlan) { pkt->vlan_stripped = eth_strip_vlan(iov, iovcnt, iovoff, pkt->ehdr_buf, &ploff, &tci); } pkt->tc...
13,703
1
static inline void RENAME(yuy2ToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *unused) { #if COMPILE_TEMPLATE_MMX __asm__ volatile( "movq "MANGLE(bm01010101)", %%mm4 \n\t" "mov %0, %%"REG_a" \n\t" "1: \n\t" "movq (%1, %%"REG_a",4), %%mm0 \n\t" "movq 8(%1, %%"REG_a",4), ...
13,704
1
static void qemu_rbd_complete_aio(RADOSCB *rcb) { RBDAIOCB *acb = rcb->acb; int64_t r; r = rcb->ret; if (acb->cmd != RBD_AIO_READ) { if (r < 0) { acb->ret = r; acb->error = 1; } else if (!acb->error) { acb->ret = rcb->size; } } else { if (r < 0) { memset(rcb->buf, 0, rcb->size); acb->ret = r; acb->error = 1; } else if ...
13,705
1
static void scsi_disk_set_sense(SCSIDiskState *s, uint8_t key) { s->sense.key = key; }
13,707