label int64 0 1 | func1 stringlengths 23 97k | id int64 0 27.3k |
|---|---|---|
0 | static void implicit_weight_table(H264Context *h){ MpegEncContext * const s = &h->s; int ref0, ref1, i; int cur_poc = s->current_picture_ptr->poc; if( h->ref_count[0] == 1 && h->ref_count[1] == 1 && h->ref_list[0][0].poc + h->ref_list[1][0].poc == 2*cur_poc){ h->use_weight= 0; h->use_weight_chroma= 0; return; } h->use_... | 17,852 |
0 | static av_cold int ra144_encode_init(AVCodecContext * avctx) { RA144Context *ractx; int ret; if (avctx->channels != 1) { av_log(avctx, AV_LOG_ERROR, "invalid number of channels: %d\n", avctx->channels); return -1; } avctx->frame_size = NBLOCKS * BLOCKSIZE; avctx->delay = avctx->frame_size; avctx->bit_rate = 8000; ractx... | 17,853 |
1 | static int mxf_read_generic_descriptor(void *arg, AVIOContext *pb, int tag, int size, UID uid, int64_t klv_offset) { MXFDescriptor *descriptor = arg; descriptor->pix_fmt = AV_PIX_FMT_NONE; switch(tag) { case 0x3F01: descriptor->sub_descriptors_count = avio_rb32(pb); if (descriptor->sub_descriptors_count >= UINT_MAX / s... | 17,854 |
1 | int pt_removexattr(FsContext *ctx, const char *path, const char *name) { char *buffer; int ret; buffer = rpath(ctx, path); ret = lremovexattr(path, name); g_free(buffer); return ret; } | 17,855 |
1 | int64_t ff_ape_parse_tag(AVFormatContext *s) { AVIOContext *pb = s->pb; int file_size = avio_size(pb); uint32_t val, fields, tag_bytes; uint8_t buf[8]; int64_t tag_start; int i; if (file_size < APE_TAG_FOOTER_BYTES) return 0; avio_seek(pb, file_size - APE_TAG_FOOTER_BYTES, SEEK_SET); avio_read(pb, buf, 8); /* APETAGEX ... | 17,856 |
1 | static void* attribute_align_arg worker(void *v) { ThreadContext *c = v; int our_job = c->nb_jobs; int nb_threads = c->nb_threads; unsigned int last_execute = 0; int self_id; pthread_mutex_lock(&c->current_job_lock); self_id = c->current_job++; for (;;) { while (our_job >= c->nb_jobs) { if (c->current_job == nb_threads... | 17,857 |
1 | static void pc87312_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = pc87312_realize; dc->reset = pc87312_reset; dc->vmsd = &vmstate_pc87312; dc->props = pc87312_properties; } | 17,859 |
1 | static int mkv_field_order(MatroskaDemuxContext *matroska, int64_t field_order) { int major, minor, micro, bttb = 0; /* workaround a bug in our Matroska muxer, introduced in version 57.36 alongside * this function, and fixed in 57.52 */ if (sscanf(matroska->muxingapp, "Lavf%d.%d.%d", &major, &minor, µ) == 3) bttb ... | 17,860 |
1 | av_cold void ff_fft_init_arm(FFTContext *s) { int cpu_flags = av_get_cpu_flags(); if (have_vfp(cpu_flags) && !have_vfpv3(cpu_flags)) { s->fft_calc = ff_fft_calc_vfp; #if CONFIG_MDCT s->imdct_half = ff_imdct_half_vfp; #endif } if (have_neon(cpu_flags)) { s->fft_permute = ff_fft_permute_neon; s->fft_calc = ff_fft_calc_ne... | 17,861 |
1 | unsigned long find_next_bit(const unsigned long *addr, unsigned long size, unsigned long offset) { const unsigned long *p = addr + BITOP_WORD(offset); unsigned long result = offset & ~(BITS_PER_LONG-1); unsigned long tmp; if (offset >= size) { return size; } size -= result; offset %= BITS_PER_LONG; if (offset) { tmp = ... | 17,862 |
1 | void migration_set_outgoing_channel(MigrationState *s, QIOChannel *ioc) { QEMUFile *f = qemu_fopen_channel_output(ioc); s->to_dst_file = f; migrate_fd_connect(s); } | 17,863 |
1 | static void qemu_wait_io_event_common(CPUState *cpu) { if (cpu->stop) { cpu->stop = false; cpu->stopped = true; qemu_cond_broadcast(&qemu_pause_cond); } process_queued_cpu_work(cpu); cpu->thread_kicked = false; } | 17,864 |
1 | static void ahci_test_identify(AHCIQState *ahci) { uint16_t buff[256]; unsigned px; int rc; uint16_t sect_size; const size_t buffsize = 512; g_assert(ahci != NULL); /** * This serves as a bit of a tutorial on AHCI device programming: * * (1) Create a data buffer for the IDENTIFY response to be sent to * (2) Create a Co... | 17,865 |
1 | static void rc4030_realize(DeviceState *dev, Error **errp) { rc4030State *s = RC4030(dev); Object *o = OBJECT(dev); int i; s->periodic_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, rc4030_periodic_timer, s); memory_region_init_io(&s->iomem_chipset, NULL, &rc4030_ops, s, "rc4030.chipset", 0x300); memory_region_init_io(&s->io... | 17,867 |
1 | static int fourxm_probe(AVProbeData *p) { if ((AV_RL32(&p->buf[0]) != RIFF_TAG) || (AV_RL32(&p->buf[8]) != _4XMV_TAG)) return 0; return AVPROBE_SCORE_MAX; } | 17,868 |
1 | void monitor_disas(Monitor *mon, CPUState *cpu, target_ulong pc, int nb_insn, int is_physical) { CPUClass *cc = CPU_GET_CLASS(cpu); int count, i; CPUDebug s; INIT_DISASSEMBLE_INFO(s.info, (FILE *)mon, monitor_fprintf); s.cpu = cpu; monitor_disas_is_physical = is_physical; s.info.read_memory_func = monitor_read_memory; ... | 17,869 |
1 | static struct omap_pwl_s *omap_pwl_init(MemoryRegion *system_memory, hwaddr base, omap_clk clk) { struct omap_pwl_s *s = g_malloc0(sizeof(*s)); omap_pwl_reset(s); memory_region_init_io(&s->iomem, NULL, &omap_pwl_ops, s, "omap-pwl", 0x800); memory_region_add_subregion(system_memory, base, &s->iomem); omap_clk_adduser(cl... | 17,870 |
0 | static int amr_nb_decode_frame(AVCodecContext * avctx, void *data, int *data_size, uint8_t * buf, int buf_size) { AMRContext *s = avctx->priv_data; uint8_t*amrData=buf; int offset=0; UWord8 toc, q, ft; Word16 serial[SERIAL_FRAMESIZE]; /* coded bits */ Word16 *synth; UWord8 *packed_bits; static Word16 packed_size[16] = ... | 17,872 |
0 | static int mov_write_stbl_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track) { int64_t pos = avio_tell(pb); int ret; avio_wb32(pb, 0); /* size */ ffio_wfourcc(pb, "stbl"); mov_write_stsd_tag(s, pb, mov, track); mov_write_stts_tag(pb, track); if ((track->par->codec_type == AVMEDIA_TYPE_VIDEO |... | 17,873 |
1 | static av_cold void h264dsp_init_neon(H264DSPContext *c, const int bit_depth, const int chroma_format_idc) { if (bit_depth == 8) { c->h264_v_loop_filter_luma = ff_h264_v_loop_filter_luma_neon; c->h264_h_loop_filter_luma = ff_h264_h_loop_filter_luma_neon; c->h264_v_loop_filter_chroma = ff_h264_v_loop_filter_chroma_neon;... | 17,874 |
1 | ssize_t qemu_sendv_packet(VLANClientState *vc1, const struct iovec *iov, int iovcnt) { VLANState *vlan = vc1->vlan; VLANClientState *vc; ssize_t max_len = 0; if (vc1->link_down) return calc_iov_length(iov, iovcnt); for (vc = vlan->first_client; vc != NULL; vc = vc->next) { ssize_t len = 0; if (vc == vc1) continue; if (... | 17,875 |
1 | static bool blit_region_is_unsafe(struct CirrusVGAState *s, int32_t pitch, int32_t addr) { if (pitch < 0) { int64_t min = addr + ((int64_t)s->cirrus_blt_height-1) * pitch; int32_t max = addr + s->cirrus_blt_width; if (min < 0 || max >= s->vga.vram_size) { return true; } } else { int64_t max = addr + ((int64_t)s->cirrus... | 17,876 |
1 | static int rv10_decode_picture_header(MpegEncContext *s) { int mb_count, pb_frame, marker, h, full_frame; /* skip packet header */ h = get_bits(&s->gb, 8); if ((h & 0xc0) == 0xc0) { int len, pos; full_frame = 1; len = get_num(&s->gb); pos = get_num(&s->gb); } else { int seq, frame_size, pos; full_frame = 0; seq = get_b... | 17,879 |
1 | host_memory_backend_get_host_nodes(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { HostMemoryBackend *backend = MEMORY_BACKEND(obj); uint16List *host_nodes = NULL; uint16List **node = &host_nodes; unsigned long value; value = find_first_bit(backend->host_nodes, MAX_NODES); node = host_memory_ap... | 17,880 |
1 | static int v4l2_read_header(AVFormatContext *s1) { struct video_data *s = s1->priv_data; AVStream *st; int res = 0; uint32_t desired_format; enum AVCodecID codec_id = AV_CODEC_ID_NONE; enum AVPixelFormat pix_fmt = AV_PIX_FMT_NONE; struct v4l2_input input = { 0 }; st = avformat_new_stream(s1, NULL); if (!st) return AVER... | 17,881 |
0 | avfilter_get_video_buffer_ref_from_arrays(uint8_t *data[4], int linesize[4], int perms, int w, int h, enum PixelFormat format) { AVFilterBuffer *pic = av_mallocz(sizeof(AVFilterBuffer)); AVFilterBufferRef *picref = av_mallocz(sizeof(AVFilterBufferRef)); if (!pic || !picref) goto fail; picref->buf = pic; picref->buf->fr... | 17,882 |
1 | static int dca_decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; int i; int16_t *samples = data; DCAContext *s = avctx->priv_data; int channels; s->dca_buffer_size = dca_convert_bitstream(buf, buf_size, s->dca_buffer, DCA_MA... | 17,884 |
1 | static void dmg_close(BlockDriverState *bs) { BDRVDMGState *s = bs->opaque; g_free(s->types); g_free(s->offsets); g_free(s->lengths); g_free(s->sectors); g_free(s->sectorcounts); g_free(s->compressed_chunk); g_free(s->uncompressed_chunk); inflateEnd(&s->zstream); } | 17,886 |
1 | int gdbserver_start(const char *device) { GDBState *s; char gdbstub_device_name[128]; CharDriverState *chr = NULL; CharDriverState *mon_chr; if (!device) return -1; if (strcmp(device, "none") != 0) { if (strstart(device, "tcp:", NULL)) { /* enforce required TCP attributes */ snprintf(gdbstub_device_name, sizeof(gdbstub... | 17,887 |
1 | static int opus_packet(AVFormatContext *avf, int idx) { struct ogg *ogg = avf->priv_data; struct ogg_stream *os = &ogg->streams[idx]; AVStream *st = avf->streams[idx]; struct oggopus_private *priv = os->private; uint8_t *packet = os->buf + os->pstart; int ret; if (!os->psize) return AVERROR_INVALIDDATA; if (os->granule... | 17,888 |
1 | static unsigned int mszh_decomp(unsigned char * srcptr, int srclen, unsigned char * destptr, unsigned int destsize) { unsigned char *destptr_bak = destptr; unsigned char *destptr_end = destptr + destsize; unsigned char mask = 0; unsigned char maskbit = 0; unsigned int ofs, cnt; while (srclen > 0 && destptr < destptr_en... | 17,890 |
1 | static int decode_codestream(Jpeg2000DecoderContext *s) { Jpeg2000CodingStyle *codsty = s->codsty; Jpeg2000QuantStyle *qntsty = s->qntsty; uint8_t *properties = s->properties; for (;;){ int oldpos, marker, len, ret = 0; if (bytestream2_get_bytes_left(&s->g) < 2) { av_log(s->avctx, AV_LOG_ERROR, "Missing EOC\n"); break;... | 17,891 |
1 | void do_mulldo (void) { int64_t th; uint64_t tl; muls64(&tl, &th, T0, T1); if (likely(th == 0)) { xer_ov = 0; } else { xer_ov = 1; xer_so = 1; } T0 = (int64_t)tl; } | 17,895 |
0 | static int decode_unit(SCPRContext *s, PixelModel *pixel, unsigned step, unsigned *rval) { GetByteContext *gb = &s->gb; RangeCoder *rc = &s->rc; unsigned totfr = pixel->total_freq; unsigned value, x = 0, cumfr = 0, cnt_x = 0; int i, j, ret, c, cnt_c; if ((ret = s->get_freq(rc, totfr, &value)) < 0) return ret; while (x ... | 17,896 |
0 | static void sbr_env_estimate(float (*e_curr)[48], float X_high[64][40][2], SpectralBandReplication *sbr, SBRData *ch_data) { int e, i, m; if (sbr->bs_interpol_freq) { for (e = 0; e < ch_data->bs_num_env; e++) { const float recip_env_size = 0.5f / (ch_data->t_env[e + 1] - ch_data->t_env[e]); int ilb = ch_data->t_env[e] ... | 17,897 |
0 | static int test_scalarproduct_float(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp, const float *v1, const float *v2) { float cprod, oprod; int ret; cprod = cdsp->scalarproduct_float(v1, v2, LEN); oprod = fdsp->scalarproduct_float(v1, v2, LEN); if (ret = compare_floats(&cprod, &oprod, 1, ARBITRARY_SCALARPRODUCT_CONST... | 17,898 |
0 | static int mov_read_pasp(MOVContext *c, ByteIOContext *pb, MOVAtom atom) { const int num = get_be32(pb); const int den = get_be32(pb); AVStream * const st = c->fc->streams[c->fc->nb_streams-1]; if (den != 0) { if ((st->sample_aspect_ratio.den != 1 || st->sample_aspect_ratio.num) && // default (den != st->sample_aspect_... | 17,899 |
0 | static void MPV_encode_defaults(MpegEncContext *s){ static int done=0; MPV_common_defaults(s); if(!done){ int i; done=1; for(i=-16; i<16; i++){ default_fcode_tab[i + MAX_MV]= 1; } } s->me.mv_penalty= default_mv_penalty; s->fcode_tab= default_fcode_tab; } | 17,900 |
0 | int avcodec_get_pix_fmt_loss(int dst_pix_fmt, int src_pix_fmt, int has_alpha) { const PixFmtInfo *pf, *ps; int loss; ps = &pix_fmt_info[src_pix_fmt]; pf = &pix_fmt_info[dst_pix_fmt]; /* compute loss */ loss = 0; pf = &pix_fmt_info[dst_pix_fmt]; if (pf->depth < ps->depth) loss |= FF_LOSS_DEPTH; if (pf->x_chroma_shift >=... | 17,901 |
0 | static int ftp_get_file_handle(URLContext *h) { FTPContext *s = h->priv_data; av_dlog(h, "ftp protocol get_file_handle\n"); if (s->conn_data) return ffurl_get_file_handle(s->conn_data); return AVERROR(EIO); } | 17,902 |
0 | static void sdp_write_header(char *buff, int size, struct sdp_session_level *s) { av_strlcatf(buff, size, "v=%d\r\n" "o=- %d %d IN IPV4 %s\r\n" "t=%d %d\r\n" "s=%s\r\n" "a=tool:libavformat " AV_STRINGIFY(LIBAVFORMAT_VERSION) "\r\n", s->sdp_version, s->id, s->version, s->src_addr, s->start_time, s->end_time, s->name[0] ... | 17,903 |
1 | static int print_device_sources(AVInputFormat *fmt, AVDictionary *opts) { int ret, i; AVFormatContext *dev = NULL; AVDeviceInfoList *device_list = NULL; AVDictionary *tmp_opts = NULL; if (!fmt || !fmt->priv_class || !AV_IS_INPUT_DEVICE(fmt->priv_class->category)) return AVERROR(EINVAL); printf("Audo-detected sources fo... | 17,905 |
1 | static inline void RENAME(yuv2packedX)(SwsContext *c, int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize, int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize, uint8_t *dest, int dstW, int dstY) { int dummy=0; switch(c->dstFormat) { #ifdef HAVE_MMX case IMGFMT_BGR32: { asm volatile( YSCALEYUV2RGBX WRITEBGR32(%4... | 17,906 |
1 | static int multiple_resample(ResampleContext *c, AudioData *dst, int dst_size, AudioData *src, int src_size, int *consumed){ int i, ret= -1; int av_unused mm_flags = av_get_cpu_flags(); int need_emms= 0; if (c->compensation_distance) dst_size = FFMIN(dst_size, c->compensation_distance); for(i=0; i<dst->ch_count; i++){ ... | 17,907 |
1 | static void mpegts_write_pes(AVFormatContext *s, AVStream *st, const uint8_t *payload, int payload_size, int64_t pts, int64_t dts, int key, int stream_id) { MpegTSWriteStream *ts_st = st->priv_data; MpegTSWrite *ts = s->priv_data; uint8_t buf[TS_PACKET_SIZE]; uint8_t *q; int val, is_start, len, header_len, write_pcr, i... | 17,910 |
0 | void ff_ac3_bit_alloc_calc_bap(int16_t *mask, int16_t *psd, int start, int end, int snr_offset, int floor, const uint8_t *bap_tab, uint8_t *bap) { int i, j, end1, v, address; /* special case, if snr offset is -960, set all bap's to zero */ if (snr_offset == -960) { memset(bap, 0, 256); return; } i = start; j = bin_to_b... | 17,911 |
1 | static int check_refcounts_l2(BlockDriverState *bs, BdrvCheckResult *res, uint16_t **refcount_table, int64_t *refcount_table_size, int64_t l2_offset, int flags) { BDRVQcowState *s = bs->opaque; uint64_t *l2_table, l2_entry; uint64_t next_contiguous_offset = 0; int i, l2_size, nb_csectors, ret; /* Read L2 table from dis... | 17,912 |
0 | static inline void mix_3f_to_mono(AC3DecodeContext *ctx) { int i; float (*output)[256] = ctx->audio_block.block_output; for (i = 0; i < 256; i++) output[1][i] += (output[2][i] + output[3][i]); memset(output[2], 0, sizeof(output[2])); memset(output[3], 0, sizeof(output[3])); } | 17,914 |
0 | int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb) { int pqindex, lowquant; int status; int mbmodetab, imvtab, icbptab, twomvbptab, fourmvbptab; /* useful only for debugging */ int scale, shift, i; /* for initializing LUT for intensity compensation */ v->numref=0; v->p_frame_skipped = 0; if (v->second_... | 17,915 |
0 | static int vivo_probe(AVProbeData *p) { const unsigned char *buf = p->buf; unsigned c, length = 0; // stream must start with packet of type 0 and sequence number 0 if (*buf++ != 0) return 0; // read at most 2 bytes of coded length c = *buf++; length = c & 0x7F; if (c & 0x80) { c = *buf++; length = (length << 7) | (c & ... | 17,916 |
0 | static void print_report(int is_last_report, int64_t timer_start, int64_t cur_time) { char buf[1024]; AVBPrint buf_script; OutputStream *ost; AVFormatContext *oc; int64_t total_size; AVCodecContext *enc; int frame_number, vid, i; double bitrate; int64_t pts = INT64_MIN; static int64_t last_time = -1; static int qp_hist... | 17,917 |
0 | static int put_packetheader(NUTContext *nut, ByteIOContext *bc, int max_size) { put_flush_packet(bc); nut->last_packet_start= nut->packet_start; nut->packet_start+= nut->written_packet_size; nut->packet_size_pos = url_ftell(bc); nut->written_packet_size = max_size; /* packet header */ put_v(bc, nut->written_packet_size... | 17,918 |
0 | static int decode_mb_cavlc(H264Context *h){ MpegEncContext * const s = &h->s; int mb_xy; int partition_count; unsigned int mb_type, cbp; int dct8x8_allowed= h->pps.transform_8x8_mode; mb_xy = h->mb_xy = s->mb_x + s->mb_y*s->mb_stride; s->dsp.clear_blocks(h->mb); //FIXME avoid if already clear (move after skip handlong?... | 17,919 |
0 | static int read_dct_coeffs(GetBitContext *gb, int32_t block[64], const uint8_t *scan, const int32_t quant_matrices[16][64], int q) { int coef_list[128]; int mode_list[128]; int i, t, mask, bits, ccoef, mode, sign; int list_start = 64, list_end = 64, list_pos; int coef_count = 0; int coef_idx[64]; int quant_idx; const i... | 17,920 |
0 | static int decode_rle(CamtasiaContext *c) { unsigned char *src = c->decomp_buf; unsigned char *output; int p1, p2, line=c->height, pos=0, i; output = c->pic.data[0] + (c->height - 1) * c->pic.linesize[0]; while(src < c->decomp_buf + c->decomp_size) { p1 = *src++; if(p1 == 0) { //Escape code p2 = *src++; if(p2 == 0) { /... | 17,921 |
0 | decode_cabac_residual_internal(H264Context *h, int16_t *block, int cat, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff, int is_dc, int chroma422) { static const int significant_coeff_flag_offset[2][14] = { { 105+0, 105+15, 105+29, 105+44, 105+47, 402, 484+0, 484+15, 484+29, 660, 528+0, 528+15, 528... | 17,922 |
1 | static void gen_pool32axf (CPUMIPSState *env, DisasContext *ctx, int rt, int rs, int *is_branch) { int extension = (ctx->opcode >> 6) & 0x3f; int minor = (ctx->opcode >> 12) & 0xf; uint32_t mips32_op; switch (extension) { case TEQ: mips32_op = OPC_TEQ; goto do_trap; case TGE: mips32_op = OPC_TGE; goto do_trap; case TGE... | 17,923 |
1 | static int mpegts_write_pmt(AVFormatContext *s, MpegTSService *service) { MpegTSWrite *ts = s->priv_data; uint8_t data[SECTION_LENGTH], *q, *desc_length_ptr, *program_info_length_ptr; int val, stream_type, i, err = 0; q = data; put16(&q, 0xe000 | service->pcr_pid); program_info_length_ptr = q; q += 2; /* patched after ... | 17,924 |
1 | static void ahci_reset_port(AHCIState *s, int port) { AHCIDevice *d = &s->dev[port]; AHCIPortRegs *pr = &d->port_regs; IDEState *ide_state = &d->port.ifs[0]; int i; DPRINTF(port, "reset port\n"); ide_bus_reset(&d->port); ide_state->ncq_queues = AHCI_MAX_CMDS; pr->scr_stat = 0; pr->scr_err = 0; pr->scr_act = 0; d->busy_... | 17,926 |
1 | int mjpeg_init(MpegEncContext *s) { MJpegContext *m; m = malloc(sizeof(MJpegContext)); if (!m) return -1; /* build all the huffman tables */ build_huffman_codes(m->huff_size_dc_luminance, m->huff_code_dc_luminance, bits_dc_luminance, val_dc_luminance); build_huffman_codes(m->huff_size_dc_chrominance, m->huff_code_dc_ch... | 17,927 |
1 | static void *bochs_bios_init(void) { void *fw_cfg; uint8_t *smbios_table; size_t smbios_len; uint64_t *numa_fw_cfg; int i, j; fw_cfg = fw_cfg_init(BIOS_CFG_IOPORT, BIOS_CFG_IOPORT + 1, 0, 0); fw_cfg_add_i32(fw_cfg, FW_CFG_ID, 1); fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)ram_size); fw_cfg_add_bytes(fw_cfg, FW_C... | 17,928 |
1 | static CharDriverState *gd_vc_handler(ChardevVC *vc, Error **errp) { ChardevCommon *common = qapi_ChardevVC_base(vc); CharDriverState *chr; chr = qemu_chr_alloc(common, errp); if (!chr) { chr->chr_write = gd_vc_chr_write; chr->chr_set_echo = gd_vc_chr_set_echo; /* Temporary, until gd_vc_vte_init runs. */ chr->opaque = ... | 17,930 |
1 | int av_parse_color(uint8_t *rgba_color, const char *color_string, void *log_ctx) { if (!strcasecmp(color_string, "random") || !strcasecmp(color_string, "bikeshed")) { int rgba = ff_random_get_seed(); rgba_color[0] = rgba >> 24; rgba_color[1] = rgba >> 16; rgba_color[2] = rgba >> 8; rgba_color[3] = rgba; } else if (!str... | 17,931 |
1 | static av_cold int aac_encode_init(AVCodecContext *avctx) { AACEncContext *s = avctx->priv_data; int i; const uint8_t *sizes[2]; uint8_t grouping[AAC_MAX_CHANNELS]; int lengths[2]; avctx->frame_size = 1024; for (i = 0; i < 16; i++) if (avctx->sample_rate == avpriv_mpeg4audio_sample_rates[i]) break; if (i == 16) { av_lo... | 17,934 |
1 | static int of_dpa_cmd_flow_add(OfDpa *of_dpa, uint64_t cookie, RockerTlv **flow_tlvs) { OfDpaFlow *flow = of_dpa_flow_find(of_dpa, cookie); int err = ROCKER_OK; if (flow) { return -ROCKER_EEXIST; } flow = of_dpa_flow_alloc(cookie); if (!flow) { return -ROCKER_ENOMEM; } err = of_dpa_cmd_flow_add_mod(of_dpa, flow, flow_t... | 17,935 |
1 | static int epaf_read_header(AVFormatContext *s) { int le, sample_rate, codec, channels; AVStream *st; avio_skip(s->pb, 4); if (avio_rl32(s->pb)) return AVERROR_INVALIDDATA; le = avio_rl32(s->pb); if (le && le != 1) return AVERROR_INVALIDDATA; if (le) { sample_rate = avio_rl32(s->pb); codec = avio_rl32(s->pb); channels ... | 17,936 |
1 | static void audio_init (void) { size_t i; int done = 0; const char *drvname; VMChangeStateEntry *e; AudioState *s = &glob_audio_state; if (s->drv) { return; } QLIST_INIT (&s->hw_head_out); QLIST_INIT (&s->hw_head_in); QLIST_INIT (&s->cap_head); atexit (audio_atexit); s->ts = timer_new_ns(QEMU_CLOCK_VIRTUAL, audio_timer... | 17,937 |
1 | static void taihu_405ep_init(MachineState *machine) { ram_addr_t ram_size = machine->ram_size; const char *kernel_filename = machine->kernel_filename; const char *initrd_filename = machine->initrd_filename; char *filename; qemu_irq *pic; MemoryRegion *sysmem = get_system_memory(); MemoryRegion *bios; MemoryRegion *ram_... | 17,939 |
1 | static void qmp_input_type_any(Visitor *v, const char *name, QObject **obj, Error **errp) { QmpInputVisitor *qiv = to_qiv(v); QObject *qobj = qmp_input_get_object(qiv, name, true); qobject_incref(qobj); *obj = qobj; | 17,940 |
1 | PPC_OP(clear_xer_cr) { xer_so = 0; xer_ov = 0; xer_ca = 0; RETURN(); } | 17,941 |
1 | static void flush_encoders(void) { int i, ret; for (i = 0; i < nb_output_streams; i++) { OutputStream *ost = output_streams[i]; AVCodecContext *enc = ost->enc_ctx; OutputFile *of = output_files[ost->file_index]; if (!ost->encoding_needed) continue; // Try to enable encoding with no input frames. // Maybe we should just... | 17,942 |
1 | int fw_cfg_add_i32(FWCfgState *s, uint16_t key, uint32_t value) { uint32_t *copy; copy = g_malloc(sizeof(value)); *copy = cpu_to_le32(value); return fw_cfg_add_bytes(s, key, (uint8_t *)copy, sizeof(value)); } | 17,944 |
1 | static void use_normal_update_speed(WmallDecodeCtx *s, int ich) { int ilms, recent, icoef; s->update_speed[ich] = 8; for (ilms = s->cdlms_ttl[ich]; ilms >= 0; ilms--) { recent = s->cdlms[ich][ilms].recent; if (s->bV3RTM) { for (icoef = 0; icoef < s->cdlms[ich][ilms].order; icoef++) s->cdlms[ich][ilms].lms_updates[icoef... | 17,945 |
1 | static int ram_save_target_page(RAMState *rs, PageSearchStatus *pss, bool last_stage, ram_addr_t dirty_ram_abs) { int res = 0; /* Check the pages is dirty and if it is send it */ if (migration_bitmap_clear_dirty(rs, dirty_ram_abs)) { unsigned long *unsentmap; /* * If xbzrle is on, stop using the data compression after ... | 17,946 |
1 | static int vmdk_parent_open(BlockDriverState *bs, const char * filename) { BDRVVmdkState *s = bs->opaque; char *p_name; char desc[DESC_SIZE]; char parent_img_name[1024]; /* the descriptor offset = 0x200 */ if (bdrv_pread(s->hd, 0x200, desc, DESC_SIZE) != DESC_SIZE) return -1; if ((p_name = strstr(desc,"parentFileNameHi... | 17,947 |
1 | static int sd_snapshot_list(BlockDriverState *bs, QEMUSnapshotInfo **psn_tab) { Error *local_err = NULL; BDRVSheepdogState *s = bs->opaque; SheepdogReq req; int fd, nr = 1024, ret, max = BITS_TO_LONGS(SD_NR_VDIS) * sizeof(long); QEMUSnapshotInfo *sn_tab = NULL; unsigned wlen, rlen; int found = 0; static SheepdogInode i... | 17,948 |
1 | static void config_parse(GAConfig *config, int argc, char **argv) { const char *sopt = "hVvdm:p:l:f:F::b:s:t:D"; int opt_ind = 0, ch; const struct option lopt[] = { { "help", 0, NULL, 'h' }, { "version", 0, NULL, 'V' }, { "dump-conf", 0, NULL, 'D' }, { "logfile", 1, NULL, 'l' }, { "pidfile", 1, NULL, 'f' }, #ifdef CONF... | 17,949 |
0 | static void gen_abs(DisasContext *ctx) { int l1 = gen_new_label(); int l2 = gen_new_label(); tcg_gen_brcondi_tl(TCG_COND_GE, cpu_gpr[rA(ctx->opcode)], 0, l1); tcg_gen_neg_tl(cpu_gpr[rD(ctx->opcode)], cpu_gpr[rA(ctx->opcode)]); tcg_gen_br(l2); gen_set_label(l1); tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_gpr[rA(ctx->o... | 17,950 |
0 | static void ga_channel_client_close(GAChannel *c) { g_assert(c->client_channel); g_io_channel_shutdown(c->client_channel, true, NULL); g_io_channel_unref(c->client_channel); c->client_channel = NULL; if (c->method == GA_CHANNEL_UNIX_LISTEN && c->listen_channel) { ga_channel_listen_add(c, 0, false); } } | 17,951 |
0 | static int omap_validate_tipb_addr(struct omap_mpu_state_s *s, target_phys_addr_t addr) { return range_covers_byte(0xfffb0000, 0xffff0000 - 0xfffb0000, addr); } | 17,952 |
0 | static int is_allocated_sectors(const uint8_t *buf, int n, int *pnum) { int v, i; if (n <= 0) { *pnum = 0; return 0; } v = is_not_zero(buf, 512); for(i = 1; i < n; i++) { buf += 512; if (v != is_not_zero(buf, 512)) break; } *pnum = i; return v; } | 17,955 |
0 | static void s390_virtio_blk_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); VirtIOS390DeviceClass *k = VIRTIO_S390_DEVICE_CLASS(klass); k->init = s390_virtio_blk_init; dc->props = s390_virtio_blk_properties; dc->alias = "virtio-blk"; } | 17,956 |
0 | void do_info_vnc(Monitor *mon, QObject **ret_data) { if (vnc_display == NULL || vnc_display->display == NULL) { *ret_data = qobject_from_jsonf("{ 'enabled': false }"); } else { QDict *qdict; QList *clist; clist = qlist_new(); if (vnc_display->clients) { VncState *client = vnc_display->clients; while (client) { qdict = ... | 17,957 |
0 | static void breakpoint_invalidate(CPUArchState *env, target_ulong pc) { target_phys_addr_t addr; ram_addr_t ram_addr; MemoryRegionSection *section; addr = cpu_get_phys_page_debug(env, pc); section = phys_page_find(addr >> TARGET_PAGE_BITS); if (!(memory_region_is_ram(section->mr) || (section->mr->rom_device && section-... | 17,959 |
0 | static int mon_init_func(void *opaque, QemuOpts *opts, Error **errp) { CharDriverState *chr; const char *chardev; const char *mode; int flags; mode = qemu_opt_get(opts, "mode"); if (mode == NULL) { mode = "readline"; } if (strcmp(mode, "readline") == 0) { flags = MONITOR_USE_READLINE; } else if (strcmp(mode, "control")... | 17,960 |
0 | static void show_parts(const char *device) { if (fork() == 0) { int nbd; /* linux just needs an open() to trigger * the partition table update * but remember to load the module with max_part != 0 : * modprobe nbd max_part=63 */ nbd = open(device, O_RDWR); if (nbd != -1) close(nbd); exit(0); } } | 17,961 |
0 | static void isa_mmio_writel(void *opaque, target_phys_addr_t addr, uint32_t val) { cpu_outl(addr & IOPORTS_MASK, val); } | 17,962 |
0 | static inline void t_gen_subx_carry(DisasContext *dc, TCGv d) { if (dc->flagx_known) { if (dc->flags_x) { TCGv c; c = tcg_temp_new(TCG_TYPE_TL); t_gen_mov_TN_preg(c, PR_CCS); /* C flag is already at bit 0. */ tcg_gen_andi_tl(c, c, C_FLAG); tcg_gen_sub_tl(d, d, c); tcg_temp_free(c); } } else { TCGv x, c; x = tcg_temp_ne... | 17,963 |
0 | SwsContext *getSwsContext(int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat, int flags, SwsFilter *srcFilter, SwsFilter *dstFilter){ SwsContext *c; int i; SwsFilter dummyFilter= {NULL, NULL, NULL, NULL}; #ifdef ARCH_X86 if(gCpuCaps.hasMMX) asm volatile("emms\n\t"::: "memory"); #endif if(swScale==NULL... | 17,965 |
0 | struct pxa2xx_state_s *pxa270_init(unsigned int sdram_size, DisplayState *ds, const char *revision) { struct pxa2xx_state_s *s; struct pxa2xx_ssp_s *ssp; int iomemtype, i; s = (struct pxa2xx_state_s *) qemu_mallocz(sizeof(struct pxa2xx_state_s)); if (revision && strncmp(revision, "pxa27", 5)) { fprintf(stderr, "Machine... | 17,966 |
0 | static int qemu_rbd_snap_rollback(BlockDriverState *bs, const char *snapshot_name) { BDRVRBDState *s = bs->opaque; int r; r = rbd_snap_rollback(s->image, snapshot_name); return r; } | 17,967 |
0 | static void test_visitor_out_empty(TestOutputVisitorData *data, const void *unused) { QObject *arg; arg = qmp_output_get_qobject(data->qov); g_assert(qobject_type(arg) == QTYPE_QNULL); /* Check that qnull reference counting is sane */ g_assert(arg->refcnt == 2); qobject_decref(arg); } | 17,968 |
0 | void qio_dns_resolver_lookup_result(QIODNSResolver *resolver, QIOTask *task, size_t *naddrs, SocketAddressLegacy ***addrs) { struct QIODNSResolverLookupData *data = qio_task_get_result_pointer(task); size_t i; *naddrs = 0; *addrs = NULL; if (!data) { return; } *naddrs = data->naddrs; *addrs = g_new0(SocketAddressLegacy... | 17,969 |
0 | iscsi_co_generic_cb(struct iscsi_context *iscsi, int status, void *command_data, void *opaque) { struct IscsiTask *iTask = opaque; struct scsi_task *task = command_data; iTask->status = status; iTask->do_retry = 0; iTask->task = task; if (status != SCSI_STATUS_GOOD) { if (iTask->retries++ < ISCSI_CMD_RETRIES) { if (sta... | 17,970 |
0 | void cpu_exec_exit(CPUState *cpu) { if (cpu->cpu_index == -1) { /* cpu_index was never allocated by this @cpu or was already freed. */ return; } bitmap_clear(cpu_index_map, cpu->cpu_index, 1); cpu->cpu_index = -1; } | 17,971 |
0 | build_header(GArray *linker, GArray *table_data, AcpiTableHeader *h, const char *sig, int len, uint8_t rev, const char *oem_id, const char *oem_table_id) { memcpy(&h->signature, sig, 4); h->length = cpu_to_le32(len); h->revision = rev; if (oem_id) { strncpy((char *)h->oem_id, oem_id, sizeof h->oem_id); } else { memcpy(... | 17,973 |
0 | static int kvm_has_msr_hsave_pa(CPUState *env) { kvm_supported_msrs(env); return has_msr_hsave_pa; } | 17,974 |
0 | static void sd_cardchange(void *opaque, bool load) { SDState *sd = opaque; qemu_set_irq(sd->inserted_cb, blk_is_inserted(sd->blk)); if (blk_is_inserted(sd->blk)) { sd_reset(DEVICE(sd)); qemu_set_irq(sd->readonly_cb, sd->wp_switch); } } | 17,975 |
0 | static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *pkt) { GetBitContext gb; VimaContext *vima = avctx->priv_data; int16_t pcm_data[2]; uint32_t samples; int8_t channel_hint[2]; int ret, chan, channels = 1; init_get_bits(&gb, pkt->data, pkt->size * 8); if (pkt->size < 13) return AVE... | 17,976 |
0 | sPAPRTCETable *spapr_tce_find_by_liobn(uint32_t liobn) { sPAPRTCETable *tcet; if (liobn & 0xFFFFFFFF00000000ULL) { hcall_dprintf("Request for out-of-bounds LIOBN 0x" TARGET_FMT_lx "\n", liobn); return NULL; } QLIST_FOREACH(tcet, &spapr_tce_tables, list) { if (tcet->liobn == liobn) { return tcet; } } return NULL; } | 17,977 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.