project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
FFmpeg | ce09f9270a8bf43212dad58fcb73fee2900c364f | 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;
... | 17,852 |
FFmpeg | 2df0c32ea12ddfa72ba88309812bfb13b674130f | 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;
... | 17,853 |
FFmpeg | 0d6605c7ef43f97a88950542af09078adef33b6d | 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... | 17,854 |
qemu | 72f0d0bf51362011c4d841a89fb8f5cfb16e0bf3 | 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 |
FFmpeg | b655cfefafd565590bfc5976b9ce8dd141b3c41c | 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... | 17,856 |
FFmpeg | 473f0f75a16b4d37bdaa943f75e4ae249212c1ba | 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... | 17,857 |
qemu | 35deebb2327227d8c5f4816476befb06f6329de6 | 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 |
FFmpeg | eb751f06db9f627c8b5c63d08836a39f7572bf56 | 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, &mi... | 17,860 |
FFmpeg | e2710e790c09e49e86baa58c6063af0097cc8cb0 | 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... | 17,861 |
qemu | fbeadf50f2f965741def823036b086bbc2999b1f | 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 -= res... | 17,862 |
qemu | e122636562218b3d442cd2cd18fbc188dd9ce709 | 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 |
qemu | 372579427a5040a26dfee78464b50e2bdf27ef26 | 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 |
qemu | 122482a398db9f02287efce9eec26e08dac82bcd | 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 IDENTI... | 17,865 |
qemu | c627e7526a902dd5bb1907dbbd5cf961679dfa68 | 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, &r... | 17,867 |
FFmpeg | c54286ab08e0c55dba72e4e9718e81b416e585d0 | 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 |
qemu | b8d8720892f7912e8a2621b30ebac0e9a48e89e3 | 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_ph... | 17,869 |
qemu | f3c7d0389fe8a2792fd4c1cf151b885de03c8f62 | 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... | 17,870 |
FFmpeg | 636b69c5a4445a28d509e803ff528c753047ef9d | 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 *s... | 17,872 |
FFmpeg | 15bd309af8302661838150de1905acc4df386d19 | 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->p... | 17,873 |
FFmpeg | a03a642d5ceb5f2f7c6ebbf56ff365dfbcdb65eb | 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... | 17,874 |
qemu | c27ff60871aff588a35e51d1a90faed410993e55 | 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 != NUL... | 17,875 |
qemu | d2ba7ecb348d3b996fcd920cf1ca7b72722c1dfd | 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 ... | 17,876 |
FFmpeg | ee3b2be65da55cfe1fc17d1db75738535f99ceef | 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);... | 17,879 |
qemu | 658ae5a7b90139a6a296cd4cd83643d843964796 | 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_... | 17,880 |
FFmpeg | 9dd54d74226eaaa1087ba994ba212bf9a107c97d | 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... | 17,881 |
FFmpeg | 36dc00de529fb4cd182e02f927597eef9514b886 | 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 (!... | 17,882 |
FFmpeg | 4e06acbde4a75cf9aa6a3e46dd3a7c6ed1ecfb8f | 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;... | 17,884 |
qemu | b546a944749f963c5b4e27765354df10ac531853 | 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 |
qemu | 456d60692310e7ac25cf822cc1e98192ad636ece | 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 require... | 17,887 |
FFmpeg | 1a82d2cf8fb6a7e854e7548dfcf73c3d046b34ac | 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->p... | 17,888 |
FFmpeg | dbc53ffc7c398f90ae1cf59e513d3882bc0dc188 | 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 (s... | 17,890 |
FFmpeg | 17e66c9ff4774e254932d34dade77b1c04139a4f | 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) {
... | 17,891 |
qemu | 88ad920b8adbce8b00085c51a61e57b5fbc83b0c | 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 |
FFmpeg | 86ab6b6e08e2982fb5785e0691c0a7e289339ffb | 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, &v... | 17,896 |
FFmpeg | aac46e088d67a390489af686b846dea4987d8ffb | 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... | 17,897 |
FFmpeg | e53c9065ca08a9153ecc73a6a8940bcc6d667e58 | 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 (re... | 17,898 |
FFmpeg | 6a63ff19b6a7fe3bc32c7fb4a62fca8f65786432 | 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) && // defa... | 17,899 |
FFmpeg | 3e207bb1bd822ee1bce3e2de4c784702e0b6e24a | 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= d... | 17,900 |
FFmpeg | 7e7e59409294af9caa63808e56c5cc824c98b4fc | 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];
... | 17,901 |
FFmpeg | 229843aa359ae0c9519977d7fa952688db63f559 | 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 |
FFmpeg | c16184e9baad4e4304d5bfb9340e8b5b6decad65 | 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_STRI... | 17,903 |
FFmpeg | 44e6eeb30de8e2d20db56284984da4615763525c | 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(EIN... | 17,905 |
FFmpeg | 065ee1ec325ed7d34acf13d0bf319c1c6b457e21 | 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 vola... | 17,906 |
FFmpeg | cdfd9717edac118968e63e6f83c3e45a7e337833 | 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(... | 17,907 |
FFmpeg | a566c952f905639456966413fee0b5701867ddcd | 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[T... | 17,910 |
FFmpeg | 4e745ea83eee0010c0e2f228f47d1394ed1e2170 | 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 */
... | 17,911 |
qemu | 7453c96b78c2b09aa72924f933bb9616e5474194 | 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,... | 17,912 |
FFmpeg | 486637af8ef29ec215e0e0b7ecd3b5470f0e04e5 | 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 |
FFmpeg | 7845f8d282a98d5e01aaeddfa9af698697d8874d | 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_... | 17,915 |
FFmpeg | 035e932d7c039030bd8142bf2f99cbbd1d3e92cf | 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 (... | 17,916 |
FFmpeg | 23849339855875b737aee94813b31ddde2e40f9a | 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;
... | 17,917 |
FFmpeg | ee9f36a88eb3e2706ea659acb0ca80c414fa5d8a | 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 */
... | 17,918 |
FFmpeg | ac5057c2de1678847f1ce5b508fc18a9126b5e20 | 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 a... | 17,919 |
FFmpeg | 3f5d6a665aba439a9309ed735e71403d236a313d | 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 co... | 17,920 |
FFmpeg | cca1a4265388eed91156216cec7ed5c8c9f8016d | 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 ... | 17,921 |
FFmpeg | cdf0877bc341684c56ac1fe057397adbadf329ee | 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... | 17,922 |
qemu | 240ce26a0533a6e5ee472789fbfbd9f7f939197e | 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;
... | 17,923 |
FFmpeg | eb3628d87f67b35e8dd354a466028e93bdd7f9c0 | 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... | 17,924 |
qemu | c9b308d20b642c106048f088ccc31f2aa7cf59ba | 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->sc... | 17,926 |
FFmpeg | d7e9533aa06f4073a27812349b35ba5fede11ca1 | 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,
... | 17,927 |
qemu | 089da572b956ef0f8f5b8d5917358e07892a77c2 | 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, (uint... | 17,928 |
qemu | c952b71582e2e4be286087ad34de5e3ec1b8d974 | 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_... | 17,930 |
FFmpeg | 7d132c544b2447ef5a6b04ca6f21e245d6a48986 | 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 >... | 17,931 |
FFmpeg | 17ae608127324cabd083202a32a8dc210d30c3a1 | 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_mpeg4a... | 17,934 |
qemu | 107e4b352cc309f9bd7588ef1a44549200620078 | 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) {... | 17,935 |
FFmpeg | 74bd17d31648c77d01a0d35b09724715bc40fba2 | 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) {
... | 17,936 |
qemu | 7e274652e4e2225298a2735c3dcc74f2f8ba7b07 | 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... | 17,937 |
qemu | e206ad48333c50373663945746828fc893b50700 | 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();
Me... | 17,939 |
qemu | c489780203f9b22aca5539ec7589b7140bdc951f | 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 |
qemu | e864cabdc0a38bb598ddcf88b264896dc6f3e3b2 | 1 | PPC_OP(clear_xer_cr)
{
xer_so = 0;
xer_ov = 0;
xer_ca = 0;
RETURN();
}
| 17,941 |
FFmpeg | 4b192ffdbe226461d8a07fd36d655ec13b2c7582 | 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;
... | 17,942 |
qemu | 4cad3867b6df2c0826ae508a9fe15dd0b9d8936a | 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 |
FFmpeg | 6cf31ef263d36f6b89d9b64f15ca81cef4f24901 | 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;... | 17,945 |
qemu | 06b106889a09277617fc8c542397a9f595ee605a | 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;
... | 17,946 |
qemu | 630530a6529bc3da9ab8aead7053dc753cb9ac77 | 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;
... | 17,947 |
qemu | 02c4f26b1517d9e403ec10d6f6ca3c0276d19e43 | 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;
i... | 17,948 |
qemu | 6eaeae37a5fdd0a1ef88ed9ab4b807669ffc0e2d | 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, N... | 17,949 |
qemu | 42a268c241183877192c376d03bd9b6d527407c7 | 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... | 17,950 |
qemu | f06b2031a31cdd3acf6f61a977e505b8c6b58f73 | 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... | 17,951 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 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 |
qemu | 1a6d39fd71ddf90c5b76026cac4d5ff51fbaf8d8 | 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... | 17,955 |
qemu | 6acbe4c6f18e7de00481ff30574262b58526de45 | 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 |
qemu | 4a80dba3920cf8e0829b9ce4769842ce94748bf4 | 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) {
... | 17,957 |
qemu | 1e7855a558085d6acd0aba4e3278b594d05df1ec | 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)
... | 17,959 |
qemu | f61eddcb2bb5cbbdd1d911b7e937db9affc29028 | 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) {
fla... | 17,960 |
qemu | a517e88baa9bef2b5c54a11d62b2b2ab2a5c4ab7 | 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(de... | 17,961 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static void isa_mmio_writel(void *opaque, target_phys_addr_t addr,
uint32_t val)
{
cpu_outl(addr & IOPORTS_MASK, val);
}
| 17,962 |
qemu | a7812ae412311d7d47f8aa85656faadac9d64b56 | 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_te... | 17,963 |
FFmpeg | 6ff0ad6bfd0f00a3d54705811ee91a7ce3c22cda | 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\... | 17,965 |
qemu | 2a1639291bf9f3c88c62d10459fedaa677536ff5 | 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(revi... | 17,966 |
qemu | 9be385980d37e8f4fd33f605f5fb1c3d144170a8 | 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 |
qemu | 7d7a337ec32c77f11ba04da412752b35e18d3c5c | 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 ... | 17,968 |
qemu | bd269ebc82fbaa5fe7ce5bc7c1770ac8acecd884 | 0 | void qio_dns_resolver_lookup_result(QIODNSResolver *resolver,
QIOTask *task,
size_t *naddrs,
SocketAddressLegacy ***addrs)
{
struct QIODNSResolverLookupData *data =
qio_task_get_result_pointer(t... | 17,969 |
qemu | 9f0eb9e129398d8907ec990b18c03f20ee0de15e | 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... | 17,970 |
qemu | 1c59eb39cf75e660b1ac4ea95ef789c84021a1c4 | 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 |
qemu | 0e9b9edae7bebfd31fdbead4ccbbce03876a7edd | 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((c... | 17,973 |
qemu | c3a3a7d356c4df2fe145037172ae52cba5f545a5 | 0 | static int kvm_has_msr_hsave_pa(CPUState *env)
{
kvm_supported_msrs(env);
return has_msr_hsave_pa;
}
| 17,974 |
qemu | c759a790b672b0c5bfc50520dcc93565b55732b3 | 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 |
FFmpeg | 857797bc1455468f9d70565ac087c3f57d8e67ff | 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... | 17,976 |
qemu | f9ce8e0aa3fb55ae7a8ea34d3169e73e87feb337 | 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) ... | 17,977 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.