label int64 0 1 | func1 stringlengths 23 97k | id int64 0 27.3k |
|---|---|---|
1 | static int lavfi_read_packet(AVFormatContext *avctx, AVPacket *pkt) { LavfiContext *lavfi = avctx->priv_data; double min_pts = DBL_MAX; int stream_idx, min_pts_sink_idx = 0; AVFilterBufferRef *ref; AVPicture pict; int ret, i; int size = 0; /* iterate through all the graph sinks. Select the sink with the * minimum PTS *... | 24,240 |
1 | static inline void qtrle_decode_2n4bpp(QtrleContext *s, int stream_ptr, int row_ptr, int lines_to_change, int bpp) { int rle_code, i; int pixel_ptr; int row_inc = s->frame.linesize[0]; unsigned char pi[16]; /* 16 palette indices */ unsigned char *rgb = s->frame.data[0]; int pixel_limit = s->frame.linesize[0] * s->avctx... | 24,241 |
1 | static void display_picref(AVFilterBufferRef *picref, AVRational time_base) { int x, y; uint8_t *p0, *p; int64_t delay; if (picref->pts != AV_NOPTS_VALUE) { if (last_pts != AV_NOPTS_VALUE) { /* sleep roughly the right amount of time; * usleep is in microseconds, just like AV_TIME_BASE. */ delay = av_rescale_q(picref->p... | 24,242 |
1 | static int colo_packet_compare_udp(Packet *spkt, Packet *ppkt) { int ret; int network_header_length = ppkt->ip->ip_hl * 4; trace_colo_compare_main("compare udp"); /* * Because of ppkt and spkt are both in the same connection, * The ppkt's src ip, dst ip, src port, dst port, ip_proto all are * same with spkt. In additio... | 24,243 |
1 | void vga_mem_writeb(VGACommonState *s, hwaddr addr, uint32_t val) { int memory_map_mode, plane, write_mode, b, func_select, mask; uint32_t write_mask, bit_mask, set_mask; #ifdef DEBUG_VGA_MEM printf("vga: [0x" TARGET_FMT_plx "] = 0x%02x\n", addr, val); #endif /* convert to VGA memory offset */ memory_map_mode = (s->gr[... | 24,245 |
1 | static int read_channel_params(MLPDecodeContext *m, unsigned int substr, GetBitContext *gbp, unsigned int ch) { SubStream *s = &m->substream[substr]; ChannelParams *cp = &s->channel_params[ch]; FilterParams *fir = &cp->filter_params[FIR]; FilterParams *iir = &cp->filter_params[IIR]; int ret; if (s->param_presence_flags... | 24,246 |
1 | static int wsvqa_read_packet(AVFormatContext *s, AVPacket *pkt) { WsVqaDemuxContext *wsvqa = s->priv_data; AVIOContext *pb = s->pb; int ret = -1; unsigned char preamble[VQA_PREAMBLE_SIZE]; unsigned int chunk_type; unsigned int chunk_size; int skip_byte; while (avio_read(pb, preamble, VQA_PREAMBLE_SIZE) == VQA_PREAMBLE_... | 24,247 |
0 | static int create_filter(AVFilterContext **filt_ctx, AVFilterGraph *ctx, int index, const char *filt_name, const char *args, void *log_ctx) { AVFilter *filt; char inst_name[30]; char tmp_args[256]; int ret; snprintf(inst_name, sizeof(inst_name), "Parsed_%s_%d", filt_name, index); filt = avfilter_get_by_name(filt_name);... | 24,248 |
0 | static void flush_packet(AVFormatContext *ctx, int stream_index, int64_t pts, int64_t dts, int64_t scr) { MpegMuxContext *s = ctx->priv_data; StreamInfo *stream = ctx->streams[stream_index]->priv_data; uint8_t *buf_ptr; int size, payload_size, startcode, id, stuffing_size, i, header_len; int packet_size; uint8_t buffer... | 24,249 |
0 | void ff_xvmc_init_block(MpegEncContext *s) { struct xvmc_pix_fmt *render = (struct xvmc_pix_fmt*)s->current_picture.f->data[2]; assert(render && render->xvmc_id == AV_XVMC_ID); s->block = (int16_t (*)[64])(render->data_blocks + render->next_free_data_block_num * 64); } | 24,250 |
0 | static inline void set_p_mv_tables(MpegEncContext * s, int mx, int my) { const int xy= s->mb_x + 1 + (s->mb_y + 1)*(s->mb_width + 2); s->p_mv_table[xy][0] = mx; s->p_mv_table[xy][1] = my; /* has allready been set to the 4 MV if 4MV is done */ if(!(s->flags&CODEC_FLAG_4MV)){ int mot_xy= s->block_index[0]; s->motion_val[... | 24,252 |
0 | static int hds_flush(AVFormatContext *s, OutputStream *os, int final, int64_t end_ts) { HDSContext *c = s->priv_data; int i, ret = 0; char target_filename[1024]; int index = s->streams[os->first_stream]->id; if (!os->packets_written) return 0; avio_flush(os->ctx->pb); os->packets_written = 0; close_file(os); snprintf(t... | 24,253 |
1 | build_dsdt(GArray *table_data, GArray *linker, AcpiPmInfo *pm, AcpiMiscInfo *misc, PcPciInfo *pci, MachineState *machine) { CrsRangeEntry *entry; Aml *dsdt, *sb_scope, *scope, *dev, *method, *field, *pkg, *crs; GPtrArray *mem_ranges = g_ptr_array_new_with_free_func(crs_range_free); GPtrArray *io_ranges = g_ptr_array_ne... | 24,254 |
1 | static void init_input_filter(FilterGraph *fg, AVFilterInOut *in) { InputStream *ist; enum AVMediaType type = avfilter_pad_get_type(in->filter_ctx->input_pads, in->pad_idx); int i; // TODO: support other filter types if (type != AVMEDIA_TYPE_VIDEO && type != AVMEDIA_TYPE_AUDIO) { av_log(NULL, AV_LOG_FATAL, "Only video ... | 24,255 |
1 | static inline void RENAME(yuy2ToY)(uint8_t *dst, uint8_t *src, int width) { #ifdef HAVE_MMX asm volatile( "movq "MANGLE(bm01010101)", %%mm2\n\t" "mov %0, %%"REG_a" \n\t" "1: \n\t" "movq (%1, %%"REG_a",2), %%mm0 \n\t" "movq 8(%1, %%"REG_a",2), %%mm1 \n\t" "pand %%mm2, %%mm0 \n\t" "pand %%mm2, %%mm1 \n\t" "packuswb %%mm1... | 24,256 |
1 | static void print_pte(Monitor *mon, uint32_t addr, uint32_t pte, uint32_t mask) { monitor_printf(mon, "%08x: %08x %c%c%c%c%c%c%c%c\n", addr, pte & mask, pte & PG_GLOBAL_MASK ? 'G' : '-', pte & PG_PSE_MASK ? 'P' : '-', pte & PG_DIRTY_MASK ? 'D' : '-', pte & PG_ACCESSED_MASK ? 'A' : '-', pte & PG_PCD_MASK ? 'C' : '-', pt... | 24,257 |
1 | av_cold void ff_msmpeg4_encode_init(MpegEncContext *s) { static int init_done=0; int i; common_init(s); if(s->msmpeg4_version>=4){ s->min_qcoeff= -255; s->max_qcoeff= 255; } if (!init_done) { /* init various encoding tables */ init_done = 1; init_mv_table(&mv_tables[0]); init_mv_table(&mv_tables[1]); for(i=0;i<NB_RL_TA... | 24,258 |
1 | av_cold void ff_init_range_decoder(RangeCoder *c, const uint8_t *buf, int buf_size) { /* cast to avoid compiler warning */ ff_init_range_encoder(c, (uint8_t *)buf, buf_size); c->low = AV_RB16(c->bytestream); c->bytestream += 2; | 24,259 |
1 | static void gen_load_exclusive(DisasContext *s, int rt, int rt2, TCGv addr, int size) { TCGv tmp; switch (size) { case 0: tmp = gen_ld8u(addr, IS_USER(s)); break; case 1: tmp = gen_ld16u(addr, IS_USER(s)); break; case 2: case 3: tmp = gen_ld32(addr, IS_USER(s)); break; default: abort(); } tcg_gen_mov_i32(cpu_exclusive_... | 24,260 |
1 | static int vcr1_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; VCR1Context *const a = avctx->priv_data; AVFrame *const p = data; const uint8_t *bytestream = buf; int i, x, y, ret; if ((ret = ff_get_buffer(avctx, p, 0)) < 0... | 24,261 |
1 | static inline 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_PTR, TCG_REG_I0, args[0]); tcg_out32(s, JMPL | INSN_RD(TCG_REG_G0) | INSN_RS1(TCG_REG_I7) | INSN_IMM13(8)); tcg_out32(s, RESTORE | INSN_RD(TCG_RE... | 24,262 |
1 | static void sbr_hf_inverse_filter(SBRDSPContext *dsp, int (*alpha0)[2], int (*alpha1)[2], const int X_low[32][40][2], int k0) { int k; int shift, round; for (k = 0; k < k0; k++) { SoftFloat phi[3][2][2]; SoftFloat a00, a01, a10, a11; SoftFloat dk; dsp->autocorrelate(X_low[k], phi); dk = av_sub_sf(av_mul_sf(phi[2][1][0]... | 24,263 |
1 | void nbd_client_session_close(NbdClientSession *client) { if (!client->bs) { return; } nbd_teardown_connection(client); client->bs = NULL; } | 24,264 |
1 | static void v9fs_rename(void *opaque) { int32_t fid; ssize_t err = 0; size_t offset = 7; V9fsString name; int32_t newdirfid; V9fsFidState *fidp; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; v9fs_string_init(&name); err = pdu_unmarshal(pdu, offset, "dds", &fid, &newdirfid, &name); if (err < 0) { fidp = get_fid(pdu, fid... | 24,265 |
0 | static int open_in(HLSContext *c, AVIOContext **in, const char *url) { AVDictionary *tmp = NULL; int ret; av_dict_copy(&tmp, c->avio_opts, 0); ret = avio_open2(in, url, AVIO_FLAG_READ, c->interrupt_callback, &tmp); av_dict_free(&tmp); return ret; } | 24,266 |
0 | static int mov_write_trak_tag(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track, AVStream *st) { int64_t pos = avio_tell(pb); avio_wb32(pb, 0); /* size */ ffio_wfourcc(pb, "trak"); mov_write_tkhd_tag(pb, track, st); if (supports_edts(mov)) mov_write_edts_tag(pb, track); // PSP Movies and several other cases require ... | 24,267 |
0 | static int write_extradata(FFV1Context *f) { RangeCoder *const c = &f->c; uint8_t state[CONTEXT_SIZE]; int i, j, k; uint8_t state2[32][CONTEXT_SIZE]; unsigned v; memset(state2, 128, sizeof(state2)); memset(state, 128, sizeof(state)); f->avctx->extradata_size = 10000 + 4 + (11 * 11 * 5 * 5 * 5 + 11 * 11 * 11) * 32; f->a... | 24,268 |
0 | static int mpeg4_decode_gop_header(MpegEncContext * s, GetBitContext *gb){ int hours, minutes, seconds; if(!show_bits(gb, 18)){ av_log(s->avctx, AV_LOG_WARNING, "GOP header invalid\n"); return -1; } hours= get_bits(gb, 5); minutes= get_bits(gb, 6); skip_bits1(gb); seconds= get_bits(gb, 6); s->time_base= seconds + 60*(m... | 24,270 |
1 | static void init_vlcs(ASV1Context *a){ static int done = 0; if (!done) { done = 1; init_vlc(&ccp_vlc, VLC_BITS, 17, &ccp_tab[0][1], 2, 1, &ccp_tab[0][0], 2, 1); init_vlc(&dc_ccp_vlc, VLC_BITS, 8, &dc_ccp_tab[0][1], 2, 1, &dc_ccp_tab[0][0], 2, 1); init_vlc(&ac_ccp_vlc, VLC_BITS, 16, &ac_ccp_tab[0][1], 2, 1, &ac_ccp_tab[... | 24,271 |
1 | static int applehttp_close(URLContext *h) { AppleHTTPContext *s = h->priv_data; free_segment_list(s); free_variant_list(s); ffurl_close(s->seg_hd); av_free(s); return 0; } | 24,272 |
1 | int swri_dither_init(SwrContext *s, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt) { int i; double scale = 0; if (s->dither.method > SWR_DITHER_TRIANGULAR_HIGHPASS && s->dither.method <= SWR_DITHER_NS) return AVERROR(EINVAL); out_fmt = av_get_packed_sample_fmt(out_fmt); in_fmt = av_get_packed_sample_fmt( in_f... | 24,273 |
1 | int qemu_pixman_get_type(int rshift, int gshift, int bshift) { int type = PIXMAN_TYPE_OTHER; if (rshift > gshift && gshift > bshift) { if (bshift == 0) { type = PIXMAN_TYPE_ARGB; } else { type = PIXMAN_TYPE_RGBA; } } else if (rshift < gshift && gshift < bshift) { if (rshift == 0) { type = PIXMAN_TYPE_ABGR; } else { typ... | 24,274 |
1 | static int prom_init1(SysBusDevice *dev) { PROMState *s = OPENPROM(dev); memory_region_init_ram(&s->prom, OBJECT(s), "sun4m.prom", PROM_SIZE_MAX, &error_abort); vmstate_register_ram_global(&s->prom); memory_region_set_readonly(&s->prom, true); sysbus_init_mmio(dev, &s->prom); return 0; } | 24,275 |
1 | void helper_lswx(CPUPPCState *env, target_ulong addr, uint32_t reg, uint32_t ra, uint32_t rb) { if (likely(xer_bc != 0)) { if (unlikely((ra != 0 && reg < ra && (reg + xer_bc) > ra) || (reg < rb && (reg + xer_bc) > rb))) { helper_raise_exception_err(env, POWERPC_EXCP_PROGRAM, POWERPC_EXCP_INVAL | POWERPC_EXCP_INVAL_LSWX... | 24,276 |
0 | static void h264_v_loop_filter_luma_intra_c(uint8_t *pix, int stride, int alpha, int beta) { h264_loop_filter_luma_intra_c(pix, stride, 1, alpha, beta); } | 24,277 |
1 | mips_mipssim_init(MachineState *machine) { ram_addr_t ram_size = machine->ram_size; const char *cpu_model = machine->cpu_model; const char *kernel_filename = machine->kernel_filename; const char *kernel_cmdline = machine->kernel_cmdline; const char *initrd_filename = machine->initrd_filename; char *filename; MemoryRegi... | 24,278 |
1 | SDState *sd_init(BlockDriverState *bs, bool is_spi) { SDState *sd; if (bdrv_is_read_only(bs)) { fprintf(stderr, "sd_init: Cannot use read-only drive\n"); return NULL; } sd = (SDState *) g_malloc0(sizeof(SDState)); sd->buf = qemu_blockalign(bs, 512); sd->spi = is_spi; sd->enable = true; sd_reset(sd, bs); if (sd->bdrv) {... | 24,279 |
1 | static coroutine_fn int qcow2_co_preadv(BlockDriverState *bs, uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags) { BDRVQcow2State *s = bs->opaque; int offset_in_cluster, n1; int ret; unsigned int cur_bytes; /* number of bytes in current iteration */ uint64_t cluster_offset = 0; uint64_t bytes_done = 0; QEM... | 24,281 |
1 | static void gen_div(DisasContext *dc, TCGv dest, TCGv srca, TCGv srcb) { TCGv sr_ov = tcg_temp_new(); TCGv t0 = tcg_temp_new(); tcg_gen_setcondi_tl(TCG_COND_EQ, sr_ov, srcb, 0); /* The result of divide-by-zero is undefined. Supress the host-side exception by dividing by 1. */ tcg_gen_or_tl(t0, srcb, sr_ov); tcg_gen_div... | 24,282 |
0 | static inline void decode_subblock3(DCTELEM *dst, int code, const int is_block2, GetBitContext *gb, VLC *vlc, int q_dc, int q_ac1, int q_ac2) { int coeffs[4]; coeffs[0] = modulo_three_table[code][0]; coeffs[1] = modulo_three_table[code][1]; coeffs[2] = modulo_three_table[code][2]; coeffs[3] = modulo_three_table[code][3... | 24,284 |
0 | static int mm_probe(AVProbeData *p) { /* the first chunk is always the header */ if (p->buf_size < MM_PREAMBLE_SIZE) return 0; if (AV_RL16(&p->buf[0]) != MM_TYPE_HEADER) return 0; if (AV_RL32(&p->buf[2]) != MM_HEADER_LEN_V && AV_RL32(&p->buf[2]) != MM_HEADER_LEN_AV) return 0; /* only return half certainty since this ch... | 24,286 |
0 | static int tcp_write_packet(AVFormatContext *s, RTSPStream *rtsp_st) { RTSPState *rt = s->priv_data; AVFormatContext *rtpctx = rtsp_st->transport_priv; uint8_t *buf, *ptr; int size; uint8_t *interleave_header, *interleaved_packet; size = avio_close_dyn_buf(rtpctx->pb, &buf); ptr = buf; while (size > 4) { uint32_t packe... | 24,287 |
0 | static int find_and_decode_index(NUTContext *nut){ AVFormatContext *s= nut->avf; ByteIOContext *bc = s->pb; uint64_t tmp, end; int i, j, syncpoint_count; int64_t filesize= url_fsize(bc); int64_t *syncpoints; int8_t *has_keyframe; url_fseek(bc, filesize-12, SEEK_SET); url_fseek(bc, filesize-get_be64(bc), SEEK_SET); if(g... | 24,288 |
1 | static int dump_ppc_insns (CPUPPCState *env) { opc_handler_t **table, *handler; uint8_t opc1, opc2, opc3; printf("Instructions set:\n"); /* opc1 is 6 bits long */ for (opc1 = 0x00; opc1 < 0x40; opc1++) { table = env->opcodes; handler = table[opc1]; if (is_indirect_opcode(handler)) { /* opc2 is 5 bits long */ for (opc2 ... | 24,293 |
1 | static int get_packet_size(const uint8_t *buf, int size) { int score, fec_score, dvhs_score; if (size < (TS_FEC_PACKET_SIZE * 5 + 1)) return AVERROR_INVALIDDATA; score = analyze(buf, size, TS_PACKET_SIZE, NULL); dvhs_score = analyze(buf, size, TS_DVHS_PACKET_SIZE, NULL); fec_score = analyze(buf, size, TS_FEC_PACKET_SIZ... | 24,295 |
1 | static void matroska_execute_seekhead(MatroskaDemuxContext *matroska) { EbmlList *seekhead_list = &matroska->seekhead; MatroskaSeekhead *seekhead = seekhead_list->elem; int64_t before_pos = avio_tell(matroska->ctx->pb); int i; // we should not do any seeking in the streaming case if (!matroska->ctx->pb->seekable || (ma... | 24,296 |
1 | static inline void do_rfi(CPUPPCState *env, target_ulong nip, target_ulong msr, target_ulong msrm, int keep_msrh) { CPUState *cs = CPU(ppc_env_get_cpu(env)); #if defined(TARGET_PPC64) if (msr_is_64bit(env, msr)) { nip = (uint64_t)nip; msr &= (uint64_t)msrm; } else { nip = (uint32_t)nip; msr = (uint32_t)(msr & msrm); if... | 24,297 |
1 | static void mmio_interface_realize(DeviceState *dev, Error **errp) { MMIOInterface *s = MMIO_INTERFACE(dev); DPRINTF("realize from 0x%" PRIX64 " to 0x%" PRIX64 " map host pointer" " %p\n", s->start, s->end, s->host_ptr); if (!s->host_ptr) { error_setg(errp, "host_ptr property must be set"); } if (!s->subregion) { error... | 24,298 |
1 | static void load_cursor(VmncContext *c, const uint8_t *src) { int i, j, p; const int bpp = c->bpp2; uint8_t *dst8 = c->curbits; uint16_t *dst16 = (uint16_t *)c->curbits; uint32_t *dst32 = (uint32_t *)c->curbits; for (j = 0; j < c->cur_h; j++) { for (i = 0; i < c->cur_w; i++) { p = vmnc_get_pixel(src, bpp, c->bigendian)... | 24,299 |
1 | PCIDevice *pci_ne2000_init(PCIBus *bus, NICInfo *nd, int devfn) { PCINE2000State *d; NE2000State *s; uint8_t *pci_conf; d = (PCINE2000State *)pci_register_device(bus, "NE2000", sizeof(PCINE2000State), devfn, NULL, NULL); pci_conf = d->dev.config; pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_REALTEK); pci_config_set... | 24,300 |
0 | av_cold void ff_dsputil_init(DSPContext* c, AVCodecContext *avctx) { int i, j; ff_check_alignment(); #if CONFIG_ENCODERS if (avctx->bits_per_raw_sample == 10) { c->fdct = ff_jpeg_fdct_islow_10; c->fdct248 = ff_fdct248_islow_10; } else { if(avctx->dct_algo==FF_DCT_FASTINT) { c->fdct = ff_fdct_ifast; c->fdct248 = ff_fdct... | 24,301 |
0 | static int dash_flush(AVFormatContext *s, int final, int stream) { DASHContext *c = s->priv_data; int i, ret = 0; const char *proto = avio_find_protocol_name(s->filename); int use_rename = proto && !strcmp(proto, "file"); int cur_flush_segment_index = 0; if (stream >= 0) cur_flush_segment_index = c->streams[stream].seg... | 24,302 |
0 | static int stream_set_speed(BlockJob *job, int64_t value) { StreamBlockJob *s = container_of(job, StreamBlockJob, common); if (value < 0) { return -EINVAL; } ratelimit_set_speed(&s->limit, value / BDRV_SECTOR_SIZE); return 0; } | 24,303 |
0 | static void cirrus_update_memory_access(CirrusVGAState *s) { unsigned mode; if ((s->sr[0x17] & 0x44) == 0x44) { goto generic_io; } else if (s->cirrus_srcptr != s->cirrus_srcptr_end) { goto generic_io; } else { if ((s->gr[0x0B] & 0x14) == 0x14) { goto generic_io; } else if (s->gr[0x0B] & 0x02) { goto generic_io; } mode ... | 24,304 |
0 | void put_pixels16_xy2_altivec(uint8_t * block, const uint8_t * pixels, int line_size, int h) { POWERPC_TBL_DECLARE(altivec_put_pixels16_xy2_num, 1); #ifdef ALTIVEC_USE_REFERENCE_C_CODE int j; POWERPC_TBL_START_COUNT(altivec_put_pixels16_xy2_num, 1); for (j = 0; j < 4; j++) { int i; const uint32_t a = (((const struct un... | 24,305 |
0 | static void omap_lpg_update(struct omap_lpg_s *s) { int64_t on, period = 1, ticks = 1000; static const int per[8] = { 1, 2, 4, 8, 12, 16, 20, 24 }; if (~s->control & (1 << 6)) /* LPGRES */ on = 0; else if (s->control & (1 << 7)) /* PERM_ON */ on = period; else { period = muldiv64(ticks, per[s->control & 7], /* PERCTRL ... | 24,306 |
0 | START_TEST(vararg_number) { QObject *obj; QInt *qint; QFloat *qfloat; int value = 0x2342; int64_t value64 = 0x2342342343LL; double valuef = 2.323423423; obj = qobject_from_jsonf("%d", value); fail_unless(obj != NULL); fail_unless(qobject_type(obj) == QTYPE_QINT); qint = qobject_to_qint(obj); fail_unless(qint_get_int(qi... | 24,307 |
0 | static int kvm_sclp_service_call(S390CPU *cpu, struct kvm_run *run, uint16_t ipbh0) { CPUS390XState *env = &cpu->env; uint32_t sccb; uint64_t code; int r = 0; cpu_synchronize_state(CPU(cpu)); if (env->psw.mask & PSW_MASK_PSTATE) { enter_pgmcheck(cpu, PGM_PRIVILEGED); return 0; } sccb = env->regs[ipbh0 & 0xf]; code = en... | 24,310 |
0 | static int qcow2_check(BlockDriverState *bs, BdrvCheckResult *result) { return qcow2_check_refcounts(bs, result); } | 24,313 |
0 | static void qemu_tcg_init_vcpu(CPUState *cpu) { char thread_name[VCPU_THREAD_NAME_SIZE]; static QemuCond *tcg_halt_cond; static QemuThread *tcg_cpu_thread; tcg_cpu_address_space_init(cpu, cpu->as); /* share a single thread for all cpus with TCG */ if (!tcg_cpu_thread) { cpu->thread = g_malloc0(sizeof(QemuThread)); cpu-... | 24,314 |
0 | AVChapter *ff_new_chapter(AVFormatContext *s, int id, AVRational time_base, int64_t start, int64_t end, const char *title) { AVChapter *chapter = NULL; int i; for(i=0; i<s->nb_chapters; i++) if(s->chapters[i]->id == id) chapter = s->chapters[i]; if(!chapter){ chapter= av_mallocz(sizeof(AVChapter)); if(!chapter) return ... | 24,316 |
0 | int bdrv_pread(BlockDriverState *bs, int64_t offset, void *buf, int bytes) { QEMUIOVector qiov; struct iovec iov = { .iov_base = (void *)buf, .iov_len = bytes, }; int ret; if (bytes < 0) { return -EINVAL; } qemu_iovec_init_external(&qiov, &iov, 1); ret = bdrv_prwv_co(bs, offset, &qiov, false, 0); if (ret < 0) { return ... | 24,317 |
0 | static void gen_dmtc0(DisasContext *ctx, TCGv arg, int reg, int sel) { const char *rn = "invalid"; if (sel != 0) check_insn(ctx, ISA_MIPS64); if (use_icount) gen_io_start(); switch (reg) { case 0: switch (sel) { case 0: gen_helper_mtc0_index(cpu_env, arg); rn = "Index"; break; case 1: CP0_CHECK(ctx->insn_flags & ASE_MT... | 24,319 |
0 | void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi, ISADevice **rtc_state, bool create_fdctrl, bool no_vmport, uint32 hpet_irqs) { int i; DriveInfo *fd[MAX_FD]; DeviceState *hpet = NULL; int pit_isa_irq = 0; qemu_irq pit_alt_irq = NULL; qemu_irq rtc_irq = NULL; qemu_irq *a20_line; ISADevice *i8042, *port92, *vmmo... | 24,321 |
0 | static int qemu_gluster_parseuri(GlusterConf *gconf, const char *filename) { URI *uri; QueryParams *qp = NULL; bool is_unix = false; int ret = 0; uri = uri_parse(filename); if (!uri) { return -EINVAL; } /* transport */ if (!strcmp(uri->scheme, "gluster")) { gconf->transport = g_strdup("tcp"); } else if (!strcmp(uri->sc... | 24,322 |
0 | static void omap_prcm_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { struct omap_prcm_s *s = (struct omap_prcm_s *) opaque; if (size != 4) { omap_badwidth_write32(opaque, addr, value); return; } switch (addr) { case 0x000: /* PRCM_REVISION */ case 0x054: /* PRCM_VOLTST */ case 0x084: /* PRCM_CLKCFG_S... | 24,323 |
0 | int kvm_arch_init(KVMState *s, int smp_cpus) { int ret; struct utsname utsname; uname(&utsname); lm_capable_kernel = strcmp(utsname.machine, "x86_64") == 0; /* create vm86 tss. KVM uses vm86 mode to emulate 16-bit code * directly. In order to use vm86 mode, a TSS is needed. Since this * must be part of guest physical m... | 24,324 |
0 | static void bootp_reply(Slirp *slirp, const struct bootp_t *bp) { BOOTPClient *bc = NULL; struct mbuf *m; struct bootp_t *rbp; struct sockaddr_in saddr, daddr; struct in_addr preq_addr; int dhcp_msg_type, val; uint8_t *q; uint8_t client_ethaddr[ETH_ALEN]; /* extract exact DHCP msg type */ dhcp_decode(bp, &dhcp_msg_type... | 24,325 |
1 | static void hmp_logfile(Monitor *mon, const QDict *qdict) { qemu_set_log_filename(qdict_get_str(qdict, "filename")); } | 24,327 |
1 | iscsi_abort_task_cb(struct iscsi_context *iscsi, int status, void *command_data, void *private_data) { IscsiAIOCB *acb = (IscsiAIOCB *)private_data; scsi_free_scsi_task(acb->task); acb->task = NULL; } | 24,329 |
1 | int bdrv_all_delete_snapshot(const char *name, BlockDriverState **first_bad_bs, Error **err) { int ret = 0; BlockDriverState *bs; BdrvNextIterator *it = NULL; QEMUSnapshotInfo sn1, *snapshot = &sn1; while (ret == 0 && (it = bdrv_next(it, &bs))) { AioContext *ctx = bdrv_get_aio_context(bs); aio_context_acquire(ctx); if ... | 24,330 |
0 | int ff_hevc_split_packet(HEVCContext *s, HEVCPacket *pkt, const uint8_t *buf, int length, AVCodecContext *avctx, int is_nalff, int nal_length_size) { int consumed, ret = 0; pkt->nb_nals = 0; while (length >= 4) { HEVCNAL *nal; int extract_length = 0; if (is_nalff) { int i; for (i = 0; i < nal_length_size; i++) extract_... | 24,332 |
1 | static int nvme_start_ctrl(NvmeCtrl *n) { uint32_t page_bits = NVME_CC_MPS(n->bar.cc) + 12; uint32_t page_size = 1 << page_bits; if (n->cq[0] || n->sq[0] || !n->bar.asq || !n->bar.acq || n->bar.asq & (page_size - 1) || n->bar.acq & (page_size - 1) || NVME_CC_MPS(n->bar.cc) < NVME_CAP_MPSMIN(n->bar.cap) || NVME_CC_MPS(n... | 24,333 |
1 | 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... | 24,335 |
1 | void qemu_aio_wait_end(void) { } | 24,337 |
1 | void avfilter_register_all(void) { static int initialized; if (initialized) return; initialized = 1; REGISTER_FILTER (ACONVERT, aconvert, af); REGISTER_FILTER (AFIFO, afifo, af); REGISTER_FILTER (AFORMAT, aformat, af); REGISTER_FILTER (AMERGE, amerge, af); REGISTER_FILTER (AMIX, amix, af); REGISTER_FILTER (ANULL, anull... | 24,338 |
0 | void show_banner(void) { fprintf(stderr, "%s version " FFMPEG_VERSION ", Copyright (c) %d-%d the FFmpeg developers\n", program_name, program_birth_year, this_year); fprintf(stderr, " built on %s %s with %s %s\n", __DATE__, __TIME__, CC_TYPE, CC_VERSION); fprintf(stderr, " configuration: " FFMPEG_CONFIGURATION "\n"); pr... | 24,341 |
0 | static int decode_delta_block (bit_buffer_t *bitbuf, uint8_t *current, uint8_t *previous, int pitch, svq1_pmv_t *motion, int x, int y) { uint32_t bit_cache; uint32_t block_type; int result = 0; /* get block type */ bit_cache = get_bit_cache (bitbuf); bit_cache >>= (32 - 3); block_type = block_type_table[bit_cache].valu... | 24,342 |
1 | static int pci_ich9_uninit(PCIDevice *dev) { struct AHCIPCIState *d; d = DO_UPCAST(struct AHCIPCIState, card, dev); if (msi_enabled(dev)) { msi_uninit(dev); } qemu_unregister_reset(ahci_reset, d); ahci_uninit(&d->ahci); return 0; } | 24,343 |
0 | void powerpc_display_perf_report(void) { int i; #ifndef POWERPC_PERF_USE_PMC fprintf(stderr, "PowerPC performance report\n Values are from the Time Base register, and represent 4 bus cycles.\n"); #else /* POWERPC_PERF_USE_PMC */ fprintf(stderr, "PowerPC performance report\n Values are from the PMC registers, and repres... | 24,344 |
1 | void ccw_dstream_init(CcwDataStream *cds, CCW1 const *ccw, ORB const *orb) { /* * We don't support MIDA (an optional facility) yet and we * catch this earlier. Just for expressing the precondition. */ g_assert(!(orb->ctrl1 & ORB_CTRL1_MASK_MIDAW)); cds->flags = (orb->ctrl0 & ORB_CTRL0_MASK_I2K ? CDS_F_I2K : 0) | (orb->... | 24,345 |
1 | static int msrle_decode_pal4(AVCodecContext *avctx, AVPicture *pic, const uint8_t *data, int data_size) { int stream_ptr = 0; unsigned char rle_code; unsigned char extra_byte, odd_pixel; unsigned char stream_byte; int pixel_ptr = 0; int row_dec = pic->linesize[0]; int row_ptr = (avctx->height - 1) * row_dec; int frame_... | 24,346 |
1 | static int vnc_update_client(VncState *vs, int has_dirty, bool sync) { vs->has_dirty += has_dirty; if (vs->need_update && vs->ioc != NULL) { VncDisplay *vd = vs->vd; VncJob *job; int y; int height, width; int n = 0; if (vs->output.offset && !vs->audio_cap && !vs->force_update) /* kernel send buffers are full -> drop fr... | 24,347 |
1 | static void vc1_mc_4mv_chroma4(VC1Context *v) { MpegEncContext *s = &v->s; DSPContext *dsp = &v->s.dsp; uint8_t *srcU, *srcV; int uvsrc_x, uvsrc_y; int uvmx_field[4], uvmy_field[4]; int i, off, tx, ty; int fieldmv = v->blk_mv_type[s->block_index[0]]; static const int s_rndtblfield[16] = { 0, 0, 1, 2, 4, 4, 5, 6, 2, 2, ... | 24,348 |
1 | static void vga_invalidate_display(void *opaque) { VGAState *s = (VGAState *)opaque; s->last_width = -1; s->last_height = -1; } | 24,349 |
1 | static void virtio_setup(uint64_t dev_info) { struct schib schib; int ssid; bool found = false; uint16_t dev_no; /* * We unconditionally enable mss support. In every sane configuration, * this will succeed; and even if it doesn't, stsch_err() can deal * with the consequences. */ enable_mss_facility(); if (dev_info != -... | 24,350 |
1 | static void qemu_cleanup_net_client(NetClientState *nc) { QTAILQ_REMOVE(&net_clients, nc, next); nc->info->cleanup(nc); } | 24,352 |
1 | static void tcg_out_op (TCGContext *s, int 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 method */ s... | 24,353 |
1 | static int socket_accept(int sock) { struct sockaddr_un addr; socklen_t addrlen; int ret; addrlen = sizeof(addr); do { ret = accept(sock, (struct sockaddr *)&addr, &addrlen); } while (ret == -1 && errno == EINTR); g_assert_no_errno(ret); close(sock); return ret; } | 24,354 |
1 | ivshmem_server_handle_new_conn(IvshmemServer *server) { IvshmemServerPeer *peer, *other_peer; struct sockaddr_un unaddr; socklen_t unaddr_len; int newfd; unsigned i; /* accept the incoming connection */ unaddr_len = sizeof(unaddr); newfd = qemu_accept(server->sock_fd, (struct sockaddr *)&unaddr, &unaddr_len); if (newfd... | 24,355 |
0 | static int mjpegb_decode_frame(AVCodecContext *avctx, void *data, int *data_size, UINT8 *buf, int buf_size) { MJpegDecodeContext *s = avctx->priv_data; UINT8 *buf_end, *buf_ptr; int i; AVPicture *picture = data; GetBitContext hgb; /* for the header */ uint32_t dqt_offs, dht_offs, sof_offs, sos_offs, second_field_offs; ... | 24,357 |
1 | static int idcin_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags) { IdcinDemuxContext *idcin = s->priv_data; if (idcin->first_pkt_pos > 0) { int ret = avio_seek(s->pb, idcin->first_pkt_pos, SEEK_SET); if (ret < 0) return ret; ff_update_cur_dts(s, s->streams[idcin->video_stream_index], 0); i... | 24,358 |
1 | static int multiwrite_req_compare(const void *a, const void *b) { return (((BlockRequest*) a)->sector - ((BlockRequest*) b)->sector); } | 24,359 |
1 | static int output_frame(H264Context *h, AVFrame *dst, H264Picture *srcp) { AVFrame *src = srcp->f; const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(src->format); int i; int ret = av_frame_ref(dst, src); if (ret < 0) return ret; av_dict_set(&dst->metadata, "stereo_mode", ff_h264_sei_stereo_mode(h), 0); if (srcp->sei... | 24,360 |
1 | int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; MJpegDecodeContext *s = avctx->priv_data; const uint8_t *buf_end, *buf_ptr; const uint8_t *unescaped_buf_ptr; int hshift, vshift; int unesc... | 24,361 |
1 | static void a15_daughterboard_init(const VexpressMachineState *vms, ram_addr_t ram_size, const char *cpu_model, qemu_irq *pic) { MemoryRegion *sysmem = get_system_memory(); MemoryRegion *ram = g_new(MemoryRegion, 1); MemoryRegion *sram = g_new(MemoryRegion, 1); if (!cpu_model) { cpu_model = "cortex-a15"; } { /* We have... | 24,362 |
1 | static void dec_sl(DisasContext *dc) { if (dc->format == OP_FMT_RI) { LOG_DIS("sli r%d, r%d, %d\n", dc->r1, dc->r0, dc->imm5); } else { LOG_DIS("sl r%d, r%d, r%d\n", dc->r2, dc->r0, dc->r1); } if (!(dc->env->features & LM32_FEATURE_SHIFT)) { cpu_abort(dc->env, "hardware shifter is not available\n"); } if (dc->format ==... | 24,363 |
1 | void qemu_iovec_init(QEMUIOVector *qiov, int alloc_hint) { qiov->iov = g_malloc(alloc_hint * sizeof(struct iovec)); qiov->niov = 0; qiov->nalloc = alloc_hint; qiov->size = 0; } | 24,365 |
1 | static int vp3_update_thread_context(AVCodecContext *dst, const AVCodecContext *src) { Vp3DecodeContext *s = dst->priv_data, *s1 = src->priv_data; int qps_changed = 0, i, err; #define copy_fields(to, from, start_field, end_field) memcpy(&to->start_field, &from->start_field, (char*)&to->end_field - (char*)&to->start_fie... | 24,366 |
1 | static int write_reftable_entry(BlockDriverState *bs, int rt_index) { BDRVQcowState *s = bs->opaque; uint64_t buf[RT_ENTRIES_PER_SECTOR]; int rt_start_index; int i, ret; rt_start_index = rt_index & ~(RT_ENTRIES_PER_SECTOR - 1); for (i = 0; i < RT_ENTRIES_PER_SECTOR; i++) { buf[i] = cpu_to_be64(s->refcount_table[rt_star... | 24,367 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.